Upload a user_data file through the OpenAI Files API

POST
/v1/router/openai/v1/files

Native OpenAI Files upload adapter. Aliases: /openai/v1/files and /openai/{group}/v1/files. First cut supports one multipart file field, purpose=user_data only, PNG/JPEG/GIF/WebP, file bytes up to 8 MiB, and total multipart bodies up to 8 MiB plus 64 KiB. Idempotency-Key is unsupported. The API forwards bytes to Router/File and does not persist files itself. vision and other purposes are rejected. expires_after.anchor must be created_at and seconds must be 3600..2592000.

Authorization

AuthorizationBearer <token>

API key as Bearer token: Authorization: Bearer dp_sk_xxx

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/router/openai/v1/files" \  -F file="string" \  -F purpose="user_data"
{}