Chat completions
POST /v1/chat/completions, the fields we accept, and what we reject.
The request and response follow the OpenAI Chat Completions format. Batchwell is strict: every field is checked against an allowlist, and anything we do not support is rejected with a 400 rather than silently dropped.
| Field | Notes |
|---|---|
model | Required. A model id from GET /v1/models. |
models | Optional fallback list, up to 5 ids. See routing. |
messages | Required. Text only (see below). |
max_tokens / max_completion_tokens | Output cap. Defaults to the model's default maximum. |
temperature, top_p, stop | Sampling controls. |
stream, stream_options | See streaming. |
tools, tool_choice | Function calling, where the model supports it. |
reasoning_effort | For reasoning models. |
provider | Routing preferences. See routing. |
Message content must be a string or an array of parts of type text. Parts of type image_url, input_audio or
file are rejected with 400 unsupported_content.
ngreater than 1,logprobsandtop_logprobs→400.- Any field not in the table above →
400 unsupported_parameter. The error message names the field.
A normal OpenAI response, plus:
usage.: the amount charged for this request, in micro-USD (1,000,000 = $1).cost_micro choices[].:message. batchwell { "generation_id", "model", "provider", "ai_generated": true }, a machine-readable marker that the content is AI-generated.- Headers
x-batchwell-generation-idandx-batchwell-model(the model that actually answered).
Before a model runs we hold enough credit for your input plus the full output cap at the price of the dearest model in
model + models. When the request ends we charge only what was used and release the rest. If the hold cannot be
placed you get 402 insufficient_credit and nothing runs.