निर्णय लें
समर्थित निर्णय मॉडलों से एप्लिकेशन की स्थिति पर टाइप किए गए प्रश्नों का मूल्यांकन करें।
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": {}
}POST /v1/decisions पर input और questions की एक क्रमबद्ध array भेजें, और हर प्रश्न का एक टाइप किया गया उत्तर, संभावनाओं के साथ, उसी क्रम में पाएं।
निर्णय लें
यह अनुरोध हर प्रकार का एक प्रश्न पूछता है। इसके लिए 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 एक string है, या user संदेशों की array, जिनका content एक string है या 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 (string या boolean, अलग-अलग) और वैकल्पिक 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" लौटाता है। कौन-सा मॉडल कौन-से प्रकार समर्थित करता है, यह मॉडल चुनें में सूचीबद्ध है।
इमेज input_image भागों में data URL के रूप में जाती हैं। होस्ट की गई 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 भी यही फ़ॉर्मैट इस्तेमाल करता है। फ़ॉर्मैट न मिलाएं: state या images के साथ input देने पर 400 लौटता है।
state: मूल्यांकन की जाने वाली जानकारी वाली string, ऑब्जेक्ट या array।questions: अधिकतम 128 नामित प्रश्न, या अधिक सीमा वाले मॉडलों पर उससे ज़्यादा। हर प्रश्नtypeकोnoul(हां/नहीं),choiceयाscoreपर सेट करता है, साथ मेंinstructions। Choice प्रश्नcriteriaको विकल्प से विवरण के मैप के रूप में लेते हैं; score प्रश्नcriteriaको कम से कम दो स्तर विवरणों की array के रूप में लेते हैं।locateप्रश्न केवलinstructionsलेते हैं और बिनाimagesवाला स्ट्रिंगstateचाहते हैं; देखें Perplexity Decider।images: अधिकतम चार PNG, JPEG या WebP इमेज,data:URL या{ "content_type", "base64" }ऑब्जेक्ट के रूप में।model: न देने पर डिफ़ॉल्टtypesafe/jev-1.13.0होता है।
questions वाली ही कुंजियां इस्तेमाल करते हैं। choice उत्तरों में चुना गया विकल्प, संभावनाएं और confidence होते हैं; noul उत्तरों में 0–1 की संभावना होती है; score उत्तरों में संभावना-भारित स्कोर, एक legend, संभावनाएं और confidence होते हैं।
मॉडल चुनें
इनमें से किसी भी मॉडल को कॉल करने से पहले मॉडल की उपलब्धता जांचें।| मॉडल | प्रश्न प्रकार | इनपुट | प्रति 1M टोकन इनपुट कीमत |
|---|---|---|---|
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
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 की इमेज सीमाएं पूरी करनी होंगी: हर एक अधिकतम 16 MiB, हर तरफ़ 256 से 1568 पिक्सेल, और कुल कम से कम 78,400 पिक्सेल। TypeSafe आयाम और एन्कोडिंग की जांच करता है और अस्वीकृत इमेज का आकार नहीं बदलता। मैप की गई अपस्ट्रीम JSON बॉडी की सीमा 32 MiB है। इमेज टोकन सामान्य इनपुट कीमत पर लगते हैं।
box (Jev 1.14 जैसे समर्थन करने वाले रूट पर) के लिए एक इमेज चाहिए, यह कोई criteria नहीं लेता, और एक bounding box व confidence लौटाता है। इसके किनारे 0 से 1 तक होते हैं, जो ऊपर-बाएं कोने से मापे जाते हैं। Box हमेशा एक आयत लौटाता है, इसलिए जब लक्ष्य मौजूद न भी हो सकता हो, तो इसे predicate उपस्थिति प्रश्न के साथ जोड़ें। पुराने images फ़ील्ड के साथ images[0] का संदर्भ दें; क्रमबद्ध इनपुट के साथ पहली इमेज या [Image 0] का संदर्भ दें। Box कॉन्ट्रैक्ट देखें।
प्रति-अनुरोध और प्रति-प्रश्न संदर्भ सीमाओं को डिफ़ॉल्ट 64k प्रति अनुरोध और 32k प्रति प्रश्न से बढ़ाकर 262k टोकन करने के लिए provider_options.typesafe.long_context को true पर सेट करें। लंबे संदर्भ की प्रति टोकन कीमत वही है। इमेज, 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,... string भी स्वीकार करता है। Clef अधिकतम चार PNG, JPEG या WebP इमेज स्वीकार करता है, हर एक अधिकतम 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 एक string या { "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 टोकन |
Liquid D1.2 और D1.2 Ultra
liquid-ai/d1.2 और liquid-ai/d1.2-ultra पुराने state फ़ॉर्मैट का उपयोग करते हैं, जिसमें अधिकतम चार इमेज और आठ ऑडियो क्लिप भेजी जा सकती हैं। 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, जिसके लिए 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 प्रदाता क्रेडेंशियल चाहिए। इनकी इमेज स्थिति PNG, JPEG या WebP base64 data URL इस्तेमाल करती है; रिमोट इमेज URL समर्थित नहीं हैं। ये locate प्रश्नों का भी जवाब देते हैं, जो स्ट्रिंग input या state के वे हिस्से लौटाते हैं जो instructions से मेल खाते हैं, जैसे "email address"। हर अंश में शब्दशः कॉपी किया गया text, Unicode कोड पॉइंट में गिने गए start और end ऑफ़सेट (end exclusive है), और एक 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 array और एक output assistant संदेश। यह सिर्फ़ 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 प्रदाता क्रेडेंशियल के रूप में जोड़ते हैं।बॉडी
- Option 1
- Option 2
OpenAI प्रारूप पसंदीदा है। पुराना प्रारूप समर्थित है। उत्तर अनुरोध जैसा होता है; प्रारूप न मिलाएँ।
model के बाद आज़माए जाने वाले वैकल्पिक, क्रमबद्ध फ़ॉलबैक मॉडल। model आवश्यक है और हमेशा प्राथमिक मॉडल होता है। जब कोई प्रयास 429, 500, 502, 503 या 504 के साथ विफल होता है, तो अगली प्रविष्टि आज़माई जाती है; अन्य त्रुटियाँ बिना बदलाव के लौटाई जाती हैं। अधिकतम 25 मॉडल ID या प्रीसेट स्वीकार करता है; डुप्लिकेट और model के समान प्रविष्टियाँ अनदेखी की जाती हैं। हर प्रयास को अलग अनुरोध के रूप में सत्यापित, लॉग और बिल किया जाता है, और प्रतिक्रिया का model फ़ील्ड तथा रूटिंग ट्रेस उस मॉडल को दिखाते हैं जिसने अनुरोध पूरा किया। स्ट्रीमिंग अनुरोध केवल पहले बाइट से पहले फ़ॉलबैक करते हैं, और वीडियो तथा संगीत जॉब केवल सबमिशन के समय। Batch, realtime और council अनुरोध models को अस्वीकार करते हैं। डायनामिक रूट पर सेट किए गए फ़ॉलबैक को प्राथमिकता मिलती है, और phaseo/auto को models के साथ नहीं जोड़ा जा सकता।
1 - 25 elements1[
"anthropic/claude-sonnet-5-5",
"google/gemini-2.5-flash"
]
प्रतिक्रिया
संरचित निर्णय प्रतिक्रिया
- Option 1
- Option 2
input/सूची के लिए क्रमबद्ध उत्तर; पुराने state/मैप के लिए नामित मैप।
वाज़ दिस पेज हेल्पफुल
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": {}
}