Use KernelFold from anything
One API key reaches the whole fleet through two compatible surfaces: an OpenAI-style Chat Completions API and an Anthropic-style Messages API. That means Claude Code, Codex, Cursor, and any OpenAI or Anthropic SDK work out of the box.
Quick start
- Create an account (free, no credit card).
- Generate a key under API keys — pick the
chatscope for coding agents (least privilege). - Point your tool at the gateway. First request:
curl https://api.kernelfold.com/v1/chat/completions \
-H "Authorization: Bearer $KERNELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kernelfold-ultra",
"messages": [{ "role": "user", "content": "Explain CRDTs in one paragraph." }]
}'All examples use https://api.kernelfold.com — the dedicated API host. It serves the same gateway as www.kernelfold.com/api but without the CDN edge in front, so long-running requests (deep kernelfold-ultra runs, big agentic turns) are never cut off by an edge timeout. The /api path keeps working, but the API host is the recommended base URL for all programmatic use.
Authentication
Keys look like sk_kernelfold_… and are shown once at creation. Send them either way — both are equivalent:
Authorization: Bearer sk_kernelfold_…— OpenAI SDKs, Codex, Claude Code'sANTHROPIC_AUTH_TOKENx-api-key: sk_kernelfold_…— Anthropic SDK default
Scopes: full (everything), chat (completions only — recommended for coding agents), read (dashboard data only). Treat keys like passwords; revoke instantly from settings.
Models
Three kinds of model names. The KernelFold chat tiers (kernelfold / kernelfold-ultra) run the multi-agent pipeline (plan → parallel workers → verify → synthesize) — best answer quality for research, design, and analysis. The KernelFold coding tiers (kernelfold-code / kernelfold-code-pro) are for Claude Code, Codex, and other coding agents — see the Claude Code and Codex sections below. The fleet models are direct passthroughs with tool-calling — pin a specific model when you want full control. Every fleet model fails over automatically if it errors mid-request.
| Model | Model ID | Provider | Tier | Context | Best for |
|---|---|---|---|---|---|
| kernelfold-ultra | kernelfold-ultra | KernelFold | Ensemble | 1M | Hardest questions — full multi-agent pipeline |
| kernelfold | kernelfold | KernelFold | Ensemble | 1M | Interactive chat — latency-tuned pipeline |
| kernelfold-code | kernelfold-code | KernelFold | Coding | 200K | Direct routing — one model, fastest coding |
| kernelfold-code-pro | kernelfold-code-pro | KernelFold | Coding | 200K | Thinker→Worker→Verifier — expert + verified |
| Claude Fable 5 | claude-fable-5 | Anthropic | Frontier | 200K | Anthropic's Mythos-class flagship — the sharpest reasoner in the fleet |
| GPT-5.6 Sol | gpt-5.6-sol | OpenAI | Frontier | 400K | OpenAI's frontier lane — elite reasoning & agentic coding |
| Claude Opus 4.8 | claude-opus-4-8 | Anthropic | Frontier | 1M | Deep reasoning, verification & vision at million-token context |
| GPT-5.6 | euro.gpt-5.6 | OpenAI | Frontier | 400K | Frontier reasoning with native tool use |
| Claude Opus 4.7 | claude-opus-4-7 | Anthropic | Frontier | 1M | Long-form writing & careful analysis |
| Claude Sonnet 5 | claude-sonnet-5 | Anthropic | Strong | 200K | The Claude 5 workhorse — frontier-family quality, everyday speed |
| Claude Opus 4.6 | claude-opus-4-6 | Anthropic | Strong | 1M | Independent second-opinion reviews |
| DeepSeek V4 Pro | deepseek-v4-pro | DeepSeek | Strong | 128K | Deep technical reasoning at great value |
| Kimi K2.7 Code | kimi-k2p7-code | Moonshot AI | Strong | 256K | The fleet's top dedicated coder |
| GLM 5.2 | glm-5.2 | Z.ai | Strong | 1M | General work at million-token context, great value |
| Qwen 3.7 Plus | qwen3p7-plus | Qwen | Balanced | 128K | Snappy reasoning for everyday tasks |
| GPT-5.6 Luna | gpt-5.6-luna | OpenAI | Balanced | 400K | Balanced drafting & summaries |
| MiniMax M3 | minimax-m3 | MiniMax | Balanced | 200K | Fast, capable generalist |
| Kimi K2.6 | kimi-k2p6 | Moonshot AI | Balanced | 262K | Quick general-purpose chat |
| DeepSeek V4 Flash | deepseek-v4-flash | DeepSeek | Fast | 128K | Lightning-fast lightweight tasks |
Programmatic listing: GET /v1/models (no auth required).
Chat Completions API (OpenAI-compatible)
POST /v1/chat/completions — a drop-in replacement for the OpenAI endpoint: streaming, tool calling, and the standard request/response shapes.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.kernelfold.com/v1",
apiKey: process.env.KERNELFOLD_API_KEY, // sk_kernelfold_…
});
const res = await client.chat.completions.create({
model: "kernelfold-ultra", // or any fleet model, e.g. "kimi-k2p7-code"
messages: [{ role: "user", content: "Explain CRDTs in one paragraph." }],
stream: true,
});
for await (const chunk of res) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}from openai import OpenAI
client = OpenAI(
base_url="https://api.kernelfold.com/v1",
api_key=os.environ["KERNELFOLD_API_KEY"], # sk_kernelfold_…
)
res = client.chat.completions.create(
model="kernelfold-ultra",
messages=[{"role": "user", "content": "Explain CRDTs in one paragraph."}],
)
print(res.choices[0].message.content)Tool calling works with any concrete fleet model — the full tools / tool_calls / role: "tool" loop:
const res = await client.chat.completions.create({
model: "kimi-k2p7-code", // concrete models support tool calling
messages: [{ role: "user", content: "What's the weather in Paris?" }],
tools: [{
type: "function",
function: {
name: "get_weather",
description: "Get current weather for a city",
parameters: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"],
},
},
}],
});
// res.choices[0].message.tool_calls → [{ function: { name: "get_weather", … } }]Messages API (Anthropic-compatible)
POST /v1/messages speaks the Anthropic Messages format — system prompts, content blocks, tool_use / tool_result, base64 image blocks (routed to vision-capable models automatically), and the Anthropic SSE streaming events. Any Anthropic SDK works by overriding the base URL.
curl https://api.kernelfold.com/v1/messages \
-H "x-api-key: $KERNELFOLD_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "kernelfold-code",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello!" }]
}'POST /v1/messages/count_tokens is also available (estimate).
Claude Code
Claude Code talks the Messages API, so it plugs straight into KernelFold. Two environment variables:
export ANTHROPIC_BASE_URL="https://api.kernelfold.com"
export ANTHROPIC_AUTH_TOKEN="sk_kernelfold_your_key_here"
export ANTHROPIC_MODEL="kernelfold-code"
claude # start Claude Code as usualOr make it permanent in your Claude Code settings file:
// ~/.claude/settings.json
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"ANTHROPIC_BASE_URL": "https://api.kernelfold.com",
"ANTHROPIC_AUTH_TOKEN": "sk_kernelfold_your_key_here",
"ANTHROPIC_MODEL": "kernelfold-code"
}
}Prefer ANTHROPIC_AUTH_TOKEN (sends the key as Authorization: Bearerand skips Claude Code's one-time "use this API key?" approval prompt). ANTHROPIC_API_KEY also works — it sends the same key as x-api-key, but Claude Code will ask you to approve the key on first use; if you ever answered No to that prompt, Claude Code keeps demanding /loginuntil the key's entry is removed from ~/.claude.json under customApiKeyResponses.rejected. The gateway accepts either header.
- kernelfold-code — the default coding alias. Pure routing: one strong model (Claude Fable 5 via euromodels, with GPT-5.6 via your ChatGPT membership as failover) handles each turn directly. No AI review, no prompt modification, no identity injection — the model sees your exact prompt and answers with its full native quality. Fastest path. Use this for everyday coding.
- kernelfold-code-pro — the expert+verified coding alias. A Sakana Fugu-style 3-role system: a Thinker (GPT-5.6) plans the approach once per task, a Worker(Claude Fable 5) builds across the tool loop, and a Verifier(GPT-5.6) checks the actual results at completion checkpoints. One repair cycle if the Verifier finds blocking issues. The final answer is buffered until verification passes. Each role uses a different provider for diversity (a euromodels outage doesn't kill both Worker and Verifier). Use this for complex builds that benefit from plan + verify.
- You can also pin a specific fleet model (e.g.
claude-fable-5,kimi-k2p7-code) for full control — every fleet model has native tool support and automatic failover. - Use a
chat-scoped key — Claude Code never needs dashboard access. - Images work: pasted screenshots and image files (including ones returned by tools) are routed to vision-capable models automatically. Only embedded images are read — remote image URLs are never fetched.
- If a model has an outage mid-session, the gateway fails over to the next-best model automatically; your session keeps going.
Codex CLI
Codex supports custom OpenAI-compatible providers. Add KernelFold to ~/.codex/config.toml:
# ~/.codex/config.toml
model = "kernelfold-code"
model_provider = "kernelfold"
[model_providers.kernelfold]
name = "KernelFold AI"
base_url = "https://api.kernelfold.com/v1"
env_key = "KERNELFOLD_API_KEY" # Codex reads the key from this env varThen export your key and run:
export KERNELFOLD_API_KEY="sk_kernelfold_your_key_here"
codex # interactive
codex exec "fix the failing test" # non-interactivekernelfold-code is the recommended profile for Codex: pure routing — one strong model per turn, direct call, no AI review. For complex builds that benefit from plan + verify, use kernelfold-code-pro(the Thinker→Worker→Verifier 3-role system). If you'd rather pin one model: gpt-5.6-sol (frontier coder, via your ChatGPT membership) or kimi-k2p7-code (code specialist).
Cursor & other OpenAI-compatible tools
Anything with an "OpenAI-compatible" or "custom base URL" option works the same way:
Base URL: https://api.kernelfold.com/v1
API key: sk_kernelfold_your_key_here
Model: kernelfold-code (or kernelfold-code-pro for verified builds)For plain chat use the kernelfold-ultra tier (the ensemble answers); for agentic/tool-heavy workflows use kernelfold-codex-ultra (the coding profile with automatic failover) or pin a concrete fleet model.
Plans & tokens
Usage is measured in tokens— the same units the models bill in. Your plan grants a monthly pool shared across every model and the API: a quick chat spends a few thousand tokens, a deep multi-agent run a few hundred thousand. Every plan's allowance resets monthly, unused tokens don't roll over, and when you run out, requests return 402 until the reset (or an upgrade).
| Plan | Price | Tokens / month |
|---|---|---|
| Free | Free | 1.5M |
| Pro | $19/mo | 80M |
| Max | $49/mo | 180M |
Manage your plan, balance, and invoices on the billing page. API keys share the account's token balance.
Rate limits & errors
429 RateLimited— request burst limit (per key). Back off and retry.429 QuotaExceeded— daily request quota reached; resets over the next 24 hours.402 PaymentRequired— out of credits for this period. OpenAI-compatible endpoints return{"error":{"type":"insufficient_quota"}}; the Messages API returns{"error":{"type":"billing_error"}}.401— missing/revoked key ·403— key lacks the required scope.502 / 529— upstream model error after all failovers were exhausted (rare; check status).
Every request is visible in your dashboard — tokens, cost, latency, and the models that served it.