Skip to main content
POST /v1/decisions serves OpenAI’s Decisions API: a request carries an input (text, or user messages of text and images) and a list of typed questions, and each answer is a probability, a choice, or a score instead of free text. The endpoint is available once an openai or jev provider is configured. Without one, it answers 404. Either way the answer is OpenAI’s shape, so the OpenAI SDKs work unchanged.

Request and answer

With the OpenAI SDK, point base_url at the gateway:

Jev and Kev

A jev model answers the same request through System One, which asks the same three kinds of question: a predicate is a noul, and choice and score keep their names. GoModel translates the request and the answer, so you can switch between OpenAI and Jev, or fail over from one to the other, without changing client code. Some parts of a request translate with limits:
  • Images work on hosted Jev, sent as base64 PNG or JPEG data URLs (data:image/png;base64,...). Each one becomes a System One image asset, placed in the state where it stood in the input, and GoModel adds the TypeSafe-Danger-Zone-Images: true header TypeSafe requires. GoModel does not fetch image links for Jev, so an https image URL returns 400; detail is ignored. TypeSafe marks image support as experimental and limits each image to 280–1568 pixels per side. A Kev server reads text only, so an image request to a Kev model returns 400: GoModel treats a jev provider as a Kev server unless its base URL is TypeSafe’s hosted API (https://api.typesafe.ai).
  • Choice values are strings or booleans; a boolean is sent as "true" or "false" and comes back as the boolean. A string "true" and a boolean true in one question collide and are rejected.
  • prompt_cache_key, prompt_cache_options, and safety_identifier are dropped.
  • A question System One leaves unanswered comes back as a refusal, which the Decisions API allows for any question.
  • Upstream errors keep TypeSafe’s status and message; a malformed question names its System One key.

What the gateway does

Like System One, the endpoint resolves model (including virtual models and pinned Jev versions), applies the caller’s allowlist, rate limits, and budgets, runs prompt guardrails over the input, serves identical requests from the exact response cache, fails over to the next target on availability errors, and records audit and usage under the model that answered. Filter the audit log by the Decisions request type. Usage on /v1/decisions is costed for input tokens only, every one at the model’s input rate, as OpenAI bills the Decisions API: output, cache-read, and cache-write tokens are free there, even for a model such as gpt-6-luna whose catalog pricing has chat rates. Long-context tiers still set the input rate. Guardrails see each input message as a user message, with its text and image parts; edits reach the provider, and untouched parts keep their exact JSON. Edits a decision request has no place for, such as an injected system prompt, are dropped with a warning. A failover chain may mix providers: every target receives the request in its own form, and a target on a provider without a Decisions API, or one that cannot read the request’s images (a Kev server, or a jev model given an image link), is skipped without using an attempt. When the chain’s first target cannot read the images, the request starts at the first target that can, so the chain below sends text to Kev and images to OpenAI.

Errors

Last modified on October 21, 2026