Specifications
Architecturedecision
Modalitiesdecision
Price…
Model ID~typesafe/jev-latest
Quick start
Get an API key →TypeScript
// npm install hanzoai
import { AiApi, Configuration } from 'hanzoai'
const ai = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }))
const { data: decision } = await ai.postDecisions({
aiDecisionsRequest: {
model: '~typesafe/jev-latest',
state: { incident: 'checkout 5xx at 14%' },
questions: {
severity: {
type: 'choice',
instructions: 'How severe is this incident?',
criteria: {
low: 'cosmetic or internal; no customer is affected',
high: 'some customers are blocked from finishing a task',
critical: 'every customer is blocked and no revenue comes in',
},
},
},
},
})
const { choice, probabilities } = decision.answers.severity
console.log(choice, probabilities)Python
# pip install hanzoai
import os
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi
from hanzoai.cloud.models.ai_decisions_request import AiDecisionsRequest
ai = AiApi(ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"])))
decision = ai.post_decisions(AiDecisionsRequest.from_dict({
"model": "~typesafe/jev-latest",
"state": {"incident": "checkout 5xx at 14%"},
"questions": {
"severity": {
"type": "choice",
"instructions": "How severe is this incident?",
"criteria": {
"low": "cosmetic or internal; no customer is affected",
"high": "some customers are blocked from finishing a task",
"critical": "every customer is blocked and no revenue comes in",
},
},
},
}))
severity = decision.answers["severity"]
print(severity.choice, severity.probabilities)cURL
curl -sS --fail-with-body https://api.hanzo.ai/v1/decisions \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "~typesafe/jev-latest",
"state": { "incident": "checkout 5xx at 14%" },
"questions": {
"severity": {
"type": "choice",
"instructions": "How severe is this incident?",
"criteria": {
"low": "cosmetic or internal; no customer is affected",
"high": "some customers are blocked from finishing a task",
"critical": "every customer is blocked and no revenue comes in"
}
}
}
}'Go
// net/http: the Go SDK refuses a choice question with named criteria.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
body, err := json.Marshal(map[string]any{
"model": "~typesafe/jev-latest",
"state": map[string]string{"incident": "checkout 5xx at 14%"},
"questions": map[string]any{
"severity": map[string]any{
"type": "choice",
"instructions": "How severe is this incident?",
"criteria": map[string]string{
"low": "cosmetic or internal; no customer is affected",
"high": "some customers are blocked from finishing a task",
"critical": "every customer is blocked and no revenue comes in",
},
},
},
})
if err != nil {
return err
}
req, err := http.NewRequest("POST", "https://api.hanzo.ai/v1/decisions", bytes.NewReader(body))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("HTTP %d: %s", resp.StatusCode, out)
}
var decision struct {
Answers map[string]struct {
Choice string `json:"choice"`
Probabilities map[string]float64 `json:"probabilities"`
} `json:"answers"`
}
if err := json.Unmarshal(out, &decision); err != nil {
return err
}
severity := decision.Answers["severity"]
fmt.Println(severity.Choice, severity.Probabilities)
return nil
}More from typesafe
Jev 1.13
TypeSafe's decision model, reached through OpenRouter, at its list price: $0.042 per million input tokens. Output is free.
Jev Router
Jev Router picks the best model and reasoning effort for each request, balancing quality, speed, and cost. It runs on [Jev](https://openrouter.ai/~typesafe/jev-latest), TypeSafe's first System One model, and adapts as your...