API reference · API
Upload a batch input file (OpenAI wire format)
POST/v1/filesAPI key
Multipart with purpose=batch and a JSONL file: one {custom_id, method: POST, url, body} per line, every line targeting the same url, one of /v1/chat/completions or /v1/embeddings. The file is validated whole before it is stored: not JSON, a repeated custom_id, another url, or a file over ANTIMATTER_BATCH_MAX_FILE_BYTES (4 MiB) or ANTIMATTER_BATCH_MAX_LINES (1000) is refused. The file belongs to the key's account and nobody else can read it. Where vector stores are on (ANTIMATTER_VECTOR_STORES=1), purpose assistants (or user_data) stores a document for file search instead, under its own caps (ANTIMATTER_VECTOR_MAX_FILE_BYTES, 4 MiB; ANTIMATTER_VECTOR_MAX_FILES; ANTIMATTER_VECTOR_MAX_ACCOUNT_BYTES), read when a vector store takes it.
Request body
multipart/form-data, required
| Field | Type | What it is |
|---|---|---|
| filerequired | string | |
| purposerequired | string | One of "batch", "assistants", "user_data". |
Answer 200
The stored file.
| Field | Type | What it is |
|---|---|---|
| id | string | |
| object | "file" | |
| bytes | integer | |
| created_at | integer | |
| expires_at | null | |
| filename | string | |
| purpose | string | assistants and user_data are documents for file search (scripts/openapi-vector.ts). One of "batch", "batch_output", "assistants", "user_data". |
| status | "processed" | |
| status_details | null |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 403OpenAI shaped error.
- 413OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.