Gateway documentation
Build once. Route through Kanonas.
Use one API across OpenAI, xAI, Anthropic, Gemini, Z.AI, and DeepSeek. Kanonas handles cost controls, cache optimization, privacy defaults, and offline evals.
Providers
Supported provider surfaces.
Core endpoint families with their Kanonas URLs.
https://api.kanonas.aiAuthentication
Drop in with your existing SDK.
Swap the base URL and API key. Keep the client code.
Quickstart
Get a key, then use your SDK.
Create a Kanonas API key, set the SDK base URL, and choose the model you want to route through Kanonas.
pip install litellmhttps://api.kanonas.ai/v1from litellm import completion
response = completion(
model="openai/gpt-5.5",
api_base="https://api.kanonas.ai/v1",
api_key="key_your_id.your_secret",
messages=[{"role": "user", "content": "Say ack"}],
max_tokens=64,
)
print(response.choices[0].message.content)npm install openaihttps://api.kanonas.ai/v1import OpenAI from "openai";
const client = new OpenAI({
apiKey: "key_your_id.your_secret",
baseURL: "https://api.kanonas.ai/v1",
});
const response = await client.responses.create({
model: "gpt-5.5",
input: "Say ack",
max_output_tokens: 64,
});
console.log(response.output_text);npm install @anthropic-ai/sdkhttps://api.kanonas.aiimport Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "key_your_id.your_secret",
baseURL: "https://api.kanonas.ai",
});
const message = await client.messages.create({
model: "claude-opus-4-8",
max_tokens: 64,
messages: [{ role: "user", content: "Say ack" }],
});
console.log(message.content[0]?.text);npm install @google/genaihttps://api.kanonas.aiimport { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: "key_your_id.your_secret",
httpOptions: {
baseUrl: "https://api.kanonas.ai",
},
});
const response = await ai.models.generateContent({
model: "gemini-3.6-flash",
contents: "Say ack",
config: { maxOutputTokens: 64 },
});
console.log(response.text);Reference
Complete gateway endpoint map.
Public model requests can authenticate with Kanonas API keys. Account-management routes require signed-in Firebase auth unless noted.
Gateway
/modelsAPI keyModel list alias for clients using the API host.
/v1/modelsAPI keyModels available through platform provider routes.
/v1beta/openai/modelsAPI keyOpenAI beta compatibility alias.
OpenAI-compatible
/v1/responsesAPI key + creditsOpenAI Responses-shaped requests.
/v1/chat/completionsAPI key + creditsOpenAI Chat Completions-shaped requests.
/v1/embeddingsAPI key + creditsOpenAI Embeddings-shaped requests.
/responsesAPI key + creditsBare Responses alias.
/chat/completionsAPI key + creditsBare Chat Completions alias.
/embeddingsAPI key + creditsBare Embeddings alias.
/v1beta/openai/responsesAPI key + creditsOpenAI beta Responses alias.
/v1beta/openai/chat/completionsAPI key + creditsOpenAI beta Chat alias.
xAI-compatible
/v1/responsesAPI key + creditsxAI Grok Responses through the OpenAI-compatible route.
/v1/chat/completionsAPI key + creditsxAI Grok Chat Completions compatibility route.
/v1/modelsAPI keySaved-provider model list including curated xAI text models.
Anthropic-compatible
/v1/messagesAPI key + creditsAnthropic Messages-shaped requests.
/v1/messages/count_tokensAPI keyAnthropic token counting helper.
Z.AI-compatible
/v1/chat/completionsAPI key + creditsGLM chat requests through the OpenAI-compatible route.
/v1/modelsAPI keySaved-provider model list including Z.AI models.
DeepSeek-compatible
/v1/chat/completionsAPI key + creditsDeepSeek V4 chat requests with Kanonas credits.
/v1/responsesAPI key + creditsText-only Responses requests bridged to DeepSeek chat.
/v1/messagesAPI key + creditsAnthropic-shaped text messages routed to DeepSeek.
/v1beta/models/{model}:generateContentAPI key + creditsGemini-shaped text requests routed to DeepSeek.
Gemini-compatible
/models/{model}:generateContentAPI key + creditsGenerate Content alias.
/v1beta/models/{model}:generateContentAPI key + creditsGemini v1beta Generate Content.
/v1/models/{model}:generateContentAPI key + creditsGemini v1 Generate Content.
/models/{model}:streamGenerateContent501Streaming disabled for prepaid accounting.
/v1beta/models/{model}:streamGenerateContent501Streaming disabled for prepaid accounting.
/v1/models/{model}:streamGenerateContent501Streaming disabled for prepaid accounting.
/models/{model}:cachedContentsAPI keyLiteLLM cache lookup alias.
/models/{model}:cachedContentsAPI keyLiteLLM cache setup alias.
/v1beta/models/{model}:cachedContentsAPI keyGemini v1beta cache lookup compatibility.
/v1beta/models/{model}:cachedContentsAPI keyGemini v1beta cache setup compatibility.
/v1/models/{model}:cachedContentsAPI keyGemini v1 cache lookup compatibility.
/v1/models/{model}:cachedContentsAPI keyGemini v1 cache setup compatibility.
/v1beta/cachedContentsAPI keyGemini explicit context cache creation.
/v1beta/cachedContents/{cached_content}API keyRead a cached content resource.
/interactionsAPI key + creditsInteractions alias.
/v1beta/interactionsAPI key + creditsGemini v1beta Interactions.
/v1/interactionsAPI key + creditsGemini v1 Interactions.
/v1beta/interactions/{interaction_id}API keyRead an interaction resource.
/v1beta/interactions/{interaction_id}API keyDelete an interaction resource.
/v1beta/interactions/{interaction_id}/cancelAPI keyCancel an interaction resource.
Portal account routes
/v1/meFirebase or API keyInspect the authenticated account context.
/v1/api-keysFirebaseList Kanonas API key metadata.
/v1/api-keysFirebaseCreate a Kanonas API key.
/v1/api-keys/{key_id}FirebaseRevoke a Kanonas API key.
/v1/projectsFirebaseList projects.
/v1/projectsFirebaseCreate a project.
/v1/projects/{project_id}FirebaseDelete a project and revoke scoped keys.
/v1/projects/{project_id}/usageFirebaseProject usage summary.
/v1/usageFirebaseAccount usage summary.
/v1/usage/summaryFirebaseUsage summary alias.
/v1/audit-eventsFirebaseRecent account audit events for management actions.
/v1/billing/balanceFirebasePrepaid credit balance and funding policy.
Health
/NoneService acknowledgment.
/ackNoneService acknowledgment alias.
/healthNoneHealth check.
/healthzNoneHealth check alias.
Limits
Sparse limits with explicit retry headers.
Kanonas does not use blanket per-user quotas for normal model traffic. Limits apply only to unusual request volume, near-empty prepaid balances, or repeated upstream provider failures.
outrageous_request_volumeFraud-scale request volume Very high account or API-key request counts can be paused briefly to protect accounts from leaked keys and abusive traffic.prepaid_low_balancePrepaid balance is almost exhausted Credit-funded requests may slow down near a zero balance so concurrent jobs do not accidentally overdraw the account.provider_cooldownProvider route is failing repeatedly Provider traffic can be paused for a provider and model after repeated upstream rate-limit or transient failures.
rate_limitedRetryableWait for the Retry-After value before retrying. Responses also include X-Kanonas-RateLimit-Reason, X-Kanonas-RateLimit-Limit, X-Kanonas-RateLimit-Remaining, and sometimes X-Kanonas-RateLimit-Reset.
Managed credits, request overrides.
Leave funding on auto for the default managed-credit behavior. Add the header only when a request must force a supported funding mode.
Billing summaries show current credits and lifetime credit movement for signed-in accounts.
X-Kanonas-Funding: autoUse the default managed-credit behavior.X-Kanonas-Funding: creditsRequire managed billing with prepaid balance.
import os
from litellm import completion
response = completion(
model="openai/gpt-5.5",
api_base="https://api.kanonas.ai/v1",
api_key=os.environ["KANONAS_API_KEY"],
messages=[{"role": "user", "content": "Say ack"}],
extra_headers={"X-Kanonas-Funding": "credits"},
)
print(response.choices[0].message.content)Security
Account-owned keys, account-scoped traces.
Kanonas keeps public integration instructions separate from private account surfaces. Client apps use Kanonas API keys; provider credentials and trace payloads remain server-side. Trace, feedback, usage, and operational data may be retained and used to improve the product as described in the Privacy Policy and Terms.
Managed provider credentialsUpstream platform credentials stay server-side and are never copied into client SDK snippets.Kanonas API keysFull keys are shown once, stored as hashes, and can be revoked from signed-in Settings.Trace accessModel-call payload previews, route decisions, usage, audit events, and feedback stay behind authenticated account access.Audit eventsAccount management actions are logged for signed-in review without storing raw Kanonas API keys, prompts, or responses in audit metadata.Data useKanonas does not offer zero data retention; prompts, outputs, traces, labels, feedback, and usage metadata may be retained and used to operate, secure, evaluate, and improve the product.Public docsCanonical setup guidance is public at /docs; authenticated portal views are marked noindex.
Agent context
Machine-readable docs for LLM agents.
Agents should cite the canonical docs for setup and use the Markdown context files when they need a compact, comprehensive representation of Kanonas.
LLM summary
A compact index of canonical product, docs, API, legal, and discovery URLs.
Open resourceFull LLM context
One comprehensive Markdown file for agents that need setup, endpoints, auth, billing, limits, and traces.
Open resourceHomepage Markdown
Markdown mirror of the public product overview for agents that prefer text extraction.
Open resourceDocs Markdown
Markdown mirror of this documentation page, including security and troubleshooting guidance.
Open resourceTroubleshooting
Fast checks for common gateway responses.
Most integration issues reduce to authentication, funding, provider availability, request shape, rate limits, or upstream provider errors.
missing_api_keyCheckAdd a full Kanonas API key as bearer auth, x-api-key, or x-goog-api-key.
funding_requiredCheckAdd prepaid credits before calling model APIs.
provider_unavailableCheckConfirm the requested provider has managed billing support.
invalid_requestCheckCheck required request fields such as model, messages, input, contents, or max tokens.
rate_limitedCheckRespect Retry-After and inspect X-Kanonas-RateLimit-Reason before retrying.
streaming_not_enabledCheckSend non-streaming prepaid model requests.
upstream_errorCheckCheck provider status, model availability, and the trace for upstream details.
Beta feature
-or-better model policies.
Append -or-better to an existing model name on any model-bearing endpoint. During beta, Kanonas uses the base model and records the policy in Traces as not rerouted.
gpt-5.5-mini-or-betterPassthroughThe request is sent to gpt-5.5-mini today. The trace keeps the original policy so offline evals can label it for future routing decisions.
