Docs
Authentication
Kunavo authenticates exactly like OpenAI: a single bearer token in the Authorization header. The only change from a typical OpenAI integration is the base URL.
Every API call goes to https://api.kunavo.com/v1 with Authorization: Bearer sk-kn-XXX. That's it.
Base URL
The single endpoint that fronts every model, every modality.
| Field | Value |
|---|---|
| Base URL | https://api. |
| Region | US (Ashburn) primary, multi-region edge fronting |
| TLS | TLS 1.2+ enforced. HTTPS only. |
The path layout follows OpenAI's conventions:
| Modality | Path |
|---|---|
| Chat | POST /v1/ |
| List models | GET /v1/models |
| Image generation | POST /v1/ |
| Image edit / i2i | POST /v1/ |
| Video generation | POST /v1/ |
| TTS | POST /v1/ |
| Music | POST /v1/ |
API keys
API keys are issued from /app/keys in the dashboard. Each key:
- Starts with
sk-kn-followed by 30+ random characters. - Is shown once at creation — Kunavo only stores a hash afterwards.
- Has a human-readable name (e.g.
prod-web) for the dashboard. - Can be revoked at any time — the key 401s instantly after revocation.
- Can carry its own monthly spend limit and IP allowlist, both set from
/app/keysand both enforced on every call.
Per-key spend limits (optional)
For each key you can set a monthly spend limit in dollars. Once that key's settled usage for the current calendar month would pass the limit, calls made with it return 402 insufficient_quota and nothing is charged, until the limit resets at month start. Your other keys are unaffected — this is a ceiling on one credential, not on the account.
That is the containment an unattended agent actually needs: the wallet balance is shared by every key, so on its own it cannot stop one runaway loop from spending everything. Give the agent its own key with a limit sized to the job, and the worst case is bounded by that number. A limit of $0 pauses a key without revoking it.
Kunavo decides whether to admit a call on its count of the key's spend. That count can be up to a minute old and leaves out what running calls hold, so near the limit a call can be admitted past it by as much as was charged to the key in the last minute, and calls that run at the same time can together pass the limit. A call is also admitted on an estimate of its cost, and what it is finally charged can be more than that estimate.
GET /v1/balance, called with a key, returns the limit of that key, what the key has spent in the current month and how much of the limit is left. It also returns the account's wallet, which every key of the account can read, a key with a limit included. See Balance.
Per-key IP allowlist (optional)
A key can also be restricted to a set of addresses. Enter one IPv4/IPv6 address or CIDR block per line (203.0.113.7, 198.51.100.0/24, 2001:db8::/32); calls presenting that key from anywhere else are refused with 403 permission_error, on every endpoint including /v1/models. Leave it blank to allow any address.
X-Forwarded-For. The flip side: a key with an allowlist stops working the moment its caller moves to a new host, NAT gateway, or network. Pin allowlists to servers with stable egress, not to laptops.Request headers
A minimal request carries these two headers:
Authorization: Bearer sk-kn-...
Content-Type: application/jsonEvery endpoint also reads the key from an x-api-key header in place of Authorization — the header the Anthropic SDKs send — so a client built for Anthropic's API reaches every route, /v1/models included, without a custom header. If a request carries both, Authorization is the one read. The key's spend limit and IP allowlist apply whichever header it arrives in.
Optional but recommended: User-Agent identifying your app. We log user-agents in your /app/usage dashboard for debugging request sources.
Using the OpenAI SDK
Most teams stay on the official OpenAI SDK and just swap base_url. Both Python (v1.x+) and Node (v4.x+) work this way.
Python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["KUNAVO_API_KEY"],
base_url="https://api.kunavo.com/v1",
)Node.js
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.KUNAVO_API_KEY,
baseURL: "https://api.kunavo.com/v1",
});baseURL in Node and base_url in Python. Both point to the same endpoint.Key rotation
Best practice: rotate API keys quarterly or whenever a key may have leaked. Kunavo lets you have multiple keys per account simultaneously, so rotation is a clean overlap, not a flip.
# 1. Create a new key in /app/keys, set its name to e.g. "prod-2026-Q2"
# 2. Deploy new key to your servers
# 3. Verify traffic is flowing on the new key (dashboard shows usage)
# 4. Revoke the old key from /app/keys → it 401s immediately
# In code, swap one env var:
export KUNAVO_API_KEY="sk-kn-new-..."Security notes
- Never expose keys client-side. Browser code and mobile bundles are public. Always proxy through your server.
- Scope keys narrowly. Different keys per project let you revoke without affecting other workloads — and let each one carry its own spend limit and IP allowlist, so a leaked key is bounded in both cost and origin.
- Watch the dashboard. The
/app/usagepage shows traffic broken down by key — unexpected activity is easier to spot. - Report suspected leaks. Email support@kunavo.com and we'll help with key invalidation and incident review.