Upload File
Upload a JSONL batch input file at /v1/files
Overview
Uploads a JSONL file of chat-completion requests withpurpose: batch and returns its file_ id. Pass that id as input_file_id to create a batch. Each line is a BatchInputLine; files are capped at 100 MB and 50,000 lines.Authorizations
Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.
Body
The file plus its purpose, as multipart form data.
Multipart form for uploading a batch input file.
The JSONL file to upload. Up to 100 MB and 50,000 lines; every line is a BatchInputLine.
Must be batch.
batch "batch"
Anchor for the expiry policy. Only created_at is supported. Send together with expires_after[seconds].
created_at "created_at"
Seconds after the anchor at which the file is deleted, from 3600 (1 hour) to 2592000 (30 days). Defaults to 30 days.
3600 <= x <= 25920002592000
Response
The stored file.
A file you uploaded, or one a batch wrote for you.
File identifier, file_ prefixed. Pass it as input_file_id when creating a batch.
"file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f"
Object type, always file.
"file"
Size of the file in bytes.
48211
Unix timestamp (seconds) for when the file was uploaded.
1780000000
Unix timestamp (seconds) for when the file and its content are deleted. Defaults to 30 days after upload (24 hours on zero-data-retention accounts).
1782592000
The filename you uploaded, or the generated name for batch output and error files.
"requests.jsonl"
batch for files you upload; batch_output for the output and error files a batch produces.
batch, batch_output "batch"
Deprecated OpenAI field, kept for SDK compatibility. Always uploaded.
uploaded, processed, error "uploaded"