Skip to main content
POST
Create batch
Requires workspace preview access. See Video and batch jobs for setup, webhooks, and result handling.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
provider_options
object

Extensions scoped by canonical provider ID. OpenAI accepts output_expires_after; Mistral accepts metadata. Only the selected provider's options are applied. Do not duplicate an option at the top level. Options cannot override priced rows, models or files.

model
string

Model id used to infer the upstream batch provider. Request rows may also include body.model; the top-level model is preferred.

prompts
string[]

Simple prompt shorthand. Phaseo compiles each prompt into a provider-native batch row for the selected model.

items
object[]

Structured prompt shorthand. Items may include id, custom_id, prompt, messages, input, system, max_tokens, temperature, or an advanced body.

system
string

Optional system instruction applied to prompt shorthand rows.

max_tokens
integer

Optional max token limit applied to prompt shorthand rows.

temperature
number

Optional sampling temperature applied to prompt shorthand rows.

input_file_id
string

Existing provider file ID for file-upload batch creation.

requests
object[]

Advanced batch request rows. Provide exactly one of prompts, items, requests, or input_file_id.

endpoint
enum<string>

Caller-facing request shape. Every request in a batch uses this endpoint. Phaseo chooses a provider-native default from the model when omitted.

Available options:
/v1/chat/completions,
/v1/responses,
/v1/messages,
/v1/embeddings,
/v1/generateContent
completion_window
string
metadata
object
session_id
string

Unique identifier for grouping related requests (for example, a conversation or agent workflow) for observability.

Maximum string length: 256
webhook
object
webhook_endpoint_id
string

Convenience alias for webhook.endpoint_id.

debug
object

Gateway debug controls. These flags are never forwarded upstream.

provider
object

Advanced routing constraint. Most requests should rely on model-based provider inference.

Response

Batch status response

id
string
native_batch_id
string | null

Provider-native batch id when it differs from the gateway-owned id.

object
string
endpoint
string
errors
object
input_file_id
string
completion_window
string
status
string
lifecycle_status
enum<string>

Normalized async lifecycle status for polling, websocket, and webhook consumers.

Available options:
pending,
running,
completed,
failed,
cancelled,
expired
progress
integer

Coarse batch completion percentage derived from provider request counts when available. Completed batches report 100.

Required range: 0 <= x <= 100
polling_url
string<uri>
websocket_url
string<uri>

WebSocket URL for subscribing to normalized async job lifecycle updates.

cancel_url
string<uri> | null

Reserved for compatibility; currently always null.

results_url
string<uri> | null

Authenticated Phaseo JSONL download URL for terminal supported batches. Null while processing. A terminal batch may have no output. Use an API key from the owning workspace; provider retention limits apply.

output_file_id
string
error_file_id
string
created_at
integer
in_progress_at
integer
expires_at
integer
finalizing_at
integer
completed_at
integer
failed_at
integer
expired_at
integer
cancelling_at
integer
cancelled_at
integer
request_counts
object
metadata
object
request_id
string
provider
string
session_id
string
webhook
object

Sanitized async webhook configuration plus delivery state. Secrets are never returned; has_secret indicates whether signed deliveries are enabled. Signed deliveries include x-phaseo-signature, x-phaseo-timestamp, x-phaseo-event-id, x-phaseo-event-type, x-phaseo-delivery-key, x-phaseo-attempt, and x-phaseo-max-attempts headers.

next_webhook_retry_at
string | null
last_webhook_progress
number | null
last_webhook_progress_at
string | null
last_webhook_dispatched_at
string | null
finalized_at
string | null
pricing_lines
object[]
usage
object

Normalised aggregate usage and cost after finalisation.

billing
object
Last modified on September 6, 2026