Tomar uma decisão
Avalie perguntas tipadas sobre o estado da aplicação com os modelos de decisão suportados.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
questions: [{type: 'predicate', instructions: '<string>', name: '<string>'}],
models: ['anthropic/claude-sonnet-5-5', 'google/gemini-2.5-flash'],
provider_options: {typesafe: {long_context: true}},
safety_identifier: '<string>',
meta: false,
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
routing: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
metadata: {}
})
};
fetch('https://api.phaseo.app/v1/decisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/decisions"
payload = {
"model": "<string>",
"input": "<string>",
"questions": [
{
"type": "predicate",
"instructions": "<string>",
"name": "<string>"
}
],
"models": ["anthropic/claude-sonnet-5-5", "google/gemini-2.5-flash"],
"provider_options": { "typesafe": { "long_context": True } },
"safety_identifier": "<string>",
"meta": False,
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
},
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"questions": [
{
"type": "predicate",
"instructions": "<string>",
"name": "<string>"
}
],
"models": [
"anthropic/claude-sonnet-5-5",
"google/gemini-2.5-flash"
],
"provider_options": {
"typesafe": {
"long_context": true
}
},
"safety_identifier": "<string>",
"meta": false,
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phaseo.app/v1/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/decisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'questions' => [
[
'type' => 'predicate',
'instructions' => '<string>',
'name' => '<string>'
]
],
'models' => [
'anthropic/claude-sonnet-5-5',
'google/gemini-2.5-flash'
],
'provider_options' => [
'typesafe' => [
'long_context' => true
]
],
'safety_identifier' => '<string>',
'meta' => false,
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'routing' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": [
{
"type": "predicate",
"name": "<string>",
"probability": 0.5
}
],
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1,
"input_tokens_details": {
"cached_tokens": 1,
"cache_write_tokens": 1
},
"output_tokens_details": {
"reasoning_tokens": 1
}
},
"request_id": "<string>",
"meta": {}
}input e uma matriz ordenada de questions para POST /v1/decisions e receba uma resposta tipada por pergunta, com probabilidades, na mesma ordem.
Tomar uma decisão
Esta solicitação faz uma pergunta de cada tipo. Ela precisa de uma chave de API do Phaseo e de uma rotaopenai/gpt-6-luna disponível.
curl https://api.phaseo.app/v1/decisions \
-H "Authorization: Bearer $PHASEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-luna",
"input": "I was charged twice for my order and I cannot log in to download the invoice.",
"questions": [
{
"type": "choice",
"name": "department",
"instructions": "Which team should handle this request?",
"choices": [
{ "value": "billing", "description": "Payments, invoices and refunds" },
{ "value": "support", "description": "Product usage and troubleshooting" }
]
},
{
"type": "predicate",
"name": "is_blocked",
"instructions": "Is the customer blocked from using the product?"
},
{
"type": "score",
"name": "urgency",
"instructions": "How urgent is this request?",
"levels": [{ "label": "low" }, { "label": "medium" }, { "label": "high" }]
}
]
}'
import Phaseo from "@phaseo/sdk";
const client = new Phaseo(); // lê PHASEO_API_KEY
const decision = await client.decisions.create({
model: "openai/gpt-6-luna",
input: "I was charged twice for my order and I cannot log in to download the invoice.",
questions: [
{
type: "choice",
name: "department",
instructions: "Which team should handle this request?",
choices: [
{ value: "billing", description: "Payments, invoices and refunds" },
{ value: "support", description: "Product usage and troubleshooting" },
],
},
{ type: "predicate", name: "is_blocked", instructions: "Is the customer blocked from using the product?" },
{
type: "score",
name: "urgency",
instructions: "How urgent is this request?",
levels: [{ label: "low" }, { label: "medium" }, { label: "high" }],
},
],
});
console.log(decision.answers);
from phaseo import Phaseo
client = Phaseo() # lê PHASEO_API_KEY
decision = client.decisions.create(
{
"model": "openai/gpt-6-luna",
"input": "I was charged twice for my order and I cannot log in to download the invoice.",
"questions": [
{
"type": "choice",
"name": "department",
"instructions": "Which team should handle this request?",
"choices": [
{"value": "billing", "description": "Payments, invoices and refunds"},
{"value": "support", "description": "Product usage and troubleshooting"},
],
},
{"type": "predicate", "name": "is_blocked", "instructions": "Is the customer blocked from using the product?"},
{
"type": "score",
"name": "urgency",
"instructions": "How urgent is this request?",
"levels": [{"label": "low"}, {"label": "medium"}, {"label": "high"}],
},
],
}
)
print(decision["answers"])
{
"model": "openai/gpt-6-luna",
"answers": [
{
"type": "choice",
"name": "department",
"choice": "billing",
"confidence": 0.89,
"probabilities": [
{ "value": "billing", "probability": 0.91 },
{ "value": "support", "probability": 0.09 }
]
},
{ "type": "predicate", "name": "is_blocked", "probability": 0.84 },
{
"type": "score",
"name": "urgency",
"score": 1.6,
"confidence": 0.7,
"probabilities": [
{ "value": 0, "label": "low", "probability": 0.05 },
{ "value": 1, "label": "medium", "probability": 0.3 },
{ "value": 2, "label": "high", "probability": 0.65 }
]
}
],
"usage": { "input_tokens": 64, "output_tokens": 0, "total_tokens": 64 }
}
Escrever perguntas
input é uma string ou uma matriz de mensagens user cujo content é uma string ou uma lista de partes input_text, input_image, input_audio e input_video. name é opcional; as respostas mantêm a ordem da solicitação, inclusive para perguntas sem nome e nomes repetidos.
Uma solicitação carrega no máximo 128 perguntas, exceto em google/gemini-decision-1, que aceita até 1000, em parallel/decisions-fast, que aceita até 100, e em Clef, que aceita até 64. Uma solicitação acima do limite do modelo retorna 400.
type | Campos extras | Campos da resposta |
|---|---|---|
predicate | nenhum | probability (0–1) de a resposta ser sim |
choice | choices: value (string ou booleano, distintos) e description opcional | choice, confidence, probabilities por valor |
score | levels: label e description opcional | score (índice de nível ponderado pela probabilidade), confidence, probabilities por nível |
box | nenhum; precisa de uma imagem em input | box (top, bottom, left, right), confidence |
locate | nenhum; precisa de um input em string sem mídia | spans: start, end, text, score |
type: "refusal" para ela. Os tipos que cada modelo suporta estão listados em Escolher um modelo.
As imagens vão em partes input_image como URLs de dados. URLs de imagem HTTPS hospedadas funcionam apenas nos modelos da Base Labs (baselabs/elephant-1, baselabs/mammoth-1 e baselabs/joey-1) e precisam estar no Amazon S3, no Google Cloud Storage ou no Azure Blob Storage. Uma solicitação leva no máximo 128 imagens, que o Luna aceita; outros provedores definem limites menores. Um detail de imagem explícito e safety_identifier exigem uma rota da OpenAI.
Usar o formato de estado antigo
Solicitações comstate e um mapa de perguntas nomeadas continuam funcionando e retornam respostas indexadas pelos mesmos nomes. O Together Tev (together/tev1-4b-experimental) exige esse formato, porque retorna um rótulo sem probabilidades, e responde apenas perguntas choice. O Respan Span-01 também usa esse formato. Não misture os formatos: input com state ou images retorna 400.
state: uma string, um objeto ou uma matriz com as informações a avaliar.questions: até 128 perguntas nomeadas, ou mais em modelos com limite maior. Cada uma definetypecomonoul(sim/não),choiceouscore, além deinstructions. Perguntas de escolha recebemcriteriacomo um mapa de opção para descrição; perguntas de pontuação recebemcriteriacomo uma matriz de pelo menos duas descrições de nível.- Perguntas
locateusam apenasinstructionse precisam de umstateem string semimages; veja Perplexity Decider. images: até quatro imagens PNG, JPEG ou WebP, como URLsdata:ou objetos{ "content_type", "base64" }.model: o padrão étypesafe/jev-1.13.0quando omitido.
questions. Respostas choice incluem a opção selecionada, as probabilidades e a confiança; respostas noul incluem uma probabilidade de 0 a 1; respostas score incluem uma pontuação ponderada pela probabilidade, uma legenda, as probabilidades e a confiança.
Escolher um modelo
Verifique a disponibilidade do modelo antes de chamar qualquer um destes modelos.| Modelo | Tipos de pergunta | Entrada | Preço de entrada por 1M de tokens |
|---|---|---|---|
openai/gpt-6-luna | predicate, choice, score | texto, até 128 imagens | Consulte a página do modelo |
typesafe/jev-1.13.0, typesafe/jev-1.14.0 | os três, misturados em uma solicitação; box no 1.14 | texto, imagens PNG/JPEG | $0.042 (Jev 1.13) |
cloudflare/clef, cloudflare/clef-flash | os três | texto, até 4 imagens | $0.24 / $0.038 |
cloudflare/clef-omni | os três | texto, imagens, áudio, vídeo | $0.15 |
google/gemini-decision-1 | predicate, choice, score; até 1000 por solicitação | texto, imagens, áudio, vídeo | $0.10 |
liquid-ai/d1:free | os três | Consulte a página do modelo | Gratuito durante o acesso antecipado |
liquid-ai/d1, liquid-ai/d1.1, liquid-ai/d1-ultra | os três | texto, imagens | $0.02 / $0.02 / $0.042 |
liquid-ai/d1.2, liquid-ai/d1.2-ultra | os três, mais text, number, date, spans, boxes e múltipla escolha no formato antigo | texto, imagens, áudio | $0.02 / $0.042 |
perplexity/pplx-decider-v1.3, perplexity/pplx-decider-flash-v1.3 | os três, mais locate | texto, imagens em base64 | $0.02 / $0.01 |
inception/mercury-decide | predicate, choice, score | texto ou JSON | $0.02 (promoção) |
microsoft/microsoft-decision-1 | predicate, choice, score | texto ou JSON | $0.042 |
respan/span-01:free, respan/span-01 | apenas noul (formato antigo) | trecho de conversa | Gratuito (Lite) / $0.02 |
together/tev1-4b-experimental | apenas choice (formato antigo) | texto | Consulte a página do modelo |
TypeSafe Jev
Usetypesafe/jev-1.13.0 para o Jev 1.13, ou typesafe/jev-latest para acompanhar a versão mais recente do Jev. Para a semântica das perguntas no upstream, consulte a referência da API da TypeSafe.
Nas rotas da TypeSafe que oferecem suporte, o Jev 1.13 e o 1.14 aceitam imagens PNG ou JPEG embutidas por input_image ou pelo campo antigo images. O Phaseo monta os recursos de imagem da TypeSafe e ativa o suporte a imagens automaticamente. As imagens precisam respeitar os limites de imagem da TypeSafe: no máximo 16 MiB cada, de 256 a 1568 pixels em cada lado e pelo menos 78.400 pixels no total. A TypeSafe valida as dimensões e a codificação e não redimensiona imagens rejeitadas. O corpo JSON mapeado para o upstream é limitado a 32 MiB. Os tokens de imagem usam o preço de entrada normal.
box (em rotas que oferecem suporte, como o Jev 1.14) exige uma imagem, não aceita critérios e retorna uma caixa delimitadora mais a confiança. Suas bordas vão de 0 a 1, medidas a partir do canto superior esquerdo. Box sempre retorna um retângulo, então combine-o com uma pergunta predicate de presença quando o alvo puder estar ausente. Com o campo antigo images, refira-se a images[0]; com entrada ordenada, refira-se à primeira imagem ou a [Image 0]. Consulte o contrato do Box.
Defina provider_options.typesafe.long_context como true para aumentar os limites de contexto por solicitação e por pergunta para 262 mil tokens, em vez dos padrões de 64 mil por solicitação e 32 mil por pergunta. O contexto longo custa o mesmo por token. Imagens, Box e contexto longo são recursos experimentais no upstream.
{
"model": "typesafe/jev-1.14.0",
"input": [{
"role": "user",
"content": [{ "type": "input_image", "image_url": "data:image/png;base64,<base64 image bytes>" }]
}],
"questions": [
{ "type": "predicate", "name": "visible", "instructions": "Is there a mug in the first image?" },
{ "type": "box", "name": "mug", "instructions": "The mug in the first image" }
],
"provider_options": { "typesafe": { "long_context": true } }
}
Cloudflare Clef e Clef Flash
cloudflare/clef e cloudflare/clef-flash rodam no Cloudflare Workers AI. O Clef tem uma janela de contexto de 65.536 tokens e o Clef Flash, de 24.576 tokens.
{
"model": "cloudflare/clef-flash",
"state": "Inspect the attached product photo.",
"images": [{ "content_type": "image/png", "base64": "<base64 image bytes>" }],
"questions": {
"damaged": { "type": "noul", "instructions": "Is the product visibly damaged?" }
}
}
images também aceita uma string data:image/png;base64,.... O Clef aceita até quatro imagens PNG, JPEG ou WebP, cada uma com no máximo 4 MiB e 16 megapixels, com no máximo 8 MiB de dados de imagem decodificados e um corpo de solicitação de 13 MiB. URLs remotas não são suportadas, e a Cloudflare valida os formatos e as dimensões das imagens. Modelos sem suporte a imagens rejeitam solicitações com imagens.
O Clef aceita no máximo 64 perguntas, com IDs de até 100 letras, dígitos, sublinhados, pontos ou hifens. Perguntas de escolha precisam de 2 a 255 opções e perguntas de pontuação, de 2 a 10 níveis. Consulte a documentação do Clef da Cloudflare.
Cloudflare Clef Omni
cloudflare/clef-omni aceita texto, imagens, áudio e vídeo. As partes de áudio e vídeo são extensões do Phaseo ao formato de entrada; as rotas da OpenAI aceitam apenas texto e imagens. Substitua os bytes de áudio e a URL de vídeo de exemplo pelas suas próprias mídias antes de enviar este exemplo.
{
"model": "cloudflare/clef-omni",
"input": [{
"role": "user",
"content": [
{ "type": "input_text", "text": "Review the recording and clip." },
{ "type": "input_audio", "input_audio": { "data": "<base64 WAV bytes>", "format": "wav" } },
{ "type": "input_video", "video_url": { "url": "https://media.example.com/clip.mp4" } }
]
}],
"questions": [{ "type": "predicate", "name": "safe", "instructions": "Is the equipment operating safely?" }]
}
input_audio.data com format: "wav" ou "mp3", ou como input_audio.url com uma URL HTTPS pública ou uma URL de dados de áudio embutida. input_video.video_url aceita uma string ou { "url": "..." } com uma URL HTTPS pública ou uma URL de dados MP4/WebM embutida. Os servidores remotos precisam retornar o Content-Type correspondente. O Phaseo busca as URLs com limites de tamanho e verificações de endereços privados e de redirecionamentos, e depois incorpora a mídia para a Cloudflare; as credenciais do provedor nunca são enviadas ao servidor de mídia.
| Limite | Valor |
|---|---|
| Clipes de áudio | 4, cada um com no máximo 8 MiB e 300 segundos |
| Vídeos | 2, cada um com no máximo 16 MiB e 60 segundos |
| Áudio e vídeo combinados | 16 MiB decodificados |
| Imagens | Os mesmos limites por imagem e combinados do Clef |
| Corpo da solicitação | 37 MiB (substitui os 13 MiB do Clef) |
| Contexto | 64.000 tokens |
Liquid D1.2 e D1.2 Ultra
liquid-ai/d1.2 e liquid-ai/d1.2-ultra usam o formato de estado antigo, com até quatro imagens e até oito clipes de áudio. O campo audio recebe URLs data: em base64 (WAV, MP3, FLAC, M4A ou OGG, cada URL com até 24 MiB, cerca de 18 MiB de áudio); URLs de áudio remotas não são aceitas. Além de noul, choice e score, eles respondem a estes tipos de pergunta:
type | Campos extras | Campos da resposta |
|---|---|---|
text | nenhum | text, mais span (posições de início e fim em state) e found (0–1); text é null quando found fica abaixo de 0,5 |
number | unit opcional; range opcional ([low, high]) e step, que exige range e precisa dividi-lo exatamente | number e unit; sem range, também text, span e found; com range, number é a mediana e interval é [p10, p90] |
date | nenhum | date (YYYY-MM-DD), text, span, found |
spans | nenhum | spans (cada um com text, span e found), count, at_least |
boxes | max opcional (1–16); exige exatamente uma imagem | boxes, count, at_least |
multiple: true em uma pergunta choice, a resposta traz todas as opções aplicáveis em choices, com probabilities por opção. Os demais modelos retornam 400 para esses tipos de pergunta e respondem perguntas multiple com uma única opção; modelos sem entrada de áudio ignoram audio. liquid-ai/d1, liquid-ai/d1.1 e liquid-ai/d1-ultra aceitam texto e imagens e respondem noul, choice e score.
{
"model": "liquid-ai/d1.2",
"state": "Order #4417 placed 2026-11-02 for 3 items, total $84.50. The parcel arrived broken and late.",
"questions": {
"total": { "type": "number", "instructions": "Order total in dollars", "unit": "USD" },
"placed": { "type": "date", "instructions": "When was the order placed?" },
"topics": {
"type": "choice",
"multiple": true,
"instructions": "Which problems apply?",
"criteria": { "damage": "Item damaged", "delay": "Late delivery", "billing": "Payment problem" }
}
}
}
Liquid D1 e Perplexity Decider
O Liquid D1 (liquid-ai/d1:free) é gratuito durante o acesso antecipado experimental. O Perplexity Decider V1.3 (perplexity/pplx-decider-v1.3, ou perplexity/pplx-decider-latest) e o Decider Flash V1.3 (perplexity/pplx-decider-flash-v1.3, ou perplexity/pplx-decider-flash-latest) precisam de uma credencial de provedor da Perplexity no Phaseo. O estado de imagem deles usa URLs de dados base64 PNG, JPEG ou WebP; URLs de imagem remotas não são suportadas. Eles também respondem a perguntas locate, que retornam as partes de um input ou state em string que correspondem às instructions, como "email address". Cada trecho tem text copiado literalmente, posições start e end contadas em pontos de código Unicode (end é exclusiva) e um score em que um valor maior indica mais certeza; spans fica vazio quando nada corresponde. Locate não usa criteria nem aceita imagens, áudio ou vídeo, e só funciona nos modelos que o indicam; os outros retornam 400. A Perplexity o treinou com entradas de até 8K tokens. Nos dois, uma pergunta de escolha aceita até 255 opções e uma pergunta de pontuação, até 10 níveis.
Inception Mercury Decide
inception/mercury-decide recebe evidências em texto ou JSON. Perguntas de escolha aceitam até 255 opções e perguntas de pontuação, até 10 níveis. Imagens, streaming e chamadas de ferramentas não são suportados. O preço de entrada de $0.02 é a promoção de 50% da Inception, que não tem data de término publicada; consulte os preços atuais no upstream antes de usar.
{
"model": "inception/mercury-decide",
"input": "Please refund the duplicate charge on my account.",
"questions": [{
"type": "predicate",
"name": "billing",
"instructions": "Is this request about billing?"
}]
}
Microsoft Decision
microsoft/microsoft-decision-1 roda em uma implantação do Azure Foundry e recebe evidências em texto ou JSON de até 32.768 tokens. Mídia, streaming, ferramentas, safety_identifier e service_tier não são suportados. Consulte o guia da Microsoft.
{
"model": "microsoft/microsoft-decision-1",
"input": "The API returns 500 on every call.",
"questions": [{
"type": "choice",
"name": "team",
"instructions": "Which team should handle this ticket?",
"choices": [
{ "value": "engineering", "description": "Bugs, errors, and outages" },
{ "value": "support", "description": "How-to and account questions" }
]
}]
}
Respan Span-01
O Span-01 usa o formato antigo.state precisa ser um trecho de conversa: uma matriz input com as mensagens anteriores e uma mensagem do assistente em output. Ele responde apenas perguntas noul: o valor noul é a probabilidade de o comportamento estar presente, e probabilities também traz as probabilidades de ausência e de não observável.
{
"model": "respan/span-01:free",
"state": {
"input": [{ "role": "user", "content": "Please connect me to a person." }],
"output": { "role": "assistant", "content": "I will connect you to support." }
},
"questions": {
"escalation": {
"type": "noul",
"instructions": "Does the assistant offer a human handoff?"
}
}
}
{
"answers": {
"escalation": {
"type": "noul",
"noul": 0.73,
"probabilities": {
"true": 0.73,
"false": 0.25,
"not_observable": 0.02
}
}
}
}
respan/span-01:free é o modelo Lite gratuito, com limite diário, e corresponde ao modelo span-01-free da Respan. respan/span-01 corresponde a span-01-pro e é cobrado pela Respan. O Span-01 está em acesso antecipado: a Respan precisa ativá-lo para a sua organização, e você precisa adicionar sua chave de API da Respan como credencial de provedor da Respan no Phaseo antes de chamar qualquer um dos dois modelos.Corpo
- Option 1
- Option 2
O formato OpenAI é recomendado. O formato anterior permanece aceito. A resposta segue a solicitação; não misture os formatos.
Modelos de fallback opcionais e ordenados, tentados depois de model. model é obrigatório e é sempre o modelo principal. Quando uma tentativa falha com 429, 500, 502, 503 ou 504, a próxima entrada é tentada; os demais erros são retornados sem alteração. Aceita até 25 IDs de modelo ou predefinições; duplicatas e entradas iguais a model são ignoradas. Cada tentativa é validada, registrada e cobrada como uma solicitação separada, e o campo model da resposta e o rastreamento de roteamento mostram o modelo que atendeu a solicitação. Solicitações em streaming só recorrem a um fallback antes do primeiro byte, e trabalhos de vídeo e música apenas no envio. Solicitações de batch, realtime e council rejeitam models. Fallbacks definidos em uma rota dinâmica têm precedência, e phaseo/auto não pode ser combinado com models.
1 - 25 elements1[
"anthropic/claude-sonnet-5-5",
"google/gemini-2.5-flash"
]
Resposta
Resposta de decisões estruturadas
- Option 1
- Option 2
Respostas ordenadas para input/lista; mapa nomeado para state/mapa anterior.
Esta página foi útil?
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
questions: [{type: 'predicate', instructions: '<string>', name: '<string>'}],
models: ['anthropic/claude-sonnet-5-5', 'google/gemini-2.5-flash'],
provider_options: {typesafe: {long_context: true}},
safety_identifier: '<string>',
meta: false,
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
routing: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
metadata: {}
})
};
fetch('https://api.phaseo.app/v1/decisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/decisions"
payload = {
"model": "<string>",
"input": "<string>",
"questions": [
{
"type": "predicate",
"instructions": "<string>",
"name": "<string>"
}
],
"models": ["anthropic/claude-sonnet-5-5", "google/gemini-2.5-flash"],
"provider_options": { "typesafe": { "long_context": True } },
"safety_identifier": "<string>",
"meta": False,
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
},
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"questions": [
{
"type": "predicate",
"instructions": "<string>",
"name": "<string>"
}
],
"models": [
"anthropic/claude-sonnet-5-5",
"google/gemini-2.5-flash"
],
"provider_options": {
"typesafe": {
"long_context": true
}
},
"safety_identifier": "<string>",
"meta": false,
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phaseo.app/v1/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/decisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'questions' => [
[
'type' => 'predicate',
'instructions' => '<string>',
'name' => '<string>'
]
],
'models' => [
'anthropic/claude-sonnet-5-5',
'google/gemini-2.5-flash'
],
'provider_options' => [
'typesafe' => [
'long_context' => true
]
],
'safety_identifier' => '<string>',
'meta' => false,
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'routing' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"models\": [\n \"anthropic/claude-sonnet-5-5\",\n \"google/gemini-2.5-flash\"\n ],\n \"provider_options\": {\n \"typesafe\": {\n \"long_context\": true\n }\n },\n \"safety_identifier\": \"<string>\",\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": [
{
"type": "predicate",
"name": "<string>",
"probability": 0.5
}
],
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1,
"input_tokens_details": {
"cached_tokens": 1,
"cache_write_tokens": 1
},
"output_tokens_details": {
"reasoning_tokens": 1
}
},
"request_id": "<string>",
"meta": {}
}