files

Upload file

Upload a JSONL file for batch processing.

Each line must be a valid JSON object containing custom_id, method, url, and body fields. The model field in the body must reference a model your API key has access to.

post/files

Response

File uploaded and validated successfully.

bytesinteger required
context_namestring nullable

Context name: "Personal" for individual files, or the organization name

context_typestring nullable

Context type: "personal" or "organization"

created_atinteger required
created_by_emailstring nullable

Email of the individual who created this file (resolved from api_key attribution)

expires_atinteger nullable
filenamestring required
idstring required
object'file' required

Object type - always "file"

purpose'batch' | 'batch_output' | 'batch_error' required

Purpose for file

sourcestring nullable

Source: "sync" if ingested from an external connection, absent for uploaded files

source_namestring nullable

Name of the source connection (e.g. "prod-s3-inputs")

Example response

{
  "bytes": 12045,
  "created_at": 1703187200,
  "filename": "batch_requests.jsonl",
  "id": "file-abc123",
  "object": "file",
  "purpose": "batch"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.