Create policy
curl --request POST \
--url https://api-v2.requesty.ai/v1/manage/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "production-chat",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
},
{
"model": "anthropic/claude-sonnet-4",
"key": "POLICY_KEY_BYOK_FIRST",
"retries": 1
}
]
}
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
'import requests
url = "https://api-v2.requesty.ai/v1/manage/policy"
payload = {
"name": "production-chat",
"config": { "fallback": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
},
{
"model": "anthropic/claude-sonnet-4",
"key": "POLICY_KEY_BYOK_FIRST",
"retries": 1
}
] } },
"scope": "POLICY_SCOPE_ORGANIZATION"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'production-chat',
config: {
fallback: {
models: [
{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', retries: 2},
{model: 'anthropic/claude-sonnet-4', key: 'POLICY_KEY_BYOK_FIRST', retries: 1}
]
}
},
scope: 'POLICY_SCOPE_ORGANIZATION'
})
};
fetch('https://api-v2.requesty.ai/v1/manage/policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.requesty.ai/v1/manage/policy",
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([
'name' => 'production-chat',
'config' => [
'fallback' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'retries' => 2
],
[
'model' => 'anthropic/claude-sonnet-4',
'key' => 'POLICY_KEY_BYOK_FIRST',
'retries' => 1
]
]
]
],
'scope' => 'POLICY_SCOPE_ORGANIZATION'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.requesty.ai/v1/manage/policy"
payload := strings.NewReader("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\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-v2.requesty.ai/v1/manage/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/policy")
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 \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"organization_id": "<string>",
"author_id": "<string>",
"scope": "POLICY_SCOPE_ORGANIZATION"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Create Policy
Create a routing policy in the organization. A policy is a named chain of models with a strategy: fallback, load_balance, or latency. Use the policy name as the model in inference requests to route through it. Requires an API key with write manage permissions.
POST
/
v1
/
manage
/
policy
Create policy
curl --request POST \
--url https://api-v2.requesty.ai/v1/manage/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "production-chat",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
},
{
"model": "anthropic/claude-sonnet-4",
"key": "POLICY_KEY_BYOK_FIRST",
"retries": 1
}
]
}
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
'import requests
url = "https://api-v2.requesty.ai/v1/manage/policy"
payload = {
"name": "production-chat",
"config": { "fallback": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
},
{
"model": "anthropic/claude-sonnet-4",
"key": "POLICY_KEY_BYOK_FIRST",
"retries": 1
}
] } },
"scope": "POLICY_SCOPE_ORGANIZATION"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'production-chat',
config: {
fallback: {
models: [
{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', retries: 2},
{model: 'anthropic/claude-sonnet-4', key: 'POLICY_KEY_BYOK_FIRST', retries: 1}
]
}
},
scope: 'POLICY_SCOPE_ORGANIZATION'
})
};
fetch('https://api-v2.requesty.ai/v1/manage/policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.requesty.ai/v1/manage/policy",
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([
'name' => 'production-chat',
'config' => [
'fallback' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'retries' => 2
],
[
'model' => 'anthropic/claude-sonnet-4',
'key' => 'POLICY_KEY_BYOK_FIRST',
'retries' => 1
]
]
]
],
'scope' => 'POLICY_SCOPE_ORGANIZATION'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.requesty.ai/v1/manage/policy"
payload := strings.NewReader("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\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-v2.requesty.ai/v1/manage/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/policy")
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 \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n },\n {\n \"model\": \"anthropic/claude-sonnet-4\",\n \"key\": \"POLICY_KEY_BYOK_FIRST\",\n \"retries\": 1\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"organization_id": "<string>",
"author_id": "<string>",
"scope": "POLICY_SCOPE_ORGANIZATION"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Create a routing policy in your organization. A policy is a named chain of models with one strategy:
fallback tries models in order, load_balance splits traffic by weight, and latency picks the fastest model. Once created, use the policy name as the model in inference requests, for example policy/production-chat.
Fallback policies → · Load balancing policies →Authorizations
API key for authentication
Body
application/json
Policy name. Use it as the model in inference requests, for example policy/production-chat.
Example:
"production-chat"
Policy strategy and model chain. Set exactly one of fallback, load_balance, or latency, with at least one model.
Show child attributes
Show child attributes
Policy scope. The Management API only accepts POLICY_SCOPE_ORGANIZATION.
Available options:
POLICY_SCOPE_ORGANIZATION Example:
"POLICY_SCOPE_ORGANIZATION"
Response
Policy created successfully
Show child attributes
Show child attributes
Last modified on September 8, 2026
Was this page helpful?