Validate a router graph without writing it
curl --request POST \
--url https://api.example.com/api/airouter/config/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"position": {
"x": 0,
"y": 0
},
"role_gate": {
"router_role": "<string>",
"priority": 100
},
"content_role": {
"description": "<string>",
"operator": "AND",
"conditions": [
{
"type": "<string>",
"name": "<string>",
"params": {},
"conditions": "<array>"
}
],
"plugins": [
{
"type": "<string>",
"configuration": {}
}
],
"priority": 50,
"selection_algorithm": "<string>",
"model_refs": [
{}
]
},
"model": {
"model": "<string>",
"api_format": "<string>",
"preferred_endpoints": [
"<string>"
],
"capabilities": [
"<string>"
],
"quality_score": 123,
"pricing": {
"currency": "<string>",
"prompt_per_1m": 1,
"completion_per_1m": 1,
"cache_read_per_1m": 1,
"cache_write_per_1m": 1
},
"external_model_ids": {},
"access_key": "<string>",
"reasoning_family": "<string>",
"reasoning_effort": "<string>",
"max_tokens": 123,
"is_default": false,
"raw": {}
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>"
}
],
"role_bindings": [
{
"name": "<string>",
"role": "<string>",
"description": "<string>",
"subjects": [
{
"name": "<string>",
"kind": "Group"
}
]
}
],
"vllm_endpoints": [
{
"name": "<string>",
"type": "openai",
"address": "",
"port": 123,
"protocol": "<string>",
"api_key": "<string>",
"provider_profile": "<string>",
"base_url": "<string>",
"extra_headers": {},
"default_max_tokens": 123,
"prompt_caching": true,
"stream_upstream": true,
"token_exchange": "<string>",
"token_exchange_audience": "<string>",
"weight": 123,
"models": [
"<string>"
],
"raw": {}
}
],
"keyword_rules": [
{}
],
"jailbreak": [
{}
],
"pii": [
{}
],
"default_model": "<string>",
"default_reasoning_effort": "<string>",
"strategy": "<string>",
"force_routing": true,
"clear_route_cache": true,
"router_replay": {
"store_backend": "memory",
"ttl_seconds": 2592000,
"async_writes": true
},
"tools": {
"enabled": true,
"embedding": {
"endpoint": "<string>",
"model": "<string>",
"timeout_seconds": 20
}
},
"semantic_cache": {
"enabled": false,
"backend_type": "memory",
"similarity_threshold": 0.8,
"ttl_seconds": 3600,
"max_entries": 1000
},
"extras": {}
},
"message": "<string>"
}
'import requests
url = "https://api.example.com/api/airouter/config/validate"
payload = {
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"position": {
"x": 0,
"y": 0
},
"role_gate": {
"router_role": "<string>",
"priority": 100
},
"content_role": {
"description": "<string>",
"operator": "AND",
"conditions": [
{
"type": "<string>",
"name": "<string>",
"params": {},
"conditions": "<array>"
}
],
"plugins": [
{
"type": "<string>",
"configuration": {}
}
],
"priority": 50,
"selection_algorithm": "<string>",
"model_refs": [{}]
},
"model": {
"model": "<string>",
"api_format": "<string>",
"preferred_endpoints": ["<string>"],
"capabilities": ["<string>"],
"quality_score": 123,
"pricing": {
"currency": "<string>",
"prompt_per_1m": 1,
"completion_per_1m": 1,
"cache_read_per_1m": 1,
"cache_write_per_1m": 1
},
"external_model_ids": {},
"access_key": "<string>",
"reasoning_family": "<string>",
"reasoning_effort": "<string>",
"max_tokens": 123,
"is_default": False,
"raw": {}
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>"
}
],
"role_bindings": [
{
"name": "<string>",
"role": "<string>",
"description": "<string>",
"subjects": [
{
"name": "<string>",
"kind": "Group"
}
]
}
],
"vllm_endpoints": [
{
"name": "<string>",
"type": "openai",
"address": "",
"port": 123,
"protocol": "<string>",
"api_key": "<string>",
"provider_profile": "<string>",
"base_url": "<string>",
"extra_headers": {},
"default_max_tokens": 123,
"prompt_caching": True,
"stream_upstream": True,
"token_exchange": "<string>",
"token_exchange_audience": "<string>",
"weight": 123,
"models": ["<string>"],
"raw": {}
}
],
"keyword_rules": [{}],
"jailbreak": [{}],
"pii": [{}],
"default_model": "<string>",
"default_reasoning_effort": "<string>",
"strategy": "<string>",
"force_routing": True,
"clear_route_cache": True,
"router_replay": {
"store_backend": "memory",
"ttl_seconds": 2592000,
"async_writes": True
},
"tools": {
"enabled": True,
"embedding": {
"endpoint": "<string>",
"model": "<string>",
"timeout_seconds": 20
}
},
"semantic_cache": {
"enabled": False,
"backend_type": "memory",
"similarity_threshold": 0.8,
"ttl_seconds": 3600,
"max_entries": 1000
},
"extras": {}
},
"message": "<string>"
}
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({
graph: {
nodes: [
{
id: '<string>',
label: '<string>',
position: {x: 0, y: 0},
role_gate: {router_role: '<string>', priority: 100},
content_role: {
description: '<string>',
operator: 'AND',
conditions: [{type: '<string>', name: '<string>', params: {}, conditions: '<array>'}],
plugins: [{type: '<string>', configuration: {}}],
priority: 50,
selection_algorithm: '<string>',
model_refs: [{}]
},
model: {
model: '<string>',
api_format: '<string>',
preferred_endpoints: ['<string>'],
capabilities: ['<string>'],
quality_score: 123,
pricing: {
currency: '<string>',
prompt_per_1m: 1,
completion_per_1m: 1,
cache_read_per_1m: 1,
cache_write_per_1m: 1
},
external_model_ids: {},
access_key: '<string>',
reasoning_family: '<string>',
reasoning_effort: '<string>',
max_tokens: 123,
is_default: false,
raw: {}
}
}
],
edges: [{id: '<string>', source: '<string>', target: '<string>'}],
role_bindings: [
{
name: '<string>',
role: '<string>',
description: '<string>',
subjects: [{name: '<string>', kind: 'Group'}]
}
],
vllm_endpoints: [
{
name: '<string>',
type: 'openai',
address: '',
port: 123,
protocol: '<string>',
api_key: '<string>',
provider_profile: '<string>',
base_url: '<string>',
extra_headers: {},
default_max_tokens: 123,
prompt_caching: true,
stream_upstream: true,
token_exchange: '<string>',
token_exchange_audience: '<string>',
weight: 123,
models: ['<string>'],
raw: {}
}
],
keyword_rules: [{}],
jailbreak: [{}],
pii: [{}],
default_model: '<string>',
default_reasoning_effort: '<string>',
strategy: '<string>',
force_routing: true,
clear_route_cache: true,
router_replay: {store_backend: 'memory', ttl_seconds: 2592000, async_writes: true},
tools: {
enabled: true,
embedding: {endpoint: '<string>', model: '<string>', timeout_seconds: 20}
},
semantic_cache: {
enabled: false,
backend_type: 'memory',
similarity_threshold: 0.8,
ttl_seconds: 3600,
max_entries: 1000
},
extras: {}
},
message: '<string>'
})
};
fetch('https://api.example.com/api/airouter/config/validate', 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.example.com/api/airouter/config/validate",
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([
'graph' => [
'nodes' => [
[
'id' => '<string>',
'label' => '<string>',
'position' => [
'x' => 0,
'y' => 0
],
'role_gate' => [
'router_role' => '<string>',
'priority' => 100
],
'content_role' => [
'description' => '<string>',
'operator' => 'AND',
'conditions' => [
[
'type' => '<string>',
'name' => '<string>',
'params' => [
],
'conditions' => '<array>'
]
],
'plugins' => [
[
'type' => '<string>',
'configuration' => [
]
]
],
'priority' => 50,
'selection_algorithm' => '<string>',
'model_refs' => [
[
]
]
],
'model' => [
'model' => '<string>',
'api_format' => '<string>',
'preferred_endpoints' => [
'<string>'
],
'capabilities' => [
'<string>'
],
'quality_score' => 123,
'pricing' => [
'currency' => '<string>',
'prompt_per_1m' => 1,
'completion_per_1m' => 1,
'cache_read_per_1m' => 1,
'cache_write_per_1m' => 1
],
'external_model_ids' => [
],
'access_key' => '<string>',
'reasoning_family' => '<string>',
'reasoning_effort' => '<string>',
'max_tokens' => 123,
'is_default' => false,
'raw' => [
]
]
]
],
'edges' => [
[
'id' => '<string>',
'source' => '<string>',
'target' => '<string>'
]
],
'role_bindings' => [
[
'name' => '<string>',
'role' => '<string>',
'description' => '<string>',
'subjects' => [
[
'name' => '<string>',
'kind' => 'Group'
]
]
]
],
'vllm_endpoints' => [
[
'name' => '<string>',
'type' => 'openai',
'address' => '',
'port' => 123,
'protocol' => '<string>',
'api_key' => '<string>',
'provider_profile' => '<string>',
'base_url' => '<string>',
'extra_headers' => [
],
'default_max_tokens' => 123,
'prompt_caching' => true,
'stream_upstream' => true,
'token_exchange' => '<string>',
'token_exchange_audience' => '<string>',
'weight' => 123,
'models' => [
'<string>'
],
'raw' => [
]
]
],
'keyword_rules' => [
[
]
],
'jailbreak' => [
[
]
],
'pii' => [
[
]
],
'default_model' => '<string>',
'default_reasoning_effort' => '<string>',
'strategy' => '<string>',
'force_routing' => true,
'clear_route_cache' => true,
'router_replay' => [
'store_backend' => 'memory',
'ttl_seconds' => 2592000,
'async_writes' => true
],
'tools' => [
'enabled' => true,
'embedding' => [
'endpoint' => '<string>',
'model' => '<string>',
'timeout_seconds' => 20
]
],
'semantic_cache' => [
'enabled' => false,
'backend_type' => 'memory',
'similarity_threshold' => 0.8,
'ttl_seconds' => 3600,
'max_entries' => 1000
],
'extras' => [
]
],
'message' => '<string>'
]),
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.example.com/api/airouter/config/validate"
payload := strings.NewReader("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\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.example.com/api/airouter/config/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/airouter/config/validate")
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 \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}AI control plane
Validate a router graph without writing it
Structural validation — duplicate ids, dangling edges, missing default route, unwired roles — returned as errors + warnings.
POST
/
api
/
airouter
/
config
/
validate
Validate a router graph without writing it
curl --request POST \
--url https://api.example.com/api/airouter/config/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"position": {
"x": 0,
"y": 0
},
"role_gate": {
"router_role": "<string>",
"priority": 100
},
"content_role": {
"description": "<string>",
"operator": "AND",
"conditions": [
{
"type": "<string>",
"name": "<string>",
"params": {},
"conditions": "<array>"
}
],
"plugins": [
{
"type": "<string>",
"configuration": {}
}
],
"priority": 50,
"selection_algorithm": "<string>",
"model_refs": [
{}
]
},
"model": {
"model": "<string>",
"api_format": "<string>",
"preferred_endpoints": [
"<string>"
],
"capabilities": [
"<string>"
],
"quality_score": 123,
"pricing": {
"currency": "<string>",
"prompt_per_1m": 1,
"completion_per_1m": 1,
"cache_read_per_1m": 1,
"cache_write_per_1m": 1
},
"external_model_ids": {},
"access_key": "<string>",
"reasoning_family": "<string>",
"reasoning_effort": "<string>",
"max_tokens": 123,
"is_default": false,
"raw": {}
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>"
}
],
"role_bindings": [
{
"name": "<string>",
"role": "<string>",
"description": "<string>",
"subjects": [
{
"name": "<string>",
"kind": "Group"
}
]
}
],
"vllm_endpoints": [
{
"name": "<string>",
"type": "openai",
"address": "",
"port": 123,
"protocol": "<string>",
"api_key": "<string>",
"provider_profile": "<string>",
"base_url": "<string>",
"extra_headers": {},
"default_max_tokens": 123,
"prompt_caching": true,
"stream_upstream": true,
"token_exchange": "<string>",
"token_exchange_audience": "<string>",
"weight": 123,
"models": [
"<string>"
],
"raw": {}
}
],
"keyword_rules": [
{}
],
"jailbreak": [
{}
],
"pii": [
{}
],
"default_model": "<string>",
"default_reasoning_effort": "<string>",
"strategy": "<string>",
"force_routing": true,
"clear_route_cache": true,
"router_replay": {
"store_backend": "memory",
"ttl_seconds": 2592000,
"async_writes": true
},
"tools": {
"enabled": true,
"embedding": {
"endpoint": "<string>",
"model": "<string>",
"timeout_seconds": 20
}
},
"semantic_cache": {
"enabled": false,
"backend_type": "memory",
"similarity_threshold": 0.8,
"ttl_seconds": 3600,
"max_entries": 1000
},
"extras": {}
},
"message": "<string>"
}
'import requests
url = "https://api.example.com/api/airouter/config/validate"
payload = {
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"position": {
"x": 0,
"y": 0
},
"role_gate": {
"router_role": "<string>",
"priority": 100
},
"content_role": {
"description": "<string>",
"operator": "AND",
"conditions": [
{
"type": "<string>",
"name": "<string>",
"params": {},
"conditions": "<array>"
}
],
"plugins": [
{
"type": "<string>",
"configuration": {}
}
],
"priority": 50,
"selection_algorithm": "<string>",
"model_refs": [{}]
},
"model": {
"model": "<string>",
"api_format": "<string>",
"preferred_endpoints": ["<string>"],
"capabilities": ["<string>"],
"quality_score": 123,
"pricing": {
"currency": "<string>",
"prompt_per_1m": 1,
"completion_per_1m": 1,
"cache_read_per_1m": 1,
"cache_write_per_1m": 1
},
"external_model_ids": {},
"access_key": "<string>",
"reasoning_family": "<string>",
"reasoning_effort": "<string>",
"max_tokens": 123,
"is_default": False,
"raw": {}
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>"
}
],
"role_bindings": [
{
"name": "<string>",
"role": "<string>",
"description": "<string>",
"subjects": [
{
"name": "<string>",
"kind": "Group"
}
]
}
],
"vllm_endpoints": [
{
"name": "<string>",
"type": "openai",
"address": "",
"port": 123,
"protocol": "<string>",
"api_key": "<string>",
"provider_profile": "<string>",
"base_url": "<string>",
"extra_headers": {},
"default_max_tokens": 123,
"prompt_caching": True,
"stream_upstream": True,
"token_exchange": "<string>",
"token_exchange_audience": "<string>",
"weight": 123,
"models": ["<string>"],
"raw": {}
}
],
"keyword_rules": [{}],
"jailbreak": [{}],
"pii": [{}],
"default_model": "<string>",
"default_reasoning_effort": "<string>",
"strategy": "<string>",
"force_routing": True,
"clear_route_cache": True,
"router_replay": {
"store_backend": "memory",
"ttl_seconds": 2592000,
"async_writes": True
},
"tools": {
"enabled": True,
"embedding": {
"endpoint": "<string>",
"model": "<string>",
"timeout_seconds": 20
}
},
"semantic_cache": {
"enabled": False,
"backend_type": "memory",
"similarity_threshold": 0.8,
"ttl_seconds": 3600,
"max_entries": 1000
},
"extras": {}
},
"message": "<string>"
}
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({
graph: {
nodes: [
{
id: '<string>',
label: '<string>',
position: {x: 0, y: 0},
role_gate: {router_role: '<string>', priority: 100},
content_role: {
description: '<string>',
operator: 'AND',
conditions: [{type: '<string>', name: '<string>', params: {}, conditions: '<array>'}],
plugins: [{type: '<string>', configuration: {}}],
priority: 50,
selection_algorithm: '<string>',
model_refs: [{}]
},
model: {
model: '<string>',
api_format: '<string>',
preferred_endpoints: ['<string>'],
capabilities: ['<string>'],
quality_score: 123,
pricing: {
currency: '<string>',
prompt_per_1m: 1,
completion_per_1m: 1,
cache_read_per_1m: 1,
cache_write_per_1m: 1
},
external_model_ids: {},
access_key: '<string>',
reasoning_family: '<string>',
reasoning_effort: '<string>',
max_tokens: 123,
is_default: false,
raw: {}
}
}
],
edges: [{id: '<string>', source: '<string>', target: '<string>'}],
role_bindings: [
{
name: '<string>',
role: '<string>',
description: '<string>',
subjects: [{name: '<string>', kind: 'Group'}]
}
],
vllm_endpoints: [
{
name: '<string>',
type: 'openai',
address: '',
port: 123,
protocol: '<string>',
api_key: '<string>',
provider_profile: '<string>',
base_url: '<string>',
extra_headers: {},
default_max_tokens: 123,
prompt_caching: true,
stream_upstream: true,
token_exchange: '<string>',
token_exchange_audience: '<string>',
weight: 123,
models: ['<string>'],
raw: {}
}
],
keyword_rules: [{}],
jailbreak: [{}],
pii: [{}],
default_model: '<string>',
default_reasoning_effort: '<string>',
strategy: '<string>',
force_routing: true,
clear_route_cache: true,
router_replay: {store_backend: 'memory', ttl_seconds: 2592000, async_writes: true},
tools: {
enabled: true,
embedding: {endpoint: '<string>', model: '<string>', timeout_seconds: 20}
},
semantic_cache: {
enabled: false,
backend_type: 'memory',
similarity_threshold: 0.8,
ttl_seconds: 3600,
max_entries: 1000
},
extras: {}
},
message: '<string>'
})
};
fetch('https://api.example.com/api/airouter/config/validate', 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.example.com/api/airouter/config/validate",
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([
'graph' => [
'nodes' => [
[
'id' => '<string>',
'label' => '<string>',
'position' => [
'x' => 0,
'y' => 0
],
'role_gate' => [
'router_role' => '<string>',
'priority' => 100
],
'content_role' => [
'description' => '<string>',
'operator' => 'AND',
'conditions' => [
[
'type' => '<string>',
'name' => '<string>',
'params' => [
],
'conditions' => '<array>'
]
],
'plugins' => [
[
'type' => '<string>',
'configuration' => [
]
]
],
'priority' => 50,
'selection_algorithm' => '<string>',
'model_refs' => [
[
]
]
],
'model' => [
'model' => '<string>',
'api_format' => '<string>',
'preferred_endpoints' => [
'<string>'
],
'capabilities' => [
'<string>'
],
'quality_score' => 123,
'pricing' => [
'currency' => '<string>',
'prompt_per_1m' => 1,
'completion_per_1m' => 1,
'cache_read_per_1m' => 1,
'cache_write_per_1m' => 1
],
'external_model_ids' => [
],
'access_key' => '<string>',
'reasoning_family' => '<string>',
'reasoning_effort' => '<string>',
'max_tokens' => 123,
'is_default' => false,
'raw' => [
]
]
]
],
'edges' => [
[
'id' => '<string>',
'source' => '<string>',
'target' => '<string>'
]
],
'role_bindings' => [
[
'name' => '<string>',
'role' => '<string>',
'description' => '<string>',
'subjects' => [
[
'name' => '<string>',
'kind' => 'Group'
]
]
]
],
'vllm_endpoints' => [
[
'name' => '<string>',
'type' => 'openai',
'address' => '',
'port' => 123,
'protocol' => '<string>',
'api_key' => '<string>',
'provider_profile' => '<string>',
'base_url' => '<string>',
'extra_headers' => [
],
'default_max_tokens' => 123,
'prompt_caching' => true,
'stream_upstream' => true,
'token_exchange' => '<string>',
'token_exchange_audience' => '<string>',
'weight' => 123,
'models' => [
'<string>'
],
'raw' => [
]
]
],
'keyword_rules' => [
[
]
],
'jailbreak' => [
[
]
],
'pii' => [
[
]
],
'default_model' => '<string>',
'default_reasoning_effort' => '<string>',
'strategy' => '<string>',
'force_routing' => true,
'clear_route_cache' => true,
'router_replay' => [
'store_backend' => 'memory',
'ttl_seconds' => 2592000,
'async_writes' => true
],
'tools' => [
'enabled' => true,
'embedding' => [
'endpoint' => '<string>',
'model' => '<string>',
'timeout_seconds' => 20
]
],
'semantic_cache' => [
'enabled' => false,
'backend_type' => 'memory',
'similarity_threshold' => 0.8,
'ttl_seconds' => 3600,
'max_entries' => 1000
],
'extras' => [
]
],
'message' => '<string>'
]),
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.example.com/api/airouter/config/validate"
payload := strings.NewReader("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\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.example.com/api/airouter/config/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/airouter/config/validate")
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 \"graph\": {\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"role_gate\": {\n \"router_role\": \"<string>\",\n \"priority\": 100\n },\n \"content_role\": {\n \"description\": \"<string>\",\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"params\": {},\n \"conditions\": \"<array>\"\n }\n ],\n \"plugins\": [\n {\n \"type\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"priority\": 50,\n \"selection_algorithm\": \"<string>\",\n \"model_refs\": [\n {}\n ]\n },\n \"model\": {\n \"model\": \"<string>\",\n \"api_format\": \"<string>\",\n \"preferred_endpoints\": [\n \"<string>\"\n ],\n \"capabilities\": [\n \"<string>\"\n ],\n \"quality_score\": 123,\n \"pricing\": {\n \"currency\": \"<string>\",\n \"prompt_per_1m\": 1,\n \"completion_per_1m\": 1,\n \"cache_read_per_1m\": 1,\n \"cache_write_per_1m\": 1\n },\n \"external_model_ids\": {},\n \"access_key\": \"<string>\",\n \"reasoning_family\": \"<string>\",\n \"reasoning_effort\": \"<string>\",\n \"max_tokens\": 123,\n \"is_default\": false,\n \"raw\": {}\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"role_bindings\": [\n {\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"description\": \"<string>\",\n \"subjects\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"Group\"\n }\n ]\n }\n ],\n \"vllm_endpoints\": [\n {\n \"name\": \"<string>\",\n \"type\": \"openai\",\n \"address\": \"\",\n \"port\": 123,\n \"protocol\": \"<string>\",\n \"api_key\": \"<string>\",\n \"provider_profile\": \"<string>\",\n \"base_url\": \"<string>\",\n \"extra_headers\": {},\n \"default_max_tokens\": 123,\n \"prompt_caching\": true,\n \"stream_upstream\": true,\n \"token_exchange\": \"<string>\",\n \"token_exchange_audience\": \"<string>\",\n \"weight\": 123,\n \"models\": [\n \"<string>\"\n ],\n \"raw\": {}\n }\n ],\n \"keyword_rules\": [\n {}\n ],\n \"jailbreak\": [\n {}\n ],\n \"pii\": [\n {}\n ],\n \"default_model\": \"<string>\",\n \"default_reasoning_effort\": \"<string>\",\n \"strategy\": \"<string>\",\n \"force_routing\": true,\n \"clear_route_cache\": true,\n \"router_replay\": {\n \"store_backend\": \"memory\",\n \"ttl_seconds\": 2592000,\n \"async_writes\": true\n },\n \"tools\": {\n \"enabled\": true,\n \"embedding\": {\n \"endpoint\": \"<string>\",\n \"model\": \"<string>\",\n \"timeout_seconds\": 20\n }\n },\n \"semantic_cache\": {\n \"enabled\": false,\n \"backend_type\": \"memory\",\n \"similarity_threshold\": 0.8,\n \"ttl_seconds\": 3600,\n \"max_entries\": 1000\n },\n \"extras\": {}\n },\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
Body
application/json
Was this page helpful?

