判断
判断を行う
対応する判断モデルを使い、アプリケーションの状態に対して型付きの質問を評価します。
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": {}
}このエンドポイントはベータ段階です。
レスポンス(値は説明用です):
真偽値の選択肢は真偽値として返されます。モデルが質問への回答を拒否した場合、その質問には
料金が記載されているすべてのモデルで、出力トークンは無料です。
音声は、
Cloudflare はメディアのエンコード、画像の寸法、クリップの長さを検証し、動画を 1 秒あたり 2 フレームでサンプリングします。リクエスト内のすべての動画にサウンドトラックがある場合は、動画のサウンドトラックが使われます。メディアのトークンはコンテキストと課金に計数されます。Phaseo は Cloudflare が報告する入力使用量に基づいて精算し、音声や動画に別途料金を加えることはありません。Cloudflare の Omni のコントラクトを参照してください。
レスポンスは次のようになります。
input と順序付きの questions 配列を POST /v1/decisions に送信すると、質問ごとに 1 つの型付きの回答が、確率とともに同じ順序で返されます。
判断を行う
このリクエストは、各型の質問を 1 つずつ尋ねます。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 は任意です。回答は、名前のない質問や名前が重複する質問も含め、リクエストの順序を保ちます。
1 つのリクエストに含められる質問は最大 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 上にある必要があります。1 つのリクエストには最大 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を指定します。choice の質問は、選択肢から説明への対応をcriteriaのマップとして受け取り、score の質問は、2 つ以上のレベルの説明をcriteriaの配列として受け取ります。locateの質問はinstructionsだけを使い、imagesのない文字列のstateが必要です。Perplexity Decider を参照してください。images: 最大 4 枚の PNG、JPEG、WebP の画像。data:URL または{ "content_type", "base64" }オブジェクトで指定します。model: 省略した場合のデフォルトはtypesafe/jev-1.13.0です。
questions と同じキーが使われます。choice の回答には選ばれた選択肢、確率、信頼度が、noul の回答には 0〜1 の確率が、score の回答には確率で重み付けしたスコア、凡例、確率、信頼度が含まれます。
モデルを選ぶ
これらのモデルを呼び出す前に、モデルの提供状況を確認してください。| モデル | 質問の型 | 入力 | 100 万トークンあたりの入力料金 |
|---|---|---|---|
openai/gpt-6-luna | predicate、choice、score | テキスト、最大 128 枚の画像 | モデルページを参照 |
typesafe/jev-1.13.0、typesafe/jev-1.14.0 | 3 種類すべて(1 つのリクエストで混在可)。1.14 では box も | テキスト、PNG/JPEG 画像 | $0.042(Jev 1.13) |
cloudflare/clef、cloudflare/clef-flash | 3 種類すべて | テキスト、最大 4 枚の画像 | $0.24 / $0.038 |
cloudflare/clef-omni | 3 種類すべて | テキスト、画像、音声、動画 | $0.15 |
google/gemini-decision-1 | predicate、choice、score。1 リクエストあたり最大 1,000 個 | テキスト、画像、音声、動画 | $0.10 |
liquid-ai/d1:free | 3 種類すべて | モデルページを参照 | 早期アクセス期間中は無料 |
liquid-ai/d1, liquid-ai/d1.1, liquid-ai/d1-ultra | 3 種類すべて | テキスト、画像 | $0.02 / $0.02 / $0.042 |
liquid-ai/d1.2, liquid-ai/d1.2-ultra | 3 種類すべてに加え、従来形式で text、number、date、spans、boxes、複数選択 | テキスト、画像、音声 | $0.02 / $0.042 |
perplexity/pplx-decider-v1.3、perplexity/pplx-decider-flash-v1.3 | 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
Jev 1.13 にはtypesafe/jev-1.13.0 を、最新の Jev リリースに追従するには typesafe/jev-latest を使います。上流の質問のセマンティクスについては、TypeSafe の API リファレンスを参照してください。
対応する TypeSafe のルートでは、Jev 1.13 と 1.14 は、input_image または従来の images フィールドでインラインの PNG または JPEG 画像を受け付けます。Phaseo は TypeSafe の画像アセットを構築し、画像対応を自動で有効にします。画像は TypeSafe の画像の制限を満たす必要があります。1 枚あたり最大 16 MiB、各辺 256〜1568 ピクセル、合計 78,400 ピクセル以上です。TypeSafe は寸法とエンコードを検証し、拒否された画像のサイズ変更は行いません。対応付けられた上流の JSON 本文は 32 MiB までです。画像トークンには通常の入力料金が適用されます。
box(Jev 1.14 などの対応ルート)は画像を必要とし、criteria は受け取らず、1 つのバウンディングボックスと信頼度を返します。各辺は左上隅から測った 0〜1 の値です。Box は常に矩形を返すため、対象が存在しない可能性がある場合は、存在を確認する predicate の質問と組み合わせてください。従来の images フィールドでは images[0] を、順序付きの入力では最初の画像または [Image 0] を参照します。Box のコントラクトを参照してください。
provider_options.typesafe.long_context を true に設定すると、リクエストあたりと質問あたりのコンテキスト上限が、デフォルトのリクエストあたり 64k、質問あたり 32k から 262k トークンに引き上げられます。ロングコンテキストのトークンあたりの料金は変わりません。画像、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 トークン、Clef Flash が 24,576 トークンです。
{
"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 は最大 4 枚の PNG、JPEG、WebP の画像を受け付け、1 枚あたり最大 4 MiB かつ 16 メガピクセル、デコード後の画像データは合計 8 MiB まで、リクエスト本文は 13 MiB までです。リモート URL には対応しておらず、画像の形式と寸法は Cloudflare が検証します。画像に対応していないモデルは、画像を含むリクエストを拒否します。
Clef が受け付ける質問は最大 64 個で、ID は最大 100 文字の英字、数字、アンダースコア、ドット、ハイフンです。choice の質問には 2〜255 個の選択肢、score の質問には 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?" }]
}
format: "wav" または "mp3" を付けた input_audio.data として、または公開 HTTPS URL かインラインの音声 data URL を指定した input_audio.url として送信します。input_video.video_url は、公開 HTTPS URL またはインラインの MP4/WebM data URL を保持する、文字列または { "url": "..." } を受け付けます。リモートサーバーは一致する Content-Type を返す必要があります。Phaseo はサイズの制限と、プライベートアドレスおよびリダイレクトの確認を行いながら URL を取得し、メディアを Cloudflare 向けに埋め込みます。プロバイダーの認証情報がメディアサーバーに送信されることはありません。
| 制限 | 値 |
|---|---|
| 音声クリップ | 4 個。それぞれ最大 8 MiB、300 秒 |
| 動画 | 2 個。それぞれ最大 16 MiB、60 秒 |
| 音声と動画の合計 | デコード後 16 MiB |
| 画像 | Clef と同じ、1 枚あたりと合計の制限 |
| リクエスト本文 | 37 MiB(Clef の 13 MiB に代わります) |
| コンテキスト | 64,000 トークン |
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)。画像がちょうど 1 枚必要 | boxes、count、at_least |
choice の質問に multiple: true を指定すると、当てはまる選択肢をすべて choices で返し、選択肢ごとの probabilities も返します。ほかのモデルはこれらの質問タイプに 400 を返し、multiple の質問には 1 つの選択肢で答えます。音声入力に対応しないモデルは 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 トークンの入力で学習させています。どちらでも、choice の質問は最大 255 個の選択肢を、score の質問は最大 10 個のレベルを受け付けます。
Inception Mercury Decide
inception/mercury-decide は、テキストまたは JSON の根拠を受け付けます。choice の質問は最大 255 個の選択肢を、score の質問は最大 10 個のレベルを受け付けます。画像、ストリーミング、ツール呼び出しには対応していません。$0.02 の入力料金は Inception の 50% プロモーションによるもので、終了日は公表されていません。使用する前に現在の上流の料金を確認してください。
{
"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 トークンのテキストまたは 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 は 1 日あたりの上限がある無料の Lite モデルで、Respan の span-01-free モデルに対応します。respan/span-01 は span-01-pro に対応し、Respan が課金します。Span-01 は早期アクセス中です。Respan が組織に対して有効にする必要があり、どちらのモデルを呼び出す前にも、Phaseo で Respan のプロバイダー認証情報として Respan API キーを追加してください。ボディ
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": {}
}