Available on all Portkey plans.
questions. The model returns one typed answer per question.
Use it for classification, routing, scoring, and yes/no checks, where a structured answer is needed and not free text.
/v1/decisions does not support streaming. A stream parameter in the request is ignored.Quick Start
Setmodel to @integration-slug/model. The integration holds the provider credentials, so no provider headers are needed.
Request shape depends on the provider. Workers AI (Cloudflare), TypeSafe, and OpenRouter use the Jev shape. OpenAI and Azure OpenAI use the OpenAI shape. The examples below are the same three questions in each shape.
Supported Providers
Any provider accepts either request shape. Portkey converts the request to the provider’s native shape and converts the answers back. See Switching Shapes.
Request Shapes
The shape is detected from the body. A body that mixes fields from both shapes, or matches neither, returns400.
Question Types
Each question sets atype. The type sets the shape of the answer:
A
score is the probability-weighted average of the level indices, so it can fall between levels.
Refusals
Any question can come back as{ "type": "refusal" } while other questions in the same request still return answers. In the OpenAI shape the refusal also carries the question name. Check each answer’s type before reading its result.
Portkey also returns a refusal for a question the provider returned no answer for, when converting a Jev-shaped answer to the OpenAI shape.
Response Shapes
Every response includes
provider, the slug that served the request.
Switching Shapes
Portkey converts between shapes, so one request body works across providers. To fail over between a Jev provider and an OpenAI-native one, keep the same text-only body and switch the model per target.Fallback config
- Jev
statethat is an object or array is JSON-stringified intoinput. noulcriteria are appended to the question’sinstructions, since apredicatehas no criteria field.- OpenAI
inputis flattened to text for Jev providers. Onlyinput_textparts are kept. - Unnamed questions are keyed
q0,q1, and so on.
400 for requests they cannot serve:
input_imageparts. Jev is text-only.safety_identifier.- Duplicate question
namevalues, since names become response keys.
Errors
Upstream errors return the standard Portkey error shape. The message is prefixed with the provider slug, andprovider is included:
200 response from the provider without an answers field also returns an error, not an empty result.
Gateway Features
Decisions requests go through the same gateway as other endpoints:- Routing — Retries, fallbacks, load balancing, and circuit breaking through Configs
- Caching — Simple and semantic caching
- Guardrails — Before-request checks on the content to judge only:
statein the Jev shape, or the text ininputin the OpenAI shape. See Guardrails for Decisions - Observability — Logs, cost tracking, and analytics in Observability
API Reference
- Create a Decision —
POST /v1/decisions
TypeSafe
Provider setup and pricing
API Reference
Decisions API reference
Universal API
All API formats
Guardrails for Decisions
Scan the content to judge before it reaches the model
Portkey is now PRISMA AIRS AI Gateway. See it in action.
Contact Us

