Integration
Call LLMcode from your own code
Any SDK that accepts a custom base URL can talk to LLMcode. Two settings — base URL and key — replace the vendor endpoint, and the request body stays the same.
Updated
Two base URLs, one key
OpenAI-compatible SDKs take https://llmcode.io/v1 as the base URL and the LLMcode key as the API key. Anthropic SDKs take https://llmcode.io without /v1 — the SDK appends /v1/messages itself — and the same key in x-api-key, plus the anthropic-version header.
The key is not bound to a single model: the profile is chosen in the model field of every request. One key therefore covers chat, embeddings and agent traffic, and the journal separates them by model.
- OpenAI-compatible base URL: https://llmcode.io/v1
- Anthropic base URL: https://llmcode.io
- Model: a published slug from /models
Endpoints this version answers
Chat completions, messages, responses, embeddings and the models catalog are supported. Text is the working medium: image, audio and video inputs are not served by this version.
Streaming works on chat completions and on messages, where the response is a regular SSE stream. The responses endpoint does not stream: a request with stream: true returns 400, so call it without streaming and read the full body.
Keep the key on the server
The gateway accepts a valid key from any origin, including a browser. That is a deployment mistake, not a feature: a key in front-end code is visible to every visitor. Put the call on your backend, read the key from an environment variable and proxy only the result to the page.
Give each environment its own key with a spend limit and an expiry date. When a key leaks, revoke it in the cabinet — revocation is immediate, and the other keys keep working.
Connect
import os
from openai import OpenAI
client = OpenAI(
base_url="https://llmcode.io/v1",
api_key=os.environ["LLMCODE_API_KEY"],
)
reply = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import os
from anthropic import Anthropic
client = Anthropic(
base_url="https://llmcode.io",
api_key=os.environ["LLMCODE_API_KEY"],
)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://llmcode.io/v1",
apiKey: process.env.LLMCODE_API_KEY,
});Published model prices
USD per 1M tokens. The numbers come from the public catalog on every page rebuild — this is the sale price, not an estimate.
| Model | Input | Output | Cache |
|---|---|---|---|
| Claude Opus 5.5 | $2.70 | $8.00 | $0.14 |
| DeepSeek Flash | $0.50 | $2.00 | $0.01 |
| Claude Sonnet 5.5 | $1.33 | $6.67 | $0.07 |
| DeepSeek V4 Pro | $2.20 | $6.60 | $0.07 |
Top-up from $10, balance in USD. 1 USD = 1,000,000 UT. No subscription and no auto-charge.
Questions
Can the browser call the API directly?
Technically yes with a valid key, but then the secret is public. Call the API from your server and keep the key in an environment variable.
Which SDKs work without changes?
Any OpenAI-compatible client that exposes a base URL — the official Python and Node SDKs, LangChain, LlamaIndex and most agent frameworks.
Does streaming work?
Yes on chat completions and messages (SSE). The responses endpoint does not stream in this version and returns 400 with stream: true.
How do I read the cost of a request?
The journal at /account/logs shows the model, the token counts and the charged amount for every call, estimated rows are marked.