A model reached through the other format is translated both ways, so you can keep one client and switch models by name.
Both endpoints use your project-scoped Opper API key. Provider credentials are managed by Opper. Your organization needs a card on file, and your project’s model access rules and provider access requirements apply.
Question types
You can include several questions in one request.
Set a project API key from the platform for the examples below:
OpenAI Decisions
Send OpenAI’s Decisions format toPOST https://api.opper.ai/v3/compat/decisions:
model: a decision model’s name, such asgpt-6-luna-decisionsorclef, or a full catalog ID, such astypesafe/jev-1.13.0. See Choose a model.input: a string, or user messages whosecontentis a string or a list ofinput_textandinput_imageparts. Images must be inline base64data:URLs. An image part takes an optionaldetailoflow,high,auto, ororiginal.questions: a list ofpredicate,choice, andscorequestions. Each requirestypeandinstructionsand takes an optionalname, unique within the request.choicetakes 2–255choiceswhosevalueis a string or a boolean;scoretakes 2–10 orderedlevels, each with alabel.safety_identifier(optional): accepted for compatibility with OpenAI’s SDK, then dropped. Opper neither forwards nor stores it; requests to OpenAI carry Opper’s own identifier for your project.
name.
Classify a support request
Ask about an image
gpt-6-luna-decisions reads images. This request sends an 8×8 red PNG:
answers:
400 for image input.
Use the OpenAI SDK
The OpenAI Python SDK calls this endpoint from version 3.26.0. Point it at Opper:Declined questions
The model can decline a question. That answer is{"type": "refusal", "name": "..."} with no probability, and the other answers are unaffected. The request is billed as usual.
Other decision models
Name any other decision model the same way, such asclef, jev-1.14.0 or typesafe/jev-1.13.0. Opper translates the request to System One and the answer back, so the response has the same shape. For these models:
- Text parts join into one input, and image input returns
400. - Boolean choice values reach the model as the text
trueandfalse, so a question cannot hold both the string"true"and the booleantrue. usagereportsinput_tokens,output_tokens, andtotal_tokens.
"model": "typesafe/jev-1.13.0", answers:
TypeSafe System One
Send requests toPOST https://api.opper.ai/v3/compat/v1/systemone.
Existing TypeSafe HTTP clients can change their base URL to https://api.opper.ai/v3/compat and authenticate with Authorization: Bearer $OPPER_API_KEY. Send the native state and questions format to /v1/systemone.
Every request contains:
model: a decision model’s name, such asjev-1.14.0orclef, or a full catalog ID, such astypesafe/jev-1.13.0.state: the context to evaluate, as a string, object, or array.questions: a nonempty object of named questions. Each question requirestypeandinstructions.
choice requires a criteria object with 1–255 categories. score requires an ordered criteria array with 2–10 levels. noul does not require criteria; you can optionally describe the true and false outcomes in a criteria object.
Answers use the same keys as your questions.
Detect a refund request
Route a support request
answers.team:
Score urgency
answers.urgency:
Use the TypeSafe SDK
The TypeSafe SDK works with Opper unchanged: set its base URL tohttps://api.opper.ai/v3/compat and use your Opper API key. In Python (typesafe-sdk):
@typesafe-ai/sdk) works the same way; see Drop-in SDKs.
OpenAI’s model on System One
gpt-6-luna-decisions answers System One requests too, text only. Opper sends structured state and instructions as compact JSON text and adds a noul question’s true and false criteria to its instructions. A choice needs at least two categories. If the model declines a question, the request returns 422 naming it, and the call is billed because OpenAI bills it.
Answers and token counts can vary between calls.
Choose a model
Discover decision models with:- A model name, such as
clef,jev-1.14.0, orgpt-6-luna-decisions, is the model’s pool: the endpoints that serve it. Requests in one trace, or from one API key over a short window, stay on the endpoint that answered them last. Otherwise Opper takes the endpoints in turn, or in the order a routing rule sets. Your model access rules and provider access requirements decide which endpoints are eligible. - A full catalog ID, such as
typesafe/jev-1.13.0orsference/clef, calls that endpoint only. The aliasestypesafe/jev-latestandtypesafe/jev-previeware full IDs too.
429), an upstream failure (502, 503, 504), or a timeout also gets one retry on the same endpoint, after its Retry-After. A full catalog ID gets that retry but never moves to another endpoint. The whole request has 60 seconds, 120 for a model Opper hosts, and a retry that would wait past that is not made. Only the answer is billed.
A retired endpoint is served by the endpoint the catalog names as its successor. The response’s model identifies the upstream model that answered.
Aliases follow Opper’s approved catalog mapping. They do not automatically follow a new upstream TypeSafe release.
Jev 1.13 has a 64k total context limit, with a separate 32k limit for the state plus the longest question. TypeSafe enforces these limits using its own tokenizer.
Decision models, the catalog IDs
GET /v3/models?type=evaluation lists (such as typesafe/jev-1.13.0 and openai/gpt-6-luna-decisions), answer only on these two endpoints. Chat Completions and the other generation protocols do not accept them. gpt-6-luna is OpenAI’s chat model: it works as usual on those protocols, and the two decision endpoints refuse it with 400. Send gpt-6-luna-decisions instead. Both decision endpoints are synchronous; streaming, tools, and fields outside each format are unsupported.Usage, cost, and traces
gpt-6-luna-decisions on Decisions returns OpenAI’s response body unchanged, including its usage details. Translated Decisions responses carry usage.input_tokens, usage.output_tokens, and usage.total_tokens; System One responses carry usage.input_tokens and usage.output_tokens. Opper does not add a response envelope.
Billing uses the catalog input and output token prices of the endpoint that answered, including any long-context surcharge the catalog lists. See the model catalog for current pricing.
Add -i to a curl call to see these response headers:
Usage and billing are recorded for successful calls and for questions the model declined. Full input/output traces depend on your Opper retention rule; in traces, each inline image appears as a placeholder with its size. Provider data policies are configured separately through model access; EU gateway hosting does not make every provider EU-hosted.
Errors
See the API reference for Decisions and System One, OpenAI’s Decisions guide, or TypeSafe’s API documentation for the native protocols.