Documentation › The endpoint

The endpoint

One OpenAI-compatible endpoint is the only way to integrate. Change the base URL, use your OSPP API key, name the model, and every call comes back with a passport.

Base URL and key#

https://www.ospp.it.com/api/v1/openai
CallWhat it does
POST /chat/completionsOne call to the model you name. Returns the answer in OpenAI's shape, with its passport
GET /modelsThe models you can name, with what each supports and its price per million tokens

Authenticate with your OSPP API key as a Bearer token: Authorization: Bearer <your OSPP API key>. The key is created with your organisation on the Platform; see settings and keys.

Client setup#

Any client that speaks the OpenAI chat API works by changing two settings. From the environment:

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

In code, 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"],
)
completion = client.chat.completions.create(
    model="provider/model-name",
    messages=[{"role": "user", "content": "Hello"}],
)

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" \
  -d '{"model": "provider/model-name", "messages": [{"role": "user", "content": "Hello"}]}'

What OSPP does with a call#

OSPP sends the request to the model you named, returns the answer, and issues a passport for the call. It never substitutes another model. The answer carries the passport id, its public page, the .ospp file and the call's outcome address; see responses.

Nothing is set up before the first call. Calls are grouped into nodes by the optional X-OSPP-Node header, or per model, parameters, system prompt and tool definitions without it; see request headers.

What OSPP keeps of a call#

  • The node's definition: the model, the parameters, the system prompt and the tool definitions. OSPP always keeps it. It is what groups calls into a node and what the passport's fingerprint of the node is made from.
  • The conversation and the answer: the messages after the system messages, and what the model returned. By default they are deleted about an hour after the call; their fingerprints and the passport stay. A call whose passport is still pending is kept until it is issued, at most a day. A legal hold or your own evidence retention policy keeps content longer. With Model Compare on for the node, they are kept encrypted for the node's retention period, 30 days unless you set another.

Text that must not be stored goes in the conversation, not in the system prompt.

Request fields#

Text chat completions with tools. The fields OSPP takes:

FieldAccepted
modelRequired. provider/model, or a plain model name only one provider offers. See models
messagesRoles system, developer, user, assistant, tool. Text content only: a string, or a list of text parts. System messages come first; at most 500 messages after them
temperature0 to 2, in steps of 0.1
max_tokens, max_completion_tokensA positive whole number
seedA whole number
stopA string, or up to 4 strings
response_formattext; json_object where the model's supports.json_output is true; json_schema where its supports.json_schema is true. See models
reasoning_effortA string, passed to the model
tools, tool_choice, parallel_tool_callsSee tool calling
streamtrue is accepted. Where streamed calls are enabled the answer arrives as the model writes it; see streaming

What is refused, and how, is on the errors page.

Cloud and Self-hosted#

On OSPP Cloud the base URL above is the endpoint. A self-hosted organisation uses the same endpoint on its own gateway, through the local proxy (ospp proxy, see the local proxy for the install line); the base URL is then the proxy's address. The conversation and the answer then never reach OSPP in readable form: they pass OSPP's API only sealed, and OSPP does not store them. The node's definition, system prompt and tool definitions included, does: the proxy sends it so that OSPP can name and register the node. A self-hosted organisation that calls the Cloud base URL is refused with status 409 (self_hosted_gateway) and a message pointing to the proxy. The proxy does not stream live; Model Compare, opening a call's content and running a call again on another model from the Platform are Cloud only. See the local proxy.

The pages of this section#