---
title: "POST /uploads"
method: POST
path: "/uploads"
---

# POST /uploads

`POST /uploads`

Initiate an upload session with specified file metadata

## Headers

- `X-API-Version` '1.0.0'

## Request body

- PostUploadsRequestSchema
  - `bytes` integer, required — The number of bytes in the file you are uploading
  - `filename` string, required — The name of the file to upload
  - `mime_type` 'image/jpeg' | 'image/jpg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/x-icon' | 'audio/mp3' | 'audio/mpeg' | 'audio/wav' | 'audio/x-wav' | 'application/jsonl' | 'application/json' | 'text/plain' | 'video/mp4' | 'application/pdf', required — The MIME type of the file. Must be one of the supported MIME type for the given purpose.
  - `purpose` 'attachment' | 'ephemeral_attachment' | 'image_generation_result' | 'messages_finetune' | 'messages_eval' | 'metadata', required — Intended purpose of the uploaded file.

## Response `201`

Response for initiating an upload session

- PostUploadsResponseSchema
  - `id` string, required — The unique upload session identifier to use for uploading the file
  - `bytes` integer, required — The number of bytes in the file you are uploading
  - `filename` string, required — The name of the file to upload
  - `mime_type` 'image/jpeg' | 'image/jpg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/x-icon' | 'audio/mp3' | 'audio/mpeg' | 'audio/wav' | 'audio/x-wav' | 'application/jsonl' | 'application/json' | 'text/plain' | 'video/mp4' | 'application/pdf', required — The MIME type of the file. Must be one of the supported MIME type for the given purpose.
  - `purpose` 'attachment' | 'ephemeral_attachment' | 'image_generation_result' | 'messages_finetune' | 'messages_eval' | 'metadata', required — Intended purpose of the uploaded file.

---

[API](https://skmtc.net/meta-llama/apis/llama-api-specification.md) · [All operations](https://skmtc.net/meta-llama/apis/llama-api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/meta-llama/llama-api-specification/versions/edf0a308dd29/schema)
