Upload a file
POST/v1/files
Upload a file for use with the Batch API. OpenAI-compatible: send multipart/form-data with a purpose of batch and a JSONL file whose lines are batch request objects. DVARA applies the workspace's configured PII action to the complete upload as one text blob before choosing a batch-capable provider. It does not run each JSONL line through the live model-call pipeline. On the Enterprise platform, it also reads the model each line names and refuses the upload if the workspace may not use one of them. The default upload limit is 100 MB and can be changed with DVARA_BATCH_MAX_FILE_SIZE. OpenAI and Azure OpenAI declare production batch support; the Mock provider supports the flow for local development and tests.
Request
Responses
- 200
- 400
- 401
- 403
- 413
- 502
Uploaded file
The configured PII action blocked the upload (pii_detected); no registered provider supports batches or the provider named is unknown (no_capable_provider); or, on the Enterprise platform, a line is not a JSON object or names no model in body.model (invalid_request, with the line and custom_id in the error).
No key was sent (api_key_required), or the key is unknown (invalid_api_key), revoked (api_key_revoked) or expired (api_key_expired).
The key is valid but its nonempty scope list does not include batches:write (api_key_scope). On file upload and batch submit, a suspended workspace is also refused (workspace_suspended). On the Enterprise platform, upload and submit are also refused (policy_denied) when a JSONL line names a model the workspace may not use. The error names the first such line in line and custom_id.
The upload exceeds the configured multipart file-size limit. The code is FILE_TOO_LARGE, in upper case, with type input_size_error.
Every configured provider on the route (and every fallback) has failed.