Skip to main content
POST
Make structured decisions
Use the OpenAI-compatible format for new calls: input contains text or user messages with inline input_image parts, and questions is an ordered array of predicate, choice, or score questions. Answers use the same order, with optional names. Boolean choice values remain booleans. Hosted HTTPS image URLs work only on Base Labs models (Elephant-1, Mammoth-1 and Joey-1) and must be on Amazon S3, Google Cloud Storage or Azure Blob Storage; Luna accepts up to 128 inline images, while other providers impose their own limits. Explicit image detail and safety_identifier require an OpenAI route. Existing state, named question maps, noul, and criteria remain supported and return the original answer map. Together Tev requires that legacy format because it returns labels without probabilities. The legacy examples below remain valid.
Use POST /v1/decisions when your application needs structured answers that code can consume directly. Supported models include TypeSafe Jev 1.13 (typesafe/jev-1.13.0), Together Tev1 4B Experimental (together/tev1-4b-experimental), and Respan Span-01 (respan/span-01:free and respan/span-01). The request contains:
  • state: a string, object, or array containing the information to evaluate.
  • questions: a map of named questions. Each question sets type to noul, choice, or score and includes instructions; supported types depend on the selected model.
  • model: the Phaseo model ID. Use typesafe/jev-1.13.0 for Jev 1.13, or typesafe/jev-latest to follow the latest Jev release.
Liquid D1 (liquid-ai/d1:free, also available as liquid-ai/d1) and Perplexity Decider 27B (perplexity/decider-27b) support all three question types. D1 is free during experimental early access. Decider costs $0.04 per million input tokens, including image tokens; output tokens are free. Add a Perplexity provider credential in Phaseo to use Decider. Its image state uses PNG, JPEG, or WebP base64 data URLs; remote image URLs are unsupported. Each choice question accepts up to 255 options, and each score question accepts up to 10 levels. Check model availability before calling either model. Mercury Decide (inception/mercury-decide) supports predicate, choice, and score questions with text or JSON evidence. Choice questions accept up to 255 options; score questions accept up to 10 levels. Images, streaming, and tool calling are unsupported. Input is currently $0.02 per million tokens under Inception’s 50% promotion; output tokens are reported but free. Inception has not published a promotion end date. Check model availability and current upstream pricing before use.
Microsoft Decision (microsoft/microsoft-decision-1) uses an Azure Foundry deployment and supports predicate, choice, and score questions with text or JSON evidence. Its input limit is 32,768 tokens. Published pricing is $0.042 per million input tokens, with free output. Media, streaming, tools, safety_identifier, and service_tier are unsupported. Check model availability before calling it. See Microsoft’s guide.
For Respan Span-01, state must be a conversation span with an input array of preceding messages and an output assistant message. Span-01 supports noul questions only. The noul answer is the probability that the behavior is present; probabilities also includes absent and not-observable probabilities.
respan/span-01:free is the free Lite model with a daily limit; Phaseo maps it to Respan’s span-01-free API model ID. respan/span-01 maps to Respan’s span-01-pro API model ID and is billed by Respan at $0.02 per million input tokens; output tokens are free. Span-01 is in early access, so Respan must enable access for your organization. Add your Respan API key as a Respan provider credential in Phaseo before calling these models. Answers use the same keys as questions. choice answers include the selected option, probabilities, and confidence; noul answers include a 0–1 probability; and score answers include a probability-weighted score, legend, probabilities, and confidence. For the Respan example, a response looks like this:
Jev supports mixing all three question types in one request; Span-01 supports noul questions only. See the Quickstart for copy-pasteable cURL, JavaScript, TypeScript SDK, and Python SDK examples. Jev 1.13 is billed at $0.042 per 1M input tokens; output tokens are free. For the upstream question semantics, see TypeSafe’s API reference.

Images, Box, and long context with Jev

On supporting TypeSafe routes, Jev 1.13 and 1.14 accept inline PNG or JPEG images through input_image or legacy images. Phaseo builds TypeSafe’s image assets and enables image support automatically. Images must meet TypeSafe’s image limits: at most 16 MiB each, dimensions from 256 to 1568 pixels, and at least 78,400 total pixels. TypeSafe validates dimensions and encoding; it does not resize rejected images. The mapped upstream JSON body is limited to 32 MiB. Image tokens use the normal input price. box is a separate question type for supporting routes such as Jev 1.14. It requires an image, takes no criteria, and returns one bounding box plus confidence. Its top, bottom, left, and right edges range from 0 to 1, measured from the top-left corner. Box always returns a rectangle; pair it with a predicate presence question when the target may be absent. With legacy images, refer to images[0]; with ordered input, refer to the first image or [Image 0]. See the Box contract. Set provider_options.typesafe.long_context to true to raise both the per-request and per-question context limits to 262k tokens. The defaults are 64k per request and 32k per question. Long context is opt-in and has the same token price. Images, Box, and long context are experimental upstream capabilities; check model availability before use.

Image decisions with Clef

cloudflare/clef and cloudflare/clef-flash support all three question types and embedded images through Cloudflare Workers AI. Clef has a 65,536-token context window; Clef Flash has 24,576 tokens. Input costs $0.24 per million tokens for Clef and $0.038 for Clef Flash.
You can also supply a data:image/png;base64,... string in images. Clef accepts up to four PNG, JPEG, or WebP images, each at most 4 MiB and 16 megapixels, with at most 8 MiB of decoded image data and a 13 MiB request body. Remote URLs are unsupported. Cloudflare validates image formats and dimensions. Models without image support reject image requests. Clef accepts at most 64 questions, with IDs of up to 100 letters, digits, underscores, dots, or hyphens. Choice questions require 2–255 options; score questions require 2–10 levels. See Cloudflare’s Clef documentation.

Audio and video decisions with Clef Omni

cloudflare/clef-omni accepts text, images, audio, and video with the same ordered questions and answers as other Decisions models. Audio and video are Phaseo extensions to the OpenAI-style input contract; OpenAI Decisions routes currently support text and images only. Check model availability before use. This example requires an available Omni route and a Phaseo API key. Replace the placeholder audio bytes and video URL with your own media before sending it.
Use input_audio.data with format: "wav" or "mp3", or input_audio.url with a public HTTPS URL or an inline audio data URL. input_video.video_url accepts a string or { "url": "..." } containing a public HTTPS URL or an inline MP4/WebM data URL. Remote servers must return the matching media Content-Type. Phaseo fetches URLs with size limits and private-address/redirect checks, then embeds the media for Cloudflare; provider credentials are never sent to the media server. Omni accepts up to four audio clips (8 MiB and 300 seconds each) and two videos (16 MiB and 60 seconds each). Audio and video together cannot exceed 16 MiB decoded. Omni retains the per-image and combined-image limits above; its request-body limit replaces the 13 MiB Clef/Flash limit. Phaseo caps the complete Omni request body at 37 MiB. Cloudflare validates media encoding, image dimensions, and clip duration, and samples video at two frames per second. A video’s soundtrack is used when every video in the request has one. Omni has a documented 64,000-token context and costs $0.15 per million aggregate input tokens. Media tokens count toward context and billing; output is free. Phaseo settles against Cloudflare’s reported input usage without adding separate audio or video charges. See Cloudflare’s Omni contract.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json

OpenAI-compatible input and ordered questions are the preferred format. Legacy state and named question maps remain supported. The response format follows the request format; do not mix the two.

model
string
required

Canonical Phaseo model id or provider model alias.

Minimum string length: 1
input
required

Text evidence or user messages containing text and inline images. Audio and video are Phaseo extensions for supporting models; OpenAI Decisions routes do not support these extensions.

Maximum string length: 10485760
questions
object[]
required
Minimum array length: 1
models
string[]

Optional ordered fallback models tried after model. model is required and is always the primary model. When an attempt fails with 429, 500, 502, 503, or 504, the next entry is tried; other errors are returned unchanged. Accepts up to 25 model IDs or presets; duplicates and entries equal to model are ignored. Each attempt is validated, logged, and billed as its own request, and the response model field and routing trace show the model that served the request. Streaming requests fall back only before the first byte, and video and music jobs fall back only at submission. Batch, realtime, and council requests reject models. Fallbacks set on a dynamic route take precedence, and phaseo/auto cannot be combined with models.

Required array length: 1 - 25 elements
Minimum string length: 1
Example:
provider_options
object
safety_identifier
string | null

Opaque end-user identifier. Supported on OpenAI routes only.

Maximum string length: 128
meta
boolean
default:false
echo_upstream_request
boolean
debug
object

Gateway debug controls. These flags are never forwarded upstream.

provider
object

Provider routing preferences for gateway selection.

routing
object

Provider routing preferences for gateway selection.

metadata
object

Response

200 - application/json

Structured decisions response

Ordered answers for input/array requests, or a named map for legacy state/map requests.

model
string
required
answers
object[]
required

One answer per question in request order, including unnamed or repeated-name questions.

usage
object
required
request_id
string | null
meta
object
Last modified on October 30, 2026