Skip to main content

API Reference

The LLM Gateway provides two API formats: OpenAI-compatible and Anthropic-compatible.

Base URL

https://llm.bankr.bot

Authentication

All requests require a Bankr API key (bk_...) in the X-API-Key header or Authorization: Bearer token:

X-API-Key: bk_YOUR_API_KEY

or

Authorization: Bearer bk_YOUR_API_KEY

Generate API keys at bankr.bot/api. Access is currently limited to beta testers.


OpenAI-Compatible API

Chat Completions

POST /v1/chat/completions

Create a chat completion using OpenAI format.

Request

curl -X POST https://llm.bankr.bot/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: bk_YOUR_API_KEY" \
-d '{
"model": "claude-opus-4.6",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 1024
}'

Response

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1706123456,
"model": "claude-opus-4.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}

List Models

GET /v1/models

List available models.

Response

{
"object": "list",
"data": [
{"id": "claude-opus-4.6", "object": "model", "owned_by": "anthropic"},
{"id": "claude-opus-4.5", "object": "model", "owned_by": "anthropic"},
{"id": "claude-sonnet-4.5", "object": "model", "owned_by": "anthropic"},
{"id": "claude-haiku-4.5", "object": "model", "owned_by": "anthropic"},
{"id": "gemini-3-pro", "object": "model", "owned_by": "google"},
{"id": "gemini-3-flash", "object": "model", "owned_by": "google"},
{"id": "gemini-2.5-pro", "object": "model", "owned_by": "google"},
{"id": "gemini-2.5-flash", "object": "model", "owned_by": "google"},
{"id": "gpt-5.2", "object": "model", "owned_by": "openai"},
{"id": "gpt-5-mini", "object": "model", "owned_by": "openai"},
{"id": "gpt-5-nano", "object": "model", "owned_by": "openai"},
{"id": "gpt-5.2-codex", "object": "model", "owned_by": "openai"},
{"id": "kimi-k2.5", "object": "model", "owned_by": "moonshotai"},
{"id": "qwen3-coder", "object": "model", "owned_by": "qwen"}
]
}

Anthropic-Compatible API

Messages

POST /v1/messages

Create a message using Anthropic format. Ideal for Claude Code and Anthropic SDK users.

Request

curl -X POST https://llm.bankr.bot/v1/messages \
-H "Content-Type: application/json" \
-H "X-API-Key: bk_YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-4.6",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'

Response

{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"model": "claude-opus-4.6",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 12
}
}

Health Check

GET /health

Check gateway and provider health. No authentication required.

Response

{
"status": "ok",
"providers": {
"vertexGemini": true,
"vertexClaude": true,
"openrouter": true
}
}

Status codes:

  • 200 — At least one provider healthy
  • 503 — All providers unavailable

Error Responses

401 Unauthorized

{
"error": {
"message": "Unauthorized",
"type": "auth_error"
}
}

429 Rate Limited

{
"error": {
"message": "Too many requests, please try again later.",
"type": "rate_limit_error"
}
}

500 Server Error

{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}

Usage

Get Usage Summary

GET /v1/usage?days=30

Returns aggregated token usage and cost breakdown for the authenticated API key. Requires authentication.

Query Parameters

ParameterTypeDefaultDescription
daysnumber30Number of days to aggregate (1–90)

Response

{
"object": "usage_summary",
"days": 30,
"startDate": "2026-01-07T00:00:00.000Z",
"endDate": "2026-02-06T00:00:00.000Z",
"totalRequests": 142,
"totalInputTokens": 58320,
"totalOutputTokens": 24100,
"totalCost": 1.23,
"byModel": [
{
"model": "claude-opus-4.6",
"requests": 80,
"inputTokens": 32000,
"outputTokens": 14000,
"totalCost": 0.72
}
]
}

Streaming

Both endpoints support streaming responses:

curl -X POST https://llm.bankr.bot/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: bk_YOUR_API_KEY" \
-d '{
"model": "claude-opus-4.6",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'

Streaming uses Server-Sent Events (SSE) format.