Methods: client.create_batch(), client.get_batch(), client.cancel_batch(), client.get_async_job_websocket_url("batch", batch_id, ...), client.batches.websocket_url(batch_id, ...).
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.
items: Structured prompt shorthand with id / custom_id, prompt, messages, per-row settings, or an advanced body.
requests: Advanced inline provider-native batch rows.
input_file_id: Existing file id uploaded through /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: Upstream batch completion window such as 24h.
session_id: Optional Phaseo grouping id for logs, sessions, and investigate tooling.
webhook: Optional webhook configuration for async lifecycle notifications.
metadata: Optional object persisted with the batch.
Use exactly one input source per batch: prompts, items, requests, or input_file_id.
Batch responses also surface gateway observability fields such as request_id, provider, echoed session_id / webhook, and terminal billing / pricing_lines when available.
Use client.batches.websocket_url(...) when you want to subscribe to the documented /v1/async/batch/{id}/ws lifecycle stream instead of polling only.
Use client.get_async_job_websocket_url("batch", batch_id, ...) 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