REST API
v1
Direct HTTP access to routing, policies, traces, and cache controls.
Base URL & auth
https://api.skyaiapp.com/v1Authorization: Bearer SKYAIAPP_API_KEY
Content-Type: application/jsonPOST /route
Route a request across model pools and return output + trace.
curl https://api.skyaiapp.com/v1/route \
-H "Authorization: Bearer $SKYAIAPP_API_KEY" \
-d '{
"goal": "cost",
"strategy": "balanced",
"messages": [
{"role": "user", "content": "Summarize this document..."}
],
"metadata": {"tenant_id": "acme", "locale": "en-US"}
}'// 200 OK
{
"output": "...",
"primary_model": "claude-sonnet-4.6",
"fallback_model": "gpt-5.5",
"cache_hit": false,
"trace_id": "trc_9f3c..."
}GET /policies
curl https://api.skyaiapp.com/v1/policies \
-H "Authorization: Bearer $SKYAIAPP_API_KEY"// 200 OK
[
{"id":"pol_latest","name":"Production","created_at":"2025-12-01T...Z"},
{"id":"pol_2025_11_10","name":"Staging","created_at":"2025-11-10T...Z"}
]GET /traces/{id}
curl https://api.skyaiapp.com/v1/traces/trc_9f3c... \
-H "Authorization: Bearer $SKYAIAPP_API_KEY"// 200 OK (abridged)
{
"id": "trc_9f3c...",
"policy_id": "pol_latest",
"spans": [
{"type":"model","model":"claude-sonnet-4.6","latency_ms":820,"tokens":913},
{"type":"cache","hit":false},
{"type":"fallback","used":false}
],
"cost_usd": 0.0032
}Rate limits & errors
Errors use a stable shape to make client handling consistent:
// 429 / 400 / 500
{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"request_id": "req_..."
}
}For production traffic, prefer SDKs for built-in retries and streaming.