Klide AI · Docs
Connect models to your workflow.
Klide AI speaks the Anthropic Messages API. Anything that works with the official API works here once you change two values: the base URL and the API key. You'll find both on your Console page.
- 01Create a key
- 02Pick a protocol
- 03Connect your tool
- 04Verify
Video tutorialSign up, add credit, create a key and chat with any model
Quick start
| Setting | Value |
|---|---|
| Base URL | https://api.klideai.store, shown on your Console page. Anthropic clients use it as is; OpenAI clients add /v1. (Keys from before accounts keep their own address, like https://api.klideai.store/your-route.) |
| API key | Your key from the Console page, sent as x-api-key or Authorization: Bearer. Both work. |
| Endpoint | POST /v1/messages (streaming supported). OpenAI-format apps use POST /v1/chat/completions or POST /v1/responses; see OpenAI SDKs and Cursor and Codex CLI. |
In every snippet on this page, {base_url} means that full address and {api_key} means your key. Replace them with your own values, and never paste a real key into a page, chat or screenshot you share.
Claude DesktopDeveloper Mode → Configure Third-Party Inference
The desktop app ignores environment variables and settings.json. It has its own screen for pointing at a custom API address.
Update Claude Desktop to the latest version, then open it.
Turn on Developer Mode. On macOS use the menu bar. On Windows open the application menu ☰ at the top left of the sign-in screen.
Help → Troubleshooting → Enable Developer Mode
A Developer menu now exists. Open Developer → Configure Third-Party Inference…
Set Inference provider to Gateway, then fill the Gateway credentials card:
Field Enter Gateway base URL {base_url}
No trailing slash and no/v1; the app adds those itself.Gateway API key Your key: {api_key}Credential kind Static API key Gateway auth scheme Bearer or x-api-key. Klide AI accepts both. Leave Models empty. The app asks Klide AI for its list and shows every Claude ID your key can use. To lock it to a few, list full IDs instead, for example
claude-opus-5-5andclaude-sonnet-4-6. Give a[1m]ID thesupports1mflag so the app knows it has the big window.Click Apply Changes. The app relaunches using Klide AI. Start a chat and send a short message to confirm.
Developer menu missing after the relaunch? Repeat step 2. It stays on once re-enabled. If your computer is managed by an employer, a managed profile can open this window read-only or hide it.
VS CodeThe Claude Code extension
Install Claude Code (publisher: Anthropic) from the Extensions panel.
Press Ctrl+Shift+P (Cmd+Shift+P on macOS) and run Preferences: Open User Settings (JSON).
Add this block inside the top-level braces. If the file already has entries, add a comma after the previous one.
"claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "{base_url}" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "{api_key}" } ]Run Developer: Reload Window, open the Claude panel and type
/status. You should see anAnthropic base URLline with your address. If you see a claude.ai login instead, the setting wasn't picked up.
Use User settings, not a workspace .vscode/settings.json. Workspace files get committed and shared, and your key would go with them.
The extension checks claudeCode.environmentVariables before it starts, so this is the reliable place. Values in ~/.claude/settings.json reach the running session but not that sign-in check, which is why a sign-in prompt can appear even though the CLI works.
Claude Code CLIWindows, macOS and Linux · also covers the JetBrains plugin
Option 1: settings file (set once, works everywhere)
Add an env block to ~/.claude/settings.json (on Windows: %USERPROFILE%\.claude\settings.json). It applies to the terminal, VS Code and JetBrains, and needs no restart.
{
"env": {
"ANTHROPIC_BASE_URL": "{base_url}",
"ANTHROPIC_AUTH_TOKEN": "{api_key}"
}
}
The file must be strict JSON: no comments, no trailing commas.
Option 2: environment variables for one session
# macOS / Linux
export ANTHROPIC_BASE_URL="{base_url}"
export ANTHROPIC_AUTH_TOKEN="{api_key}"
claude
# Windows PowerShell
$env:ANTHROPIC_BASE_URL = "{base_url}"
$env:ANTHROPIC_AUTH_TOKEN = "{api_key}"
claude
PowerShell's $env: lasts only for that window. To keep it, use Option 1, or run setx and then open a new terminal (an already-open one never sees it).
Check it worked
Start claude and run /status. You want an Anthropic base URL line and an Auth token line. If it shows a Login method with a claude.ai account instead, run /logout and start again. Use only one credential variable: if you also have ANTHROPIC_API_KEY set, remove it, or you'll see an "Auth conflict" warning.
Codex CLIThe OpenAI terminal agent, running Claude models
Codex speaks the OpenAI Responses API, which Klide AI translates to Claude and back. It also needs a short model list, so it knows Claude can edit files with its patch tool. Without that list, Codex falls back to shell commands for edits, and those fail on Windows.
1. Download the model list
# macOS / Linux
mkdir -p ~/.codex
curl -fsSL -o ~/.codex/klide-models.json https://api.klideai.store/assets/codex-models.json
# Windows PowerShell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex" | Out-Null
Invoke-WebRequest https://api.klideai.store/assets/codex-models.json -OutFile "$env:USERPROFILE\.codex\klide-models.json"
2. Add Klide AI to config.toml
Open ~/.codex/config.toml (on Windows: %USERPROFILE%\.codex\config.toml), creating it if it doesn't exist. Put the first three lines at the very top, above any [section], and write the full path of the file you downloaded. On Windows use forward slashes, like C:/Users/you/.codex/klide-models.json.
model = "claude-sonnet-4-6"
model_provider = "klide"
model_catalog_json = "/Users/you/.codex/klide-models.json"
[model_providers.klide]
name = "Klide AI"
base_url = "{base_url}/v1"
env_key = "KLIDE_API_KEY"
wire_api = "responses"
3. Set your key and start it
# macOS / Linux
export KLIDE_API_KEY="{api_key}"
codex
# Windows PowerShell
$env:KLIDE_API_KEY = "{api_key}"
codex
Switch models with /model: claude-opus-5-5, claude-sonnet-4-6 and claude-haiku-4-5 are on the list. If Codex warns Model metadata … not found, the model_catalog_json path is wrong or the model isn't on the list. Codex's built-in web search only works with OpenAI's own servers, so it is left out here.
API & SDKs
curl
curl {base_url}/v1/messages \
-H "x-api-key: {api_key}" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-4-6", "max_tokens": 512,
"messages": [{"role": "user", "content": "Hello"}]}'
Python and TypeScript
# Python
from anthropic import Anthropic
client = Anthropic(base_url="{base_url}", api_key="{api_key}")
// TypeScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "{base_url}", apiKey: "{api_key}" });
OpenAI SDKs and Cursor OpenAI format
Klide AI also answers the OpenAI Chat Completions format, so apps that only know the OpenAI API can use your key. Requests are translated to the Claude API and back, and you still pick a Claude model by its ID. Two differences from the Claude setup above: the base URL ends in /v1, and the key goes in as an OpenAI key.
# Python
from openai import OpenAI
client = OpenAI(base_url="{base_url}/v1", api_key="{api_key}")
reply = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Hello"}],
)
// TypeScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "{base_url}/v1", apiKey: "{api_key}" });
# curl
curl {base_url}/v1/chat/completions \
-H "Authorization: Bearer {api_key}" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello"}]}'
The newer Responses API works with the same client:
# Python
reply = client.responses.create(model="claude-sonnet-4-6", input="Hello")
print(reply.output_text)
# curl
curl {base_url}/v1/responses \
-H "Authorization: Bearer {api_key}" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-4-6", "input": "Hello"}'
Cursor: open Settings → Models, turn on Override OpenAI Base URL and enter {base_url}/v1. Paste your key into the OpenAI API Key box. Then Add Model, type a Claude ID such as claude-sonnet-4-6, and use Verify. Cursor sends these requests from its own servers, and which of its modes accept a custom model depends on your Cursor version. If it refuses a Claude model name, tell us what it says.
What carries over: text, images, system messages, tool calling, streaming, max_tokens and stop. The Responses API adds PDFs, freeform (custom) tools, previous_response_id, and retrieving or deleting a stored response. Temperature is capped at 1, and top_p is only used when you leave temperature out.
JSON mode (response_format, or text.format in the Responses API) works by instruction: the model is given your schema and told to reply with JSON only. Nothing enforces the schema, so validate what you parse.
Not supported: more than one choice (n), logprobs, embeddings, audio, image generation, built-in tools that run on OpenAI's side (web search, file search, code interpreter), background mode, and the Assistants, Files and Batch APIs.
Prompt caching
Works as on the Anthropic API: add "cache_control": {"type": "ephemeral"} to a system or content block on /v1/messages. Claude Code, Cline and the other Anthropic-format tools already do this for you. When a later request starts with the same text, the repeated part is read from cache and the response says how much in usage.cache_read_input_tokens. In OpenAI format the same number is usage.prompt_tokens_details.cached_tokens.
Caching is best effort: a repeat can miss, so check cache_read_input_tokens rather than assume. It only applies to long, stable prefixes of a few thousand tokens. Put the part that never changes at the start of the prompt and the part that does at the end.
What works and what doesn't
| Client | Status | How |
|---|---|---|
| Anthropic SDKs, Claude Code, Claude Desktop, Cline, Roo, Kilo, Continue, Aider, OpenCode, Zed | Works | They speak the Anthropic Messages API: /v1/messages. |
| OpenAI SDKs, Cursor, other apps with an OpenAI base URL setting | Works | Chat Completions: /v1/chat/completions, with a base URL ending in /v1. |
Codex CLI, OpenAI SDKs' client.responses | Works | Responses API: /v1/responses. Codex also needs the model list; see Codex CLI. |
Autocomplete tools and libraries on OpenAI's older Completions API (LangChain's OpenAI LLM, Tabby, Twinny) | Works | /v1/completions. The prompt is sent as one message; suffix (fill-in-the-middle) is ignored. |
| Browser apps (TypingMind, LobeChat, BetterChatGPT, the SDKs' browser mode) | Works | Cross-origin requests are allowed. Your key is visible to anyone using that browser, so use a key you can disable. |
| Embeddings, audio, image generation, Assistants API | Not supported | Klide AI serves Claude chat models only. |
Models
The full list, with copy buttons, is on the home page. To get the exact list your key can use, ask the API:
curl {base_url}/v1/models -H "x-api-key: {api_key}"
- Pick an ID, don't type a nickname.
sonnetoropusalone won't resolve. Use a full ID such asclaude-sonnet-4-6. - Only IDs on the list work. Anything else, including a spelling variant, is refused with a
404. Opus 5.5 is listed both ways:claude-opus-5-5andclaude-opus-5.5are the same model. [1m]means a 1M-token context window. Quote it in the shell:"claude-opus-5-5[1m]".- Dated IDs are snapshots.
claude-haiku-4-5-20251001never changes;claude-haiku-4-5follows the latest. - Older generations (3.x, 4.0, 4.1) are listed for compatibility. New work should use the newer IDs.
Limits & usage
| Limit | Typical value | When you hit it |
|---|---|---|
| Requests per minute | 120 per key | 429 with a retry-after of 60 seconds. |
| Token balance | Whatever you bought | Requests are refused until you top up. It never expires. |
| One request's length | Up to 15 minutes | 504. Long agent turns fit; a hung one is cut off. |
These are the defaults; your key may be set differently. The 429 message names the exact limit you reached. Need more? Ask on Telegram. One key shared across devices or teammates shares one balance and one rate limit.
Open Console, paste your base URL and API key, and you'll see your remaining balance, requests and tokens over the last 24 hours, latency, and a per-model breakdown. Input and output tokens both count against your balance.
Privacy & securityWhat we keep, and what we don't
Your data is never stored by Klide AI. Your prompts, files and model replies pass through the gateway and are not saved.
One exception, for the OpenAI Responses API only: a request sent with store left on (the API's default) is held in memory for up to an hour, so a follow-up can continue it with previous_response_id. It is never written to disk, only the key that made it can read it, and you can delete it early. Send "store": false to skip this. Codex CLI already does.
| Klide AI never stores | Klide AI keeps, so your dashboard works |
|---|---|
| Prompts and system messages Replies and tool output Code, files and attachments | Time of each request HTTP status and latency A hashed ID of the key that made it |
- Your keys are encrypted at rest. Only you can see them, on your Account page after signing in.
- Your key stays private. It is never shown to anyone else.
- All traffic is HTTPS.
- Signing in keeps you signed in for 30 days on that browser. Press Sign out on a shared computer.
Keep your key secret like a password: don't commit it, don't paste it in screenshots, and never put it in a shared .vscode/settings.json or .claude/settings.json. If it leaks, message us and we'll disable it.
Troubleshooting
| You see | Cause | Fix |
|---|---|---|
401 Missing API key / Invalid API key | Key mistyped, has a space, or your tool never sent it. | Copy it again with no spaces. Run /status in Claude Code to check the credential is active. |
403 "This key doesn't work on this route" | The route in your base URL is mistyped, or belongs to a different key. | Use the base URL the error names, or the one that came with the key. Check the pair on Console. |
403 key disabled | The key was turned off. | Message support. |
404 Model "…" isn't available | Model ID is misspelled or isn't on the list. | Copy an ID from the model list. |
429 Too many requests | You sent too many requests in a minute. | Wait for the retry-after seconds, then retry. See Limits. |
400 naming context_management or "Extra inputs are not permitted" | The tool sent a pre-release field the model doesn't accept. | Set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 (put it in the env block next to the others). |
502 / 504 / 5xx | The model service is busy or a request ran too long. | Retry in a few seconds. If it continues, message support. |
| Still asks you to sign in to Anthropic | The base URL or key never reached the tool. | Claude Code: run /logout, then /status. VS Code: use claudeCode.environmentVariables and reload the window. Desktop: use the Developer menu, not env vars. |
| "Auth conflict" warning | Two credentials are set, such as ANTHROPIC_API_KEY and a login or token. | Keep only ANTHROPIC_AUTH_TOKEN. |
| Variables set but a new terminal doesn't see them | $env: only lasts for that window; setx only affects terminals opened afterward. | Use the settings.json env block instead. |
| VS Code ignores variables from your shell | VS Code was started from the dock or Start menu, not your shell. | Launch with code . from a terminal, or use claudeCode.environmentVariables. |
| Certificate errors at work or on a VPN | A proxy is inspecting HTTPS traffic. | Point NODE_EXTRA_CA_CERTS at your company's CA file, or try another network. |
| Account says the URL and key don't match | Mixed-up pair. | Copy both again from the message you received with the key. |
| Account shows no balance | Balance isn't available for that key yet. | Your requests still work. Ask us if it persists. |
FAQ
Getting started
What is Klide AI?
A Claude-compatible API. You get one base URL and one key that work with Claude tools, and a dashboard showing where your tokens went.
Is this the official Anthropic API?
No. Klide AI is an independent reseller. It is not affiliated with, endorsed by or sponsored by Anthropic, OpenAI, xAI, Google, Zhipu AI, Moonshot AI, DeepSeek or any other model developer. Klide AI does not host or train models: it gives you one key and routes each request to a third-party provider that serves the model, choosing for price and availability. It speaks the same API, so Claude tools work after changing the base URL and key. See Legal.
How do I get a key?
Create an account with your email and open the verification link we send you. Top up your wallet on Telegram, then create as many keys as you like on the Console page.
Do I need a Claude subscription or an Anthropic account?
No. Your Klide AI key is all you need.
Will this affect my own Claude login or plan?
No. While a Klide AI key is set, the tool uses it instead of your login. Remove the variables (or turn off third-party inference in Claude Desktop) and your normal login is back as it was.
Which base URL do I use?
https://api.klideai.store. It's shown on your Account page. OpenAI clients add /v1.
Can I use it with Cursor or OpenAI-style apps?
Is streaming supported?
Yes. Responses stream through as they're produced.
Usage & limits
How are tokens counted?
Input and output tokens both count. Every request resends the whole conversation, so input adds up fast in long chats.
Where can I see what I've used?
On Console: balance remaining, the last 24 hours of requests and tokens, latency, and a per-model breakdown.
What are the rate limits?
Typically 120 requests a minute per key. See Limits. A 429 means you went over it; wait the retry-after seconds and retry.
What happens when my tokens run out?
Requests stop until you top up. Nothing is charged beyond what you bought, and there are no surprise bills.
Can several people or devices share one key?
Nothing ties a key to a device, but everyone shares one balance and one rate limit. For a team, ask us about separate keys.
Is prompt caching supported?
Yes, best effort, for long prompts marked with cache_control. Claude tools mark them for you. See Prompt caching for how to read it in the response.
Which model should I use?
Sonnet for everyday coding, Haiku for quick routine edits, Opus for planning and hard problems. Browse the full list.
Billing & expiry
Do my tokens or my key expire?
No. Your balance and your key stay valid until you use the tokens.
How do I top up?
Message us on Telegram with the amount, in USDT or ₹ (prices are in US dollars; $1 = ₹100). Top-ups from $5 (₹500) get bonus credit that grows with the amount: +5% from $5, +10% from $20, +15% from $50, +20% from $100, +25% from $250, +30% from $500 and +33.33% from $1,000. Under $5 there is no bonus. Prices for every model are on Model Square.
I lost my key. Where can I find it?
Sign in on the Console page: every key is there, with Show and Copy buttons. You can also create a new one in a click.
Do you offer reseller pricing?
Yes. Message us on Telegram with the volume you have in mind.
Privacy & security
Do you store my prompts or code?
No. Prompts, replies and files stream straight through and are never written to disk. See what we do keep.
What do you log?
One line per request: the time, the HTTP status, the latency and a hashed ID of the key. That's what powers your dashboard.
Is my key safe?
Keys are encrypted at rest and all traffic is HTTPS. Keep them out of git and shared settings files. If one leaks, delete it on your Account page and create a new one.
How long do I stay signed in?
30 days on the same browser. Press Sign out on the Account page to end it sooner.
Still stuck? Message support on Telegram. Include the error text and which tool you're using.