Kiln
docs.
Kiln is an OpenAI-compatible gateway to every major model. One key, one base URL. Top up by burning $KILN for up to 30% more credits, or pay in USDC.
Quickstart 01
If your code already uses the OpenAI SDK, change two things: the base URL and the key.
from openai import OpenAI client = OpenAI( base_url="https://api.kilnai.xyz/v1", api_key="kiln_sk_...", ) r = client.chat.completions.create( model="claude-sonnet", messages=[{"role": "user", "content": "gm"}], ) print(r.choices[0].message.content)
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.kilnai.xyz/v1", apiKey: process.env.KILN_KEY }); const r = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "gm" }] });
Authentication 02
Create keys in the app under API keys. Send the key as a bearer token on every request.
Authorization: Bearer kiln_sk_...
- A key is shown once, when you create it. Store it in an env var, never in client-side code.
- Every key draws from the same credit balance of the wallet that created it.
- Revoke a key at any time. Requests with a revoked key return
401.
Chat completions 03
POST /v1/chat/completions. Same request and response shape as OpenAI. Kiln maps the request to the provider behind the model you name.
curl https://api.kilnai.xyz/v1/chat/completions \ -H "Authorization: Bearer $KILN_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4-pro","messages":[{"role":"user","content":"gm"}]}'
Every response carries two extra headers so you can track spend per request: x-kiln-cost (credits charged, in USD) and x-kiln-balance (credits left).
Streaming 04
Pass "stream": true. Kiln streams server-sent events in the OpenAI format for every model, including the ones whose native API streams differently.
Models 05
GET /v1/models returns the live list. Planned at launch:
| Model id | Provider | Context | $ / 1M in · out |
|---|---|---|---|
claude-opus-5.5 | Anthropic | 1M | 4 · 20 |
claude-sonnet-5.5 | Anthropic | 1M | 2 · 10 |
gpt-5.5 | OpenAI | 1.05M | 5 · 30 |
gpt-5.6-sol | OpenAI | 1.05M | 2 · 10 |
gemini-3.1-pro | 1M | 2 · 12 | |
grok-4.7 | xAI | 500K | 2 · 6 |
deepseek-v4-pro | DeepSeek | 1M | 0.41 · 0.82 |
kimi-k3 | Moonshot | 1M | 0.73 · 10 |
Short aliases always point at the newest model of a family: claude-sonnet, claude-opus, gpt, gemini, grok, deepseek, kimi.
Errors 06
| Code | Meaning |
|---|---|
| 401 | Missing, invalid or revoked key. |
| 402 | Not enough credits. Top up in the app. |
| 404 | Unknown model id. |
| 429 | Rate limit hit. Retry after the retry-after header. |
| 502 | The upstream provider failed. You are not charged. |
Rate limits 07
Limits are per key and scale with your balance. Every response includes x-ratelimit-remaining. If you need more, split traffic across keys or contact us.
How credits work 08
Credits are denominated in USD and prepaid. Each request is charged at the provider's list price for the tokens it used. No subscriptions, no minimums, credits don't expire.
Paying with a burn 09
Burning $KILN credits your balance with the USD value of the burn plus a bonus. The bonus grows with the size of the burn:
| Burn size | Bonus | $100 of $KILN becomes |
|---|---|---|
| Any amount | +20% | $120 credits |
| 50,000+ $KILN | +25% | $125 credits |
| 250,000+ $KILN | +30% | $130 credits |
The burn is a single Solana transaction you sign in your wallet. The tokens go to the incinerator address and are gone for good. The value is priced from the pool at the moment of the burn.
Paying in USDC 10
USDC tops up your balance one to one. Kiln then uses 100% of USDC revenue to market-buy $KILN and burn it, so paying in USDC still shrinks the supply. Every buyback is an on-chain transaction anyone can verify.