Claude Code
Run Claude Code on heura with three environment variables. Heura speaks the Anthropic Messages API, so Claude Code needs no proxy and no plugin.
The real Claude Code CLI (version 2.1.310) was run against https://api.useheura.com/anthropic: a one-word answer, then an agent task where it called its own Read tool, read a file and answered from it in two turns. Streaming and tool use were also checked with the official Anthropic SDK. Heura is pre-launch, so use a small balance.
Setup
- 1Get a keySign in at the app with your wallet, add balance, then create a key under API keys. It starts with
sk-. - 2Set three variablesAdd them to your shell profile, or run them once before
claude. - 3Pick a model that has a sellerHeura routes by model name. Choose one from
GET /v1/modelsor the Market page.
export ANTHROPIC_BASE_URL="https://api.useheura.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-your-heura-key"
export ANTHROPIC_API_KEY="" # blank, so a cached login cannot win
# pick models that have a live seller (see GET /v1/models)
export ANTHROPIC_MODEL="deepseek/deepseek-v4.1-flash"
export ANTHROPIC_SMALL_FAST_MODEL="deepseek/deepseek-v4.1-flash"
claudePin both model variables. Claude Code uses the small model for background work such as titles and summaries, and an unpinned slot asks for a model that may have no seller.
Check it works
Inside Claude Code run /status. It should show your base URL. Then ask for one word, and ask for something that needs a tool, such as reading a file. Your spend appears on the Usage page of the app within a few seconds.
What works and what does not
| Feature | Status |
|---|---|
| Text, system prompts, multi-turn | Works |
| Streaming (server-sent events) | Works. Tested with the Anthropic SDK and Claude Code |
| Tool use, including parallel tool calls and tool results | Works. Tested with a real model |
| Images (base64 or https url) | Translated to the OpenAI image format. Works only if the model accepts images |
| count_tokens | An estimate from the request size. It costs nothing |
| Extended thinking, cache_control, server tools such as web search, documents | Not carried over. They are ignored and never faked |
| Prompt caching discounts | None. Heura bills the tokens the seller reports |
Things to know
- A forced tool choice may be retried as automatic. Some providers, DeepSeek among them, refuse a forced tool choice while they are in thinking mode. Heura then asks once more with the choice set to automatic. The model still sees every tool.
- Model quality varies. You are not running Claude unless a seller offers a Claude model. Smaller models follow the agent tool protocol less reliably on long multi-step tasks.
- Large prompts cost real money. Claude Code sends a big system prompt on every turn. Set a spend cap on the key.
- Request size limit is 8 MB.
Errors you may see
| Message | Meaning |
|---|---|
| 401 authentication_error | Missing or malformed key. Send it as ANTHROPIC_AUTH_TOKEN and blank ANTHROPIC_API_KEY |
| 404 not_found_error: has no live seller | That model has no seller now. Change ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL |
| 400 invalid_request_error: credit balance is too low | Add balance in the app, or raise the key's cap |
| 429 rate_limit_error | Too many requests from this key. Slow down and retry |
| 529 overloaded_error | No seller could serve the call right now. Retry in a moment |
Anthropic SDK
Any Anthropic SDK works with baseURL set to https://api.useheura.com (or with /anthropic on the end) and the heura key as the API key. The endpoints are POST /v1/messages, POST /v1/messages/count_tokens and GET /anthropic/v1/models.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.HEURA_API_KEY, baseURL: "https://api.useheura.com" });
const msg = await client.messages.create({
model: "deepseek/deepseek-v4.1-flash",
max_tokens: 300,
messages: [{ role: "user", content: "Say hello in three words." }],
});
console.log(msg.content[0].text);
heura