Documentation › The endpoint

Responses

Every answer has OpenAI's shape and carries its passport: the id, the public page, the .ospp file and the outcome address, as response headers and under ospp in the body.

The answer#

The body is a standard chat completion: id, object, created, model, choices with the assistant message and finish_reason, and usage with the token counts. model is the value you sent. id is chatcmpl- followed by the run id. finish_reason is stop, length, content_filter or tool_calls. Existing clients read it unchanged.

Response headers#

Which headers an answer carries depends on how it was delivered.

Response headerNormal answerPending passportStreamed, answer first
X-OSPP-RunYesYesYes
X-OSPP-NodeYesYesYes
X-OSPP-Outcome-URLYesYesYes
X-OSPP-PassportYesNoNo
X-OSPP-Verify-URLYesNoNo
X-OSPP-Passport-FileYesNoNo
X-OSPP-Passport-StatusNopendingpending
Response headerMeaning
X-OSPP-RunThe run id of this call
X-OSPP-NodeThe node and version the call was counted under, for example support-bot@3f9a1c2b7d10
X-OSPP-Outcome-URLThis call's outcome address; see outcomes
X-OSPP-PassportThe passport id
X-OSPP-Verify-URLThe passport's public page: https://www.ospp.it.com/api/v1/public/passports/<id>
X-OSPP-Passport-FileThe download URL of the .ospp file: the verify URL followed by /bundle. It is public and is saved as <id>.ospp
X-OSPP-Passport-Statuspending: the passport was not issued yet when the headers were sent

A streamed answer that waits for its passport (passport first) has the headers of a normal answer. An answer-first stream sends its headers before the model has answered, so its passport is in the last chunk of the stream instead; see streaming.

The ospp object#

The same is in the JSON body, under ospp:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1794650000,
  "model": "provider/model-name",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop", "logprobs": null}],
  "usage": {"prompt_tokens": 21, "completion_tokens": 48, "total_tokens": 69},
  "ospp": {
    "run_id": "...",
    "node": "support-bot@3f9a1c2b7d10",
    "node_family": "support-bot",
    "passport_id": "...",
    "passport_status": "CERTIFIED",
    "validation": "...",
    "signed_by": "ospp-hosted client key",
    "verify_url": "https://www.ospp.it.com/api/v1/public/passports/...",
    "passport_file_url": "https://www.ospp.it.com/api/v1/public/passports/.../bundle",
    "outcome_url": "https://www.ospp.it.com/api/v1/o/.../...",
    "trace": "conv-8f21",
    "measurements": {}
  }
}
FieldMeaning
run_idThe run id of this call. Always present
nodeThe node and version, as in X-OSPP-Node. Always present
node_familyThe node's name without the version. Always present
passport_idThe passport id, or null while the passport is pending
passport_statusCERTIFIED when the passport is issued, PENDING when it is not yet
validationPresent with an issued passport: the label the passport carries. It refers to the log being cosigned by the validators, not to the answer being checked
signed_byWhose key signed the request. Through the Cloud endpoint: ospp-hosted client key, the key OSPP keeps for your organisation
verify_urlPresent with an issued passport: the passport's public page
passport_file_urlPresent with an issued passport: the .ospp file
outcome_urlThis call's outcome address. Always present
tracePresent when you sent X-OSPP-Trace
measurementsPresent when the passport carries them: what OSPP measured for the call, such as tokens and cost. See figures

Clients that ignore unknown fields are not affected by ospp.

Reading it from a client#

Use the body field, or the headers. With the openai Python client:

raw = client.chat.completions.with_raw_response.create(model="provider/model-name", messages=messages)
completion = raw.parse()

passport_id = raw.headers.get("x-ospp-passport")
verify_url = raw.headers.get("x-ospp-verify-url")
outcome_url = raw.headers.get("x-ospp-outcome-url")

ospp = completion.model_extra["ospp"]   # the same, from the body

Keep the passport id with the answer in your own system. Treat the outcome URL as a secret: whoever holds it can report an outcome for this call.

Pending passports#

Issuing a passport takes a moment after the model has answered. OSPP holds the answer for a short time to wait for it, about 30 seconds on an answer that is not streamed live. If the passport is not issued by then, the answer leaves without it and carries:

  • X-OSPP-Passport-Status: pending, with X-OSPP-Run and X-OSPP-Outcome-URL, and no X-OSPP-Passport, X-OSPP-Verify-URL or X-OSPP-Passport-File;
  • in the body, "passport_id": null and "passport_status": "PENDING" with the run_id, and no verify_url, passport_file_url or validation.

The passport follows. Read it later with your API key:

curl https://www.ospp.it.com/api/v1/runs/<run_id> \
  -H "Authorization: Bearer $OSPP_API_KEY"

The answer has the call's status. Once it is CERTIFIED, the passport id is in certification.passport_id; the public page is then https://www.ospp.it.com/api/v1/public/passports/<id> and the file is that URL followed by /bundle. The call is also found on the Platform, in passport management.

The outcome address is returned with a pending answer as well. It accepts an outcome once the passport is issued; before that it answers 409 PASSPORT_PENDING. See outcomes.

What the passport tells you, and what not#

A passport returned with an answer means the call was recorded with its fingerprints in the cosigned log. It does not mean the answer was checked: nobody, the validators included, judges whether an answer is correct. See what a passport proves.

When no answer comes back#

Errors use OpenAI's error shape. When a call was started before the error, the error response still carries X-OSPP-Run and X-OSPP-Outcome-URL. See errors.

Self-hosted#

Through the local proxy a successful answer has the same shape and the same headers, X-OSPP-Passport-File and X-OSPP-Outcome-URL included, and ospp also has sealed. finish_reason is stop or tool_calls only. The proxy waits for the passport up to its own timeout (170 seconds unless you set another), not 30 seconds. Its error responses carry no X-OSPP-Run header. ospp.signed_by is then own client key: the request was signed on your machine. See the local proxy.