Skip to main content
Decision models answer typed questions about an input and return probabilities instead of generated text: a yes/no probability, a pick from a fixed list, or a score on a scale. The AI Gateway serves them on two routes that share one provider list, so any model whose type is Decision works on either route. The route you call does not limit which provider you can use. OpenAI receives OpenAI-format bodies; every other provider receives System One bodies. Answers come back in the format of the route you called.
Add the model with Model Types set to Decision. A chat model cannot serve these routes. Custom Endpoint pass-through of TypeSafe (the Jev guide) is a different path — it does not use /v1/systemone on the gateway, and it has no cost tracking.

Provider capabilities

Legend:
  • ✅ Supported by provider and TrueFoundry
  • Provided by provider, but not by TrueFoundry
  • Provider does not support this feature
For every gateway endpoint and provider, see Supported APIs. The AI Gateway translates between the two formats per target:
  • Text parts of an OpenAI input are joined into the System One state. System One questions are named by their map keys when they go to OpenAI.
  • A noul’s criteria have no OpenAI field, so they are folded into the instructions OpenAI sees. Missing instructions on a System One question get a generic fallback such as “Is this true of the input?”.
  • safety_identifier is forwarded to OpenAI and dropped for other providers.
  • usage is left in the provider’s own shape so cost tracking still works.

Add a decision model

Pick the provider, add the model with Model Types = Decision, then call either route with the TrueFoundry FQN account-name/model-display-name.
1

Add the provider account

Follow the provider page for credentials and base URL:
2

Add the model with type Decision

Set Model Types to Decision. Pin a versioned Model ID where the provider offers one (jev-1.13.0 rather than jev-latest) so confidence thresholds stay stable across releases.
3

Call either route

Send your TrueFoundry API key to the AI Gateway. The gateway injects the upstream credential. Set GATEWAY_BASE_URL without a trailing slash.

/v1/systemone

The System One format. Send the content in state and named questions in questions. Answers come back keyed by those names. Set GATEWAY_BASE_URL to your gateway base URL without a trailing slash and TFY_API_KEY to your TrueFoundry API key.
Example response:
Changing "model" to an OpenAI decision FQN asks OpenAI instead and still returns System One answers keyed by question name. Every question has a type and an optional instructions field. See the TypeSafe API reference for the full System One schema.

/v1/decisions

The OpenAI Decisions format. Send the content in input and a list of questions. Answers come back as a list in the same order, echoing each name.
Changing "model" to a TypeSafe Jev FQN sends the same questions to TypeSafe and still returns OpenAI-shaped answers. Every question takes instructions and an optional name that is echoed in its answer. An unnamed question is keyed question_<index> when it is translated to System One. A question the OpenAI model will not answer comes back as {"type": "refusal", "name": ...}.

Image input

input_image parts only work on OpenAI models, on /v1/decisions. image_url must be an inline data: URL — hosted URLs and file ids are not supported.
The same body with a TypeSafe, OpenRouter, Perplexity, Databricks, Microsoft Foundry, or vLLM model is rejected before that provider is called:
Cloudflare Clef, added through a TypeSafe account pointed at Workers AI, accepts images on the System One images field instead — see TypeSafe.

Limits

These requests are rejected with a 400 before any provider is called: OpenAI requires instructions on every question. When a System One question without instructions goes to OpenAI, the AI Gateway fills in a generic one. Self-hosted vLLM answers only choice questions, and needs a vLLM build that includes vllm#59299 (after v0.31.0).

Virtual models

A virtual model whose model types include decision can load-balance or fail over across decision targets, including a mix of OpenAI and System One providers. The AI Gateway translates each attempt into that target’s dialect and translates the successful answer back into the dialect of the route you called. If every target cannot represent the request — for example every remaining target is System One and the body contains input_image — the gateway returns 400 with No model available for this request can represent this decision. Auto Routing can also use a TypeSafe Jev model as the classifier that picks simple / medium / complex for a chat virtual model. That is a routing setting, not a call you make to /v1/systemone. See Auto Routing.

Custom Endpoints vs these routes

The Jev Custom Endpoints guide forwards raw HTTP to https://api.typesafe.ai. You keep TypeSafe credentials on the gateway, but the path is /proxy-api/.../v1/systemone, cost tracking is unavailable, and you cannot switch providers by changing model. /v1/decisions and /v1/systemone use models in your catalog, so you get access control, tracing, cost tracking, virtual models, and the ability to change provider without changing the request body. Prefer the native TypeSafe integration unless you specifically need a transparent proxy.

Next steps