Decision models API
One account, one jv_live_ key and one prepaid balance call every decision model. Use the Unified Decision API to switch models with a single field, or each model's Native API for its own request/response. Jev's original /api/v1/decide is unchanged.
Authentication
Every paid endpoint takes the same bearer key. Get one on the pricing page.
Authorization: Bearer jv_live_your_key_here
Content-Type: application/jsonUnified Decision API — recommended
POST /api/v1/decisions. Send a model plus the shared state + questions shape; the response schema is the same for every model, with each provider's untouched reply included as provider_data. Switch models by changing one field: "jev" · "clef" · "clef-flash" · "openai-decisions".
curl -X POST https://jevtypesafeai.com/api/v1/decisions \
-H "Authorization: Bearer jv_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "clef",
"state": "Order R-208 was charged twice. Refund the extra payment.",
"questions": {
"route": { "type": "choice", "instructions": "Which team handles this?",
"criteria": { "billing": "refunds", "account": "login", "other": "" } },
"urgent": { "type": "noul", "instructions": "Is this urgent?" }
}
}'Response — unified across models:
{
"model": "clef",
"provider": "Cloudflare",
"answers": {
"route": { "type": "choice", "choice": "billing", "confidence": 0.96,
"probabilities": { "billing": 0.96, "account": 0.02, "other": 0.02 } },
"urgent": { "type": "noul", "noul": 0.63 }
},
"provider_data": { /* the provider's untouched raw response */ },
"usage": { "input_tokens": 158, "cost_usd": 0.000095, "credits_remaining_usd": 4.99 }
}Billing is also returned in headers: X-Decision-Model, X-Decision-Provider, X-Decision-Input-Tokens, X-Decision-Cost-USD, X-Decision-Credits-Remaining.
Native APIs
Prefer a provider's own request and response, byte-for-byte? Call its native endpoint. Same key and balance; billing rides in the X-Decision-* response headers. Full request shape and a copy-paste example are on each model's page.
| Model | Provider | Native endpoint | Price (in) | |
|---|---|---|---|---|
| Jev | TypeSafe AI | /api/v1/decide | $0.42/M | docs → |
| Clef | Cloudflare | /api/v1/clef | $0.60/M | docs → |
| Clef-flash | Cloudflare | /api/v1/clef-flash | $0.25/M | docs → |
| OpenAI Decisions | OpenAI | /api/v1/openai-decisions | $0.30/M | docs → |
Question types
choice— pick one option; returns the choice, a probability per option, and confidence.score— an ordered scale; returns a weighted score.noul— a calibrated yes/no probability (OpenAI calls thispredicate; the Unified API normalizes it tonoul).
Pricing & errors
You're billed per 1M input tokens at each model's rate (see models); output tokens are free. Errors: 401 bad/missing key, 402 insufficient credits, 403 inactive account, 503 model unavailable or not yet priced.