4e064cf81dae

latestOpenAPI 3.1.02026-08-131831,331960.0 KB
openAiBatch

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.

post/api/v1/batches

Headers

Authorizationstring required

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.

X-Data-Respan-Paramsstring

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

Request body

input_file_idstring required

Uploaded JSONL file ID.

endpoint'/v1/chat/completions' | '/v1/embeddings' required

Endpoint each JSONL request targets.

completion_window'24h' required
metadataobject

Custom metadata for tracking.

customer_identifierstring

End-user identifier for logging.

custom_identifierstring

Custom identifier for querying.

thread_identifierstring

Conversation thread identifier.

environmentstring

Environment tag.

provider_idstring required

Provider route with customer-owned credentials.

Response

Created batch.

idstring required

Batch ID.

objectstring
endpointstring
input_file_idstring
output_file_idstring nullable

Output file ID, available when the batch completes.

error_file_idstring nullable

Error file ID, when provider errors are available.

completion_windowstring
status'validating' | 'pending' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'expired' | 'cancelling' | 'cancelled' required
created_atinteger

Unix timestamp.

in_progress_atinteger nullable
expires_atinteger nullable
finalizing_atinteger nullable
completed_atinteger nullable
failed_atinteger nullable
expired_atinteger nullable
cancelling_atinteger nullable
cancelled_atinteger nullable
metadataobject
{"stackTrail":"components:schemas:OpenAI Batch_createBatch_Response_200:properties:errors:oneOf","oasType":"schema","type":"unknown","description":"Any type","nullable":true}