Skip to main content
POST

Authorizations

Authorization
string
header
required

A Square1 API key: Authorization: Bearer sq-arca-... (legacy ws-... keys remain valid). Create and rotate keys from the dashboard.

Body

application/json
model
string
required

A catalog model id from GET /v1/models, or a BYOK reference (@provider/model or @provider:label/model).

Examples:

"deepseek-v4-pro"

"@openai/gpt-5.1"

messages
(System message · object | User message · object | Assistant message · object | Tool result message · object)[]
required
stream
boolean
default:false
temperature
number
max_tokens
integer

Output token cap. Clamped to the model's max_output_tokens.

top_p
number
stop
reasoning_effort
string

Vendor extension for models with supports_reasoning. The accepted values are per-model (subsets of none, low, high, max); an unsupported value returns 400 invalid_reasoning_effort with the allowed values in the message.

tools
object[]

Function tools (models with supports_tools only; otherwise 400 tools_not_supported). Up to 128 tools; names must match ^[a-zA-Z0-9_-]{1,64}$.

tool_choice
Available options:
auto,
required,
none
parallel_tool_calls
boolean

Response

Completion result.

With stream: false the body is a single JSON object that carries the exact post-request quota receipt in the wellspring block.

With stream: true the body is a Server-Sent Events stream of data: lines, each a ChatCompletionChunk JSON object. The stream may interleave SSE comment lines (: ping) as keep-alive when the upstream is idle for more than 8 seconds — clients must ignore them. The final frames are: a chunk carrying usage and the wellspring receipt, then data: [DONE].

id
string
required
object
any
required
created
integer
required
model
string
required
choices
object[]
required
usage
object
required
wellspring
object

Per-request quota receipt (vendor extension, sibling of usage). Exact post-request figures — unlike the response headers, which are reservation-time estimates on streaming requests. In streams it arrives as its own frame immediately before data: [DONE]. This block is best-effort: on internal failure it is omitted rather than failing the request.