决策
作出决策
使用受支持的决策模型,针对应用状态评估带类型的问题。
POST
/
decisions
作出结构化决策
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": {}
}此端点处于 Beta 阶段。
将
响应(数值仅作示意):
布尔类型的选项值会以布尔值返回。模型拒绝回答某个问题时,会为该问题返回
所有列出价格的模型,输出 token 均免费。
音频可以作为
Cloudflare 会校验媒体编码、图像尺寸和片段时长,并以每秒两帧的频率对视频采样。当请求中的每个视频都有音轨时,会使用视频的音轨。媒体 token 计入上下文和计费;Phaseo 按 Cloudflare 报告的输入用量结算,不额外收取音频或视频费用。请参阅 Cloudflare 的 Omni 契约。
在
响应如下:
input 和按顺序排列的 questions 数组发送到 POST /v1/decisions,即可按相同顺序为每个问题获得一个带类型的回答及其概率。
作出决策
此请求对每种类型各提一个问题。它需要一个 Phaseo API 密钥和一条可用的openai/gpt-6-luna 路由。
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(); // 读取 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() # 读取 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 }
}
编写问题
input 是一个字符串,或一个 user 消息数组,其中 content 是字符串,或由 input_text、input_image、input_audio 和 input_video 部分组成的列表。name 是可选的;回答保持请求中的顺序,包括未命名的问题和重复的名称。
每个请求最多包含 128 个问题,但 google/gemini-decision-1 最多可接受 1,000 个,parallel/decisions-fast 最多可接受 100 个,Clef 最多可接受 64 个。超出模型上限的请求会返回 400。
type | 额外字段 | 回答字段 |
|---|---|---|
predicate | 无 | 答案为“是”的 probability(0–1) |
choice | choices:value(字符串或布尔值,互不相同)和可选的 description | choice、confidence,以及每个值的 probabilities |
score | levels:label 和可选的 description | score(按概率加权的级别索引)、confidence,以及每个级别的 probabilities |
box | 无;input 中需要一张图像 | box(top、bottom、left、right)、confidence |
locate | 无;需要不含媒体的字符串 input | spans(start、end、text、score) |
type: "refusal"。各模型支持哪些类型,见选择模型。
图像以 data URL 的形式放在 input_image 部分中。托管的 HTTPS 图像 URL 仅适用于 Base Labs 模型(baselabs/elephant-1、baselabs/mammoth-1 和 baselabs/joey-1),并且必须位于 Amazon S3、Google Cloud Storage 或 Azure Blob Storage 上。一个请求最多携带 128 张图像,Luna 可以全部接受;其他提供商的上限更低。显式的图像 detail 和 safety_identifier 需要 OpenAI 路由。
使用旧的 state 格式
带有state 和命名问题映射的请求仍然可用,并返回以相同名称为键的回答。Together Tev(together/tev1-4b-experimental)需要这种格式,因为它返回不带概率的标签,并且只回答 choice 问题。Respan Span-01 也使用这种格式。不要混用两种格式:input 与 state 或 images 同时出现会返回 400。
state:一个字符串、对象或数组,包含要评估的信息。questions:最多 128 个命名问题,上限更高的模型可接受更多。每个问题将type设为noul(是/否)、choice或score,并提供instructions。选择题的criteria是选项到描述的映射;评分题的criteria是至少包含两个级别描述的数组。locate问题只使用instructions,并且需要不含images的字符串state;参见 Perplexity Decider。images:最多四张 PNG、JPEG 或 WebP 图像,形式为data:URL 或{ "content_type", "base64" }对象。model:省略时默认为typesafe/jev-1.13.0。
questions 相同的键。choice 回答包含所选选项、概率和置信度;noul 回答包含一个 0–1 的概率;score 回答包含按概率加权的分数、图例、概率和置信度。
选择模型
调用以下任何模型之前,请先检查模型可用性。| 模型 | 问题类型 | 输入 | 每 1M token 输入价格 |
|---|---|---|---|
openai/gpt-6-luna | predicate、choice、score | 文本,最多 128 张图像 | 见模型页面 |
typesafe/jev-1.13.0、typesafe/jev-1.14.0 | 全部三种,可在一个请求中混用;1.14 支持 box | 文本、PNG/JPEG 图像 | $0.042(Jev 1.13) |
cloudflare/clef、cloudflare/clef-flash | 全部三种 | 文本,最多 4 张图像 | $0.24 / $0.038 |
cloudflare/clef-omni | 全部三种 | 文本、图像、音频、视频 | $0.15 |
google/gemini-decision-1 | predicate、choice、score;每个请求最多 1,000 个 | 文本、图像、音频、视频 | $0.10 |
liquid-ai/d1:free | 全部三种 | 见模型页面 | 抢先体验期间免费 |
liquid-ai/d1, liquid-ai/d1.1, liquid-ai/d1-ultra | 全部三种 | 文本、图像 | $0.02 / $0.02 / $0.042 |
liquid-ai/d1.2, liquid-ai/d1.2-ultra | 全部三种,旧格式下另支持 text、number、date、spans、boxes 和多选 | 文本、图像、音频 | $0.02 / $0.042 |
perplexity/pplx-decider-v1.3、perplexity/pplx-decider-flash-v1.3 | 全部三种,以及 locate | 文本、base64 图像 | $0.02 / $0.01 |
inception/mercury-decide | predicate、choice、score | 文本或 JSON | $0.02(促销价) |
microsoft/microsoft-decision-1 | predicate、choice、score | 文本或 JSON | $0.042 |
respan/span-01:free、respan/span-01 | 仅 noul(旧格式) | 对话片段 | 免费(Lite)/ $0.02 |
together/tev1-4b-experimental | 仅 choice(旧格式) | 文本 | 见模型页面 |
TypeSafe Jev
使用typesafe/jev-1.13.0 调用 Jev 1.13,或使用 typesafe/jev-latest 跟随最新的 Jev 版本。上游问题语义请参阅 TypeSafe 的 API 参考。
在支持的 TypeSafe 路由上,Jev 1.13 和 1.14 可以通过 input_image 或旧的 images 字段接受内联 PNG 或 JPEG 图像。Phaseo 会构建 TypeSafe 的图像资源并自动启用图像支持。图像必须符合 TypeSafe 的图像限制:每张最多 16 MiB,每条边 256 到 1568 像素,总像素至少 78,400。TypeSafe 会校验尺寸和编码,并且不会缩放被拒绝的图像。映射后的上游 JSON 正文上限为 32 MiB。图像 token 按正常输入价格计费。
box(在 Jev 1.14 等支持的路由上)需要一张图像,不接受 criteria,并返回一个边界框和置信度。边界值范围为 0 到 1,从左上角开始测量。Box 总是返回一个矩形,因此当目标可能不存在时,请搭配一个 predicate 存在性问题。使用旧的 images 字段时,引用 images[0];使用有序输入时,引用第一张图像或 [Image 0]。请参阅 Box 契约。
将 provider_options.typesafe.long_context 设为 true,可将每个请求和每个问题的上下文上限提高到 262k token,而默认值为每个请求 64k、每个问题 32k。长上下文每 token 的价格相同。图像、Box 和长上下文都是上游的实验性能力。
{
"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 和 Clef Flash
cloudflare/clef 和 cloudflare/clef-flash 运行在 Cloudflare Workers AI 上。Clef 的上下文窗口为 65,536 token,Clef Flash 为 24,576 token。
{
"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 也接受 data:image/png;base64,... 字符串。Clef 最多接受四张 PNG、JPEG 或 WebP 图像,每张最多 4 MiB、1600 万像素,解码后的图像数据合计最多 8 MiB,请求正文最多 13 MiB。不支持远程 URL,图像格式和尺寸由 Cloudflare 校验。不支持图像的模型会拒绝带图像的请求。
Clef 最多接受 64 个问题,ID 最多 100 个字母、数字、下划线、点或连字符。选择题需要 2–255 个选项,评分题需要 2–10 个级别。请参阅 Cloudflare 的 Clef 文档。
Cloudflare Clef Omni
cloudflare/clef-omni 接受文本、图像、音频和视频。音频和视频部分是 Phaseo 对输入格式的扩展;OpenAI 路由只接受文本和图像。发送此示例前,请将占位的音频字节和视频 URL 替换为你自己的媒体。
{
"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 发送,并设置 format: "wav" 或 "mp3";也可以作为 input_audio.url 发送,值为公共 HTTPS URL 或内联音频 data URL。input_video.video_url 接受字符串或 { "url": "..." },其中包含公共 HTTPS URL 或内联 MP4/WebM data URL。远程服务器必须返回匹配的 Content-Type。Phaseo 抓取 URL 时会进行大小限制以及私有地址和重定向检查,然后将媒体嵌入后发送给 Cloudflare;提供商凭据绝不会发送给媒体服务器。
| 限制 | 值 |
|---|---|
| 音频片段 | 4 个,每个最多 8 MiB、300 秒 |
| 视频 | 2 个,每个最多 16 MiB、60 秒 |
| 音频和视频合计 | 解码后 16 MiB |
| 图像 | 单张和合计限制与 Clef 相同 |
| 请求正文 | 37 MiB(取代 Clef 的 13 MiB) |
| 上下文 | 64,000 token |
Liquid D1.2 和 D1.2 Ultra
liquid-ai/d1.2 和 liquid-ai/d1.2-ultra 使用旧的 state 格式,最多接受 4 张图像和 8 段音频。audio 以 base64 data: URL 发送(WAV、MP3、FLAC、M4A 或 OGG,每个 URL 最多 24 MiB,约合 18 MiB 音频);不支持远程音频 URL。除 noul、choice 和 score 外,它们还回答以下问题类型:
type | 额外字段 | 回答字段 |
|---|---|---|
text | 无 | text,以及 span(在 state 中的起止位置)和 found(0–1);found 低于 0.5 时 text 为 null |
number | 可选 unit;可选 range([low, high])和 step,step 需要 range 且必须能整除该范围 | number 和 unit;没有 range 时还返回 text、span 和 found;有 range 时 number 为中位数,interval 为 [p10, p90] |
date | 无 | date(YYYY-MM-DD)、text、span、found |
spans | 无 | spans(每项含 text、span 和 found)、count、at_least |
boxes | 可选 max(1–16);需要恰好一张图像 | boxes、count、at_least |
choice 问题上设置 multiple: true,即可在 choices 中获得所有适用的选项,并附带每个选项的 probabilities。其他模型对这些问题类型返回 400,并以单个选项回答 multiple 问题;不支持音频输入的模型会忽略 audio。liquid-ai/d1、liquid-ai/d1.1 和 liquid-ai/d1-ultra 接受文本和图像,回答 noul、choice 和 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 和 Perplexity Decider
Liquid D1(liquid-ai/d1:free)在实验性抢先体验期间免费。Perplexity Decider V1.3(perplexity/pplx-decider-v1.3,或 perplexity/pplx-decider-latest)和 Decider Flash V1.3(perplexity/pplx-decider-flash-v1.3,或 perplexity/pplx-decider-flash-latest)需要在 Phaseo 中配置 Perplexity 提供商凭据。它们的图像 state 使用 PNG、JPEG 或 WebP 的 base64 data URL;不支持远程图像 URL。它们还能回答 locate 问题,返回字符串 input 或 state 中与 instructions(例如 "email address")匹配的部分。每个片段包含原样复制的 text、按 Unicode 码位计数的 start 和 end 偏移量(不含 end),以及数值越高越确定的 score;没有匹配时 spans 为空。Locate 不使用 criteria,不接受图像、音频或视频,只能在标明支持它的模型上使用;其他模型会返回 400。Perplexity 使用最多 8K token 的输入训练了该功能。在这两个模型上,选择题最多接受 255 个选项,评分题最多接受 10 个级别。
Inception Mercury Decide
inception/mercury-decide 接受文本或 JSON 证据。选择题最多接受 255 个选项,评分题最多接受 10 个级别。不支持图像、流式传输和工具调用。$0.02 的输入价格是 Inception 的五折促销价,目前没有公布结束日期;使用前请查看当前的上游定价。
{
"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 运行在 Azure Foundry 部署上,接受最多 32,768 token 的文本或 JSON 证据。不支持媒体、流式传输、工具、safety_identifier 和 service_tier。请参阅 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
Span-01 使用旧格式。state 必须是一个对话片段:由前面消息组成的 input 数组,以及一条 output 助手消息。它只回答 noul 问题:noul 值是该行为存在的概率,probabilities 还会给出不存在和无法观察到的概率。
{
"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 是有每日用量上限的免费 Lite 模型,对应 Respan 的 span-01-free 模型。respan/span-01 对应 span-01-pro,由 Respan 计费。Span-01 处于抢先体验阶段:Respan 必须为你的组织启用它,并且在调用任一模型之前,你需要在 Phaseo 中将你的 Respan API 密钥添加为 Respan 提供商凭据。请求体
application/json
- Option 1
- Option 2
推荐 OpenAI 格式。原有格式仍受支持。回答遵循请求格式,请勿混用。
在 model 之后按顺序尝试的可选回退模型。model 为必填项,且始终是主模型。当某次尝试以 429、500、502、503 或 504 失败时,会尝试下一项;其他错误按原样返回。最多接受 25 个模型 ID 或预设;重复项以及与 model 相同的项会被忽略。每次尝试都会作为独立请求进行验证、记录和计费,响应中的 model 字段和路由追踪会显示实际处理请求的模型。流式请求仅在发送第一个字节之前回退,视频和音乐任务仅在提交时回退。Batch、realtime 和 council 请求会拒绝 models。动态路由上设置的回退优先,且 phaseo/auto 不能与 models 一起使用。
Required array length:
1 - 25 elementsMinimum string length:
1示例:
[ "anthropic/claude-sonnet-5-5", "google/gemini-2.5-flash" ]
最后修改于 2026年11月16日
⌘I
作出结构化决策
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": {}
}