Skip to main content
POST
Create a model response

Authorizations

Authorization
string
header
required

A workspace API key in an Authorization: Bearer header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.

Body

application/json
model
string
required

The model to call, which the live catalog has to offer for the responses family. A provider-pinned id, {provider}/{that provider's own id}, is split once on the first slash. A routing-profile slug, profile/{identifier}, tries that profile's models in your own order. unirouter/auto, or its second spelling hopscotch/auto, names whichever route your workspace made its default. A bare model id is refused with 400 and the code model_id_not_pinned. GET /v1/models lists the exact strings this key can call.

Example:

"openai/gpt-4o-mini"

input
required

The Responses API input, forwarded opaquely: a string, or the array of typed input items the API accepts.

stream
boolean

Server-sent events instead of one JSON body.

store
boolean

On the platform's own provider keys this platform stores no response: an explicit true is refused with 400 naming this field in param, and an omitted store is sent to the provider as false. On your own provider key the provider keeps the response under your account if you ask it to, so true is forwarded and an omitted store is left for the provider's own default.

Response

The model response, in the Responses format, forwarded as the provider sent it.

When stream is true the body is text/event-stream instead, and the token counts arrive on a :x-hopscotch-usage comment line immediately before the stream ends; the server-sent events specification requires parsers to ignore comment lines, so an SDK never sees it.