Routing Rules
API reference for Routing Rules
List routing rules
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Query Parameters
Include disabled rules (default: false)
Filter by scope type
"all" | "user" | "org" | "workspace" | "api_key"Filter routing rules by workspace ID. Omit to list all accessible rules; when set, account-wide rules (workspace_id null) are also included.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidResponse Body
application/json
curl -X GET "https://api.eurouter.ai/api/v1/routing-rules"{
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"user_id": "string",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"api_key_id": "b0dd218e-3bcf-4bdb-a1e3-0689d60a8afd",
"model": "string",
"models": [
"string"
],
"provider": {
"order": [
"string"
],
"ignore": [
"string"
],
"only": [
"string"
],
"allow_fallbacks": true,
"sort": "price",
"require_parameters": true,
"quantizations": [
"int4"
],
"data_collection": "allow",
"data_residency": "string",
"max_retention_days": 0,
"eu_owned": true
},
"enabled": true,
"created_at": "string",
"updated_at": "string"
}
]
}Create routing rule
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.eurouter.ai/api/v1/routing-rules" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"user_id": "string",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"api_key_id": "b0dd218e-3bcf-4bdb-a1e3-0689d60a8afd",
"model": "string",
"models": [
"string"
],
"provider": {
"order": [
"string"
],
"ignore": [
"string"
],
"only": [
"string"
],
"allow_fallbacks": true,
"sort": "price",
"require_parameters": true,
"quantizations": [
"int4"
],
"data_collection": "allow",
"data_residency": "string",
"max_retention_days": 0,
"eu_owned": true
},
"enabled": true,
"created_at": "string",
"updated_at": "string"
}
}Dry-run routing test
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.eurouter.ai/api/v1/routing-rules/dry-run" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"rule_applied": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"effective_preferences": {
"order": [
"string"
],
"ignore": [
"string"
],
"only": [
"string"
],
"allow_fallbacks": true,
"sort": "price",
"require_parameters": true,
"quantizations": [
"int4"
],
"data_collection": "allow",
"data_residency": "string",
"max_retention_days": 0,
"eu_owned": true
},
"results": [
{
"model": "string",
"provider_count": 0,
"providers": [
"string"
]
}
],
"summary": {
"total_models": 0,
"models_with_providers": 0
}
}
}Get EU residency data
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Response Body
application/json
curl -X GET "https://api.eurouter.ai/api/v1/routing-rules/eu-residency"{
"data": {
"eu_countries": [
{
"code": "string",
"name": "string"
}
],
"eea_countries": [
{
"code": "string",
"name": "string"
}
],
"eu_adequate_countries": [
{
"code": "string",
"name": "string"
}
]
}
}Get routing rule
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Path Parameters
Routing rule UUID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidResponse Body
application/json
curl -X GET "https://api.eurouter.ai/api/v1/routing-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"user_id": "string",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"api_key_id": "b0dd218e-3bcf-4bdb-a1e3-0689d60a8afd",
"model": "string",
"models": [
"string"
],
"provider": {
"order": [
"string"
],
"ignore": [
"string"
],
"only": [
"string"
],
"allow_fallbacks": true,
"sort": "price",
"require_parameters": true,
"quantizations": [
"int4"
],
"data_collection": "allow",
"data_residency": "string",
"max_retention_days": 0,
"eu_owned": true
},
"enabled": true,
"created_at": "string",
"updated_at": "string"
}
}Update routing rule
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Path Parameters
Routing rule UUID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PATCH "https://api.eurouter.ai/api/v1/routing-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"user_id": "string",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"api_key_id": "b0dd218e-3bcf-4bdb-a1e3-0689d60a8afd",
"model": "string",
"models": [
"string"
],
"provider": {
"order": [
"string"
],
"ignore": [
"string"
],
"only": [
"string"
],
"allow_fallbacks": true,
"sort": "price",
"require_parameters": true,
"quantizations": [
"int4"
],
"data_collection": "allow",
"data_residency": "string",
"max_retention_days": 0,
"eu_owned": true
},
"enabled": true,
"created_at": "string",
"updated_at": "string"
}
}Delete routing rule
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Path Parameters
Routing rule UUID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidResponse Body
application/json
curl -X DELETE "https://api.eurouter.ai/api/v1/routing-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"data": {
"success": true
}
}