/v1/messages, so
Claude Code works against Kyma with two environment variables and no plugin,
proxy or wrapper.
Setup
ANTHROPIC_AUTH_TOKEN sends your key as a bearer token. If you would rather use
the header Anthropic’s own SDK sends, ANTHROPIC_API_KEY works identically and
goes out as x-api-key. Either is fine; use one, not both.
Making it permanent
Environment variables last as long as your shell. To keep the setting, put it in~/.claude/settings.json:
.claude/settings.json, which is how you
point one repository at Kyma and leave everything else alone.
In the VS Code extension the equivalent setting is
claudeCode.environmentVariables. In GitHub Actions, put both in the step’s
env:. In the Agent SDK, pass them as options.env.
Choosing a model
Kyma serves these under Claude Code’s own naming, so/model and the
ANTHROPIC_MODEL variable behave the way you expect:
You are not limited to those. Anything in the catalogue that supports tool
calling will drive Claude Code —
kimi-k2.6, qwen-3-coder and glm-5.2 all
return proper tool_use blocks through /v1/messages. Set ANTHROPIC_MODEL to
any model id from the model list.
Anthropic does not support or audit third-party gateways, and says so plainly in
their documentation. Running Claude Code against any gateway — Kyma included —
is outside what their support covers. It works; it is simply not their problem
if it does not.
Checking it worked
200 with a content array means Claude Code will work. A 404 almost
always means /v1 was left on the end of ANTHROPIC_BASE_URL.
Model discovery
Claude Code can populate its/model picker from the gateway:
/v1/models answers this in well under Claude Code’s timeout and issues
no redirect, both of which it requires. Leave the variable unset and the picker
falls back to its built-in list, which still works — you just type the model id
instead of choosing it.
What is not there
/v1/messages/count_tokens is not implemented. It is optional in Anthropic’s
API and Claude Code falls back to estimating locally, so the only effect is that
the context figure in the status line is approximate rather than exact.
Cost
Claude Code is a heavy client — long contexts, many turns, large tool outputs. Two things matter more here than anywhere else: Prompt caching is on. Claude Code re-sends the system prompt and file context every turn, which is exactly the shape caching is for. Cached input bills at 10% of the input rate, andusage.cache_discount on every response
tells you what it saved.
Watch the model you picked. An Opus-class model on a long agentic session
costs an order of magnitude more than Haiku on the same work. /model mid-session
is cheap; discovering the bill afterwards is not.