Upload a file

Upload a file to the upstream OpenAI Files API. Batch jobs use JSONL files with purpose=batch.

Authentication

AuthorizationBearer

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, OpenAI or Azure OpenAI provider credentials go in Settings -> Providers or the request body credential_override field, not in this auth field.

Request

This endpoint expects a multipart form containing a file.
filefileRequired
File to upload.
purposestringRequired
File purpose.

Response

Uploaded file.
idstring
File ID.
objectstring
bytesinteger
File size in bytes.
created_atinteger
Unix timestamp.
filenamestring
purposestring
statusstring
File status.
status_detailsany or null
Provider status details, when available.

Errors

400
Bad Request Error
401
Unauthorized Error