OpenAI 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

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/v1/batches
  • Auth
    HTTP bearer

Headers

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.

Example request

{
  "input_file_id": "file-abc123",
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h",
  "metadata": {
    "project": "eval-run-1"
  },
  "customer_identifier": "user_123",
  "environment": "prod"
}

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
errorsunknown

Example response

{
  "id": "batch_abc123",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "input_file_id": "file-abc123",
  "completion_window": "24h",
  "status": "in_progress",
  "created_at": 1710000000,
  "request_counts": {
    "total": 100,
    "completed": 97,
    "failed": 3
  }
}

Changes

    • breaking

      request body became required

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • info

      api operation id openAiBatch_createBatch removed and replaced with createBatch

    • info

      api tag OpenAI Batch added

    • info

      api tag openAiBatch removed

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the non-success response with the status

    • info

      the response property became required for the status