Skip to main content
Methods: client.createBatch(), client.getBatch(), client.cancelBatch(), client.getAsyncJobWebSocketUrl("batch", batchId, options), client.batches.create(), client.batches.get(), client.batches.cancel(), client.batches.websocketUrl().

Example

Key parameters

  • model: Model id used to infer the upstream provider. Most callers should not pass provider.
  • prompts: Simple shorthand for one or more prompt strings. Phaseo compiles these into provider-native batch rows.
  • items: Structured prompt shorthand with id / custom_id, prompt, messages, input, per-row settings, or an advanced body.
  • requests: Advanced inline provider-native batch rows.
  • input_file_id: Existing file id uploaded via /batches/files?model=... for large prebuilt JSONL inputs.
  • endpoint: Optional target endpoint for advanced rows. Phaseo chooses a model/provider default when omitted.
  • completion_window: e.g., 24h.
  • session_id: Optional Phaseo grouping id for logs, sessions, and investigate tooling.
  • webhook: Optional webhook configuration for async lifecycle notifications.
  • metadata: Optional object stored with the batch.
  • provider: Advanced routing constraint. Most requests should omit this and rely on model.
Use exactly one input source per batch: prompts, items, requests, or input_file_id.

Returns

BatchResponse Responses also include gateway observability fields such as request_id, provider, echoed session_id / webhook, and terminal billing / pricing_lines when settlement data is available. Use client.batches.websocketUrl(...) when you want to subscribe to the documented /v1/async/batch/{id}/ws lifecycle stream instead of polling only. Use client.getAsyncJobWebSocketUrl("batch", batch.id, options) when you already have a generic async job kind/id pair and do not want to go through the resource helper.
Last modified on July 26, 2026