kilnDOCS

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.

Pre-launch. The API and the token are not live yet. Endpoints, prices and tiers on this page are the planned spec and may change before launch.

Quickstart 01

If your code already uses the OpenAI SDK, change two things: the base URL and the key.

PYTHON
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)
TYPESCRIPT
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.

HEADER
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
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 idProviderContext$ / 1M in · out
claude-opus-5.5Anthropic1M4 · 20
claude-sonnet-5.5Anthropic1M2 · 10
gpt-5.5OpenAI1.05M5 · 30
gpt-5.6-solOpenAI1.05M2 · 10
gemini-3.1-proGoogle1M2 · 12
grok-4.7xAI500K2 · 6
deepseek-v4-proDeepSeek1M0.41 · 0.82
kimi-k3Moonshot1M0.73 · 10

Short aliases always point at the newest model of a family: claude-sonnet, claude-opus, gpt, gemini, grok, deepseek, kimi.

Errors 06

CodeMeaning
401Missing, invalid or revoked key.
402Not enough credits. Top up in the app.
404Unknown model id.
429Rate limit hit. Retry after the retry-after header.
502The 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 for the tokens it used at the price in the model list, which is the provider rate plus a 20% Kiln margin. 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 sizeBonus$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. It destroys the tokens through the SPL token program, so they are gone from the supply for good. The burn is valued at the lower of the current price and its average over the last few hours, so a short price spike can't inflate credits. Bonus credits are capped at $50 per wallet per day; anything above the cap is still credited at full value, just without the bonus.

Paying in USDC 10

USDC tops up your balance one to one. Half of every USDC top-up pays the model providers. The other half is set aside to market-buy $KILN and burn it, so paying in USDC still shrinks the supply. Buybacks are batched and each one is posted with its on-chain transaction.