Documentation › The endpoint

Request headers

Six optional headers name the task, group the calls of one conversation, attach your own reference, keep a call's content out of storage, make a streamed answer wait for its passport, and make retries safe.

Overview#

All of these are optional. A call without any of them still gets its passport.

HeaderExampleWhat it does
X-OSPP-Nodesupport-botNames the task, so its calls are grouped as one node
X-OSPP-Traceconv-8f21Groups the calls of one conversation or agent task
X-OSPP-Referenceticket-48211Your own id for the call, findable later
X-OSPP-StorefalseDo not keep this call's conversation and answer, even when Model Compare is on
X-OSPP-Streampassport-firstA streamed answer waits for its passport
Idempotency-Key7c1e...Makes a retry return the same call

The only required header is Authorization: Bearer <your OSPP API key>.

X-OSPP-Node#

Names the node the call belongs to. Lowercase letters and digits, with hyphens after the first character, at most 60 characters. Capital letters are lowered. Any other value is refused with status 400 and the code invalid_node_name.

Use one name per task, for example support-bot or invoice-summary. The node needs no setup: the first call with a new name creates it. Inside a named node, a changed model, parameter, system prompt or tool definition is a new version of the same node, so its figures stay together and can be compared.

Without the header, OSPP groups calls per model, parameters, system prompt and tool definitions, under a name it makes itself that starts with chat-.

X-OSPP-Provider#

Names the provider for a call whose model is a plain name that more than one provider offers. Writing provider/model in model does the same and is the usual way.

X-OSPP-Trace#

An id of your choice: 1 to 120 visible ASCII characters, without spaces. Letters, digits and punctuation are fine; spaces, control characters and characters outside ASCII are not. A value that does not fit is refused with status 400 and the code invalid_trace.

Send the same value on every call of one conversation or one agent task. The calls keep their own passports; the trace groups them, so the round trips of a tool-calling task can be found together in passport management and with GET /v1/calls?trace=.... The answer repeats the trace under ospp.trace. See tool calling.

X-OSPP-Reference#

Your own id for what the call was about: a case number, a ticket number, an order id. You can search passports by reference on the Platform and report an outcome by reference through the outcome API. A reference longer than 200 characters is cut to its first 200. Do not put personal data or secrets in it.

X-OSPP-Store#

X-OSPP-Store: false keeps the conversation and the answer of this one call out of storage, even when Model Compare is on for its node. They are deleted about an hour after the call, as with Model Compare off. The call still gets its passport with fingerprints. It cannot be run again on another model later, and its content cannot be opened from the passport.

The value is true or false; leaving the header out is the same as true, and the node's Model Compare switch decides. Any other value is refused with status 400 and the code invalid_store.

With Model Compare off, the header changes nothing: the conversation and the answer are deleted about an hour after the call anyway.

The header is about the conversation and the answer. The node's definition (model, parameters, system prompt, tool definitions) is kept by OSPP regardless of this header and of Model Compare. Text that must not be stored goes in the conversation, not in the system prompt. See Model Compare.

X-OSPP-Stream#

X-OSPP-Stream: passport-first on a request with "stream": true makes the answer wait for its passport. It is then sent as a stream, with the passport in the response headers. Without the header, where streamed calls are enabled, the answer arrives as the model writes it and the passport follows at the end of the stream. The header has no effect on a request without "stream": true. See streaming.

Idempotency-Key#

A value of your choice, unique per request. A retry with the same key and the same conversation returns the same call instead of making a second one. See idempotency.

Sending headers from a client#

With the openai Python client, per call:

completion = client.chat.completions.create(
    model="provider/model-name",
    messages=messages,
    extra_headers={
        "X-OSPP-Node": "support-bot",
        "X-OSPP-Trace": conversation_id,
        "X-OSPP-Reference": ticket_number,
    },
)

Or once for every call of a client: OpenAI(base_url=..., api_key=..., default_headers={"X-OSPP-Node": "support-bot"}).

Self-hosted#

The local proxy of a self-hosted organisation takes X-OSPP-Node, X-OSPP-Provider, X-OSPP-Trace, X-OSPP-Reference, X-OSPP-Store and Idempotency-Key. It does not refuse a malformed trace, and it answers a retry with the same key with status 409 instead of the first answer. It does not stream live, so X-OSPP-Stream changes nothing there. See the local proxy.