OpenAI-compatible API with automatic load balancing and health monitoring
All API requests (except /health) require authentication using an API key. Include your API key in the Authorization header:
Authorization: Bearer your-api-key-herehttps://vibeapi.vipCheck the health status of all backend servers
/healthcurl https://vibeapi.vip/health{
"servers": [
{
"url": "https://backend1.example.com",
"healthy": true,
"lastCheck": 1777874496223,
"responseTime": 1833,
"consecutiveFailures": 0
},
{
"url": "https://backend2.example.com",
"healthy": true,
"lastCheck": 1777874496222,
"responseTime": 1831,
"consecutiveFailures": 0
}
],
"totalServers": 2,
"healthyServers": 2,
"lastUpdate": 1777874496223
}Get a list of available AI models
/v1/modelscurl https://vibeapi.vip/v1/models \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json"{
"object": "list",
"data": [
{
"id": "claude-sonnet-4.5",
"object": "model",
"created": 1777874512,
"owned_by": "anthropic",
"description": "Claude model via Kiro API"
},
{
"id": "claude-haiku-4.5",
"object": "model",
"created": 1777874512,
"owned_by": "anthropic",
"description": "Claude model via Kiro API"
}
]
}Create a chat completion with AI models
/v1/chat/completionscurl -X POST https://vibeapi.vip/v1/chat/completions \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4.5",
"messages": [
{"role": "user", "content": "Hello!"}
],
"max_tokens": 100
}'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1777874512,
"model": "claude-sonnet-4.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 20,
"total_tokens": 30
}
}⚠️ Currently not supported through load balancer. Use backend URLs directly for streaming.
/v1/chat/completions# Streaming through load balancer is not currently supported
# Use backend URL directly for streaming:
curl -N -X POST https://kiro-gateway-production-07e4.up.railway.app/v1/chat/completions \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4.5",
"messages": [
{"role": "user", "content": "Tell me a story"}
],
"stream": true,
"max_tokens": 200
}'data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1777874512,"model":"claude-sonnet-4.5","choices":[{"index":0,"delta":{"role":"assistant","content":"Once"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1777874512,"model":"claude-sonnet-4.5","choices":[{"index":0,"delta":{"content":" upon"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1777874512,"model":"claude-sonnet-4.5","choices":[{"index":0,"delta":{"content":" a"},"finish_reason":null}]}
data: [DONE]Due to Vercel Serverless Functions limitations, streaming responses (stream: true) are not currently supported through the load balancer.
Workaround: For streaming responses, use the backend URLs directly:
https://kiro-gateway-production-07e4.up.railway.app/v1https://kiro-gateway-kiroaccount-pool-a.up.railway.app/v1Note: Using backend URLs directly bypasses load balancing and automatic failover features.
from openai import OpenAI
client = OpenAI(
api_key="your-api-key-here",
base_url="https://vibeapi.vip/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-4.5",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'your-api-key-here',
baseURL: 'https://vibeapi.vip/v1',
});
const response = await client.chat.completions.create({
model: 'claude-sonnet-4.5',
messages: [
{ role: 'user', content: 'Hello!' }
],
});
console.log(response.choices[0].message.content);| Status Code | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing API key |
| 503 | Service Unavailable | No healthy backend servers available |
| 500 | Internal Server Error | Failed to forward request to backend |