Models
You name the model in the standard model field of every call. GET /models lists the models you can call, what each supports and its price.
You choose the model#
Every call names its model in the standard model field. OSPP calls that model and never substitutes another; the passport records the model you asked for. To change model, change the model value in your own code. Nothing has to change on OSPP.
How to write the name#
| Form | Example | When |
|---|---|---|
provider/model | provider/model-name | Works for every model in the list |
| Plain model name | model-name | When only one provider offers a model of that name |
A plain name that more than one provider offers is refused with status 400 and the code ambiguous_model; write provider/model.
A name OSPP does not know, for example a misspelled one, is refused with status 404 and the code model_not_found. That also holds for a name written as provider/model, whenever OSPP lists models for that provider. A provider OSPP does not list, or one not enabled for your organisation, is refused with status 400 and the code provider_not_enabled. A model_not_found message lists up to four close names when there are any; both messages point to GET /models. OSPP does not guess and does not answer with another model. See errors.
The models you can call are the ones GET /models returns.
Listing models#
curl https://www.ospp.it.com/api/v1/openai/models \
-H "Authorization: Bearer $OSPP_API_KEY"
With the openai client: client.models.list().
The answer has OpenAI's list shape. Each model's id is the name to put in model: the plain name when only one provider offers it, otherwise provider/model. Each entry also has an ospp object:
{
"object": "list",
"data": [
{
"id": "model-name",
"object": "model",
"created": 0,
"owned_by": "provider",
"ospp": {
"provider": "provider",
"model": "model-name",
"name": "provider/model-name",
"supports": {
"tools": true,
"json_output": true,
"json_schema": false,
"images": false,
"streaming": "live"
},
"price": {"currency": "USD", "input_per_1m": 0.5, "output_per_1m": 1.5}
}
}
]
}
The values above are placeholders, not a price.
| Field | Meaning |
|---|---|
ospp.provider, ospp.model | The two parts of the name |
ospp.name | The full provider/model form |
ospp.supports.tools | Tool calling; see tool calling |
ospp.supports.json_output | response_format of type json_object is accepted |
ospp.supports.json_schema | response_format of type json_schema is accepted |
ospp.supports.images | Image content in messages. false for every model today: the endpoint takes text only |
ospp.supports.streaming | "live" or "replayed"; see below |
ospp.price | The price per million input tokens and per million output tokens, in the given currency |
With the openai Python client the object is on the parsed entry: model.model_extra["ospp"].
JSON output#
response_format | Accepted |
|---|---|
{"type": "text"} | Always |
{"type": "json_object"} | Where supports.json_output is true |
{"type": "json_schema", "json_schema": {...}} | Where supports.json_schema is true. Today that is OpenAI models |
A json_schema format needs a name, as in the OpenAI API; OSPP does not check that a schema is there, the provider does. Numbers inside the schema must be whole numbers: the schema is part of the node's definition and is fingerprinted with it, and a decimal number is refused.
A format the chosen model does not support is refused with status 400 and the code unsupported_parameter; the message says what to use instead. OSPP does not send the request without the format.
Streaming#
supports.streaming says how an answer to "stream": true is delivered:
"live": where streamed calls are enabled, the answer is passed on as the model writes it."replayed": the answer waits for its passport and is then sent as a stream.
See streaming.
Comparing models#
To see how another model would have handled your real calls before you switch, use Model Compare and the Model Arena. The arena describes; you decide, and you change the model value yourself.
