Create a batch

Create an OpenAI-compatible batch processing job from an uploaded JSONL file. provider_id is required and selects the customer-owned provider credential used for the 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, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Headers

X-Data-Respan-ParamsstringOptional

Base64-encoded JSON object of Respan request parameters. Legacy X-Data-Keywordsai-Params is still accepted.

Request

This endpoint expects an object.
input_file_idstringRequired
Uploaded JSONL file ID.
endpointenumRequired
Endpoint each JSONL request targets.
Allowed values:
completion_windowenumRequired
Allowed values:
provider_idstringRequired

Provider route with customer-owned credentials.

metadatamap from strings to anyOptional
Custom metadata for tracking.
customer_identifierstringOptional

End-user identifier for logging.

custom_identifierstringOptional
Custom identifier for querying.
thread_identifierstringOptional
Conversation thread identifier.
environmentstringOptional
Environment tag.

Response

Created batch.
idstring
Batch ID.
statusenum
objectstringOptional
endpointstringOptional
input_file_idstringOptional
output_file_idstring or nullOptional
Output file ID, available when the batch completes.
error_file_idstring or nullOptional
Error file ID, when provider errors are available.
completion_windowstringOptional
created_atintegerOptional
Unix timestamp.
in_progress_atinteger or nullOptional
expires_atinteger or nullOptional
finalizing_atinteger or nullOptional
completed_atinteger or nullOptional
failed_atinteger or nullOptional
expired_atinteger or nullOptional
cancelling_atinteger or nullOptional
cancelled_atinteger or nullOptional
request_countsobjectOptional
metadatamap from strings to anyOptional
errorsany or nullOptional
Provider error details, when available.

Errors

400
Bad Request Error
401
Unauthorized Error