Documentation › Start here

Quick start: your first passport in five minutes

Create an organisation, change the base URL of an OpenAI-compatible client, read the passport from the answer, and optionally post an outcome.

1. Create an organisation and copy the API key#

Open the Platform and sign in with Google, Microsoft, Amazon or an e-mail address and password. Create an organisation. It starts on the free plan: 25 executions, no card. The organisation's API key is shown once; copy it.

This quick start uses OSPP Cloud. For a self-hosted organisation the steps are the same, with the base URL of the local proxy on your own machine; see the local proxy.

2. Change the base URL#

OSPP speaks the OpenAI chat API. Point your client at OSPP and use the OSPP API key as its key. With the official openai Python client:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://www.ospp.it.com/api/v1/openai",
    api_key=os.environ["OSPP_API_KEY"],
)

raw = client.chat.completions.with_raw_response.create(
    model="provider/model-name",
    messages=[
        {"role": "system", "content": "You answer support questions briefly."},
        {"role": "user", "content": "How do I reset my password?"},
    ],
    extra_headers={"X-OSPP-Node": "support-bot"},
)
completion = raw.parse()
print(completion.choices[0].message.content)

An application that reads its settings from the environment needs only these two variables:

OPENAI_BASE_URL=https://www.ospp.it.com/api/v1/openai
OPENAI_API_KEY=<your OSPP API key>

The same call with curl:

curl -i https://www.ospp.it.com/api/v1/openai/chat/completions \
  -H "Authorization: Bearer $OSPP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-OSPP-Node: support-bot" \
  -d '{"model": "provider/model-name", "messages": [{"role": "user", "content": "How do I reset my password?"}]}'

Replace provider/model-name with a model from GET /models; see models. A misspelled name is refused with status 404; the message lists close names when there are any. The X-OSPP-Node header is optional: it names the task so its calls are grouped. See request headers.

3. Read the passport#

The answer has the usual OpenAI shape. The passport travels with it, as response headers and under ospp in the JSON body:

print(raw.headers["x-ospp-passport"])        # the passport id
print(raw.headers["x-ospp-verify-url"])      # the public page
print(raw.headers["x-ospp-passport-file"])   # the .ospp file
print(raw.headers["x-ospp-outcome-url"])     # this call's outcome address

Open the verify URL in a browser. It is the passport's public page, https://www.ospp.it.com/api/v1/public/passports/<id>, and it can verify the passport again on your own machine. You can also download the .ospp file and check it at /validator/.

If the answer carries X-OSPP-Passport-Status: pending instead of a passport id, the passport was not issued yet when the answer left; it follows. Read it later with GET /v1/runs/{run_id}, using the run id from X-OSPP-Run. A streamed answer may also carry its passport in the last chunk of the stream instead of the headers. See responses and streaming.

Keep the passport id with the answer in your own system. That is how a decision is traced back to the call that produced it later.

The passport says that the call was recorded, with its fingerprints, in a log that validators cosign. It does not say that the answer was checked or is correct; see what a passport proves.

4. Optional: post an outcome#

An outcome says what happened afterwards: a score, a count. Post it to the outcome URL from the answer. No API key is needed, so treat the URL as a secret.

curl -X POST "$OUTCOME_URL" \
  -H "Content-Type: application/json" \
  -d '{"values": {"score": 1}}'

Every node takes two metrics without setup, score and count, both whole numbers. The address accepts an outcome once the passport is issued; while it is pending it answers 409 PASSPORT_PENDING, and you send the outcome again a moment later. See outcomes.

5. Switch Model Compare on early, where you expect to compare#

By default the conversation and the answer of a call are deleted about an hour after the call. Their fingerprints and the passport stay. To run past calls again on another model later, a node needs Model Compare switched on, on the Platform: the conversation and answer of its later calls are then kept encrypted for the node's retention period, 30 days unless you set another. It is not retroactive: only calls made after the switch can be run again. If you expect to compare models for a node, switch it on now. See Model Compare.

What OSPP keeps in any case#

OSPP always keeps the node's definition: the model, the parameters, the system prompt and the tool definitions. That does not depend on Model Compare. In the example above, "You answer support questions briefly." is kept; "How do I reset my password?" is conversation and is not, unless Model Compare is on. Text that must not be stored goes in the conversation, not in the system prompt.

What the free plan covers#

25 executions. Past that, a prepaid balance or a plan carries your calls; see plans.

Next#