/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 —
or on a non-Claude model 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. A 402 means
the model is outside the free tier and the account has not been topped up yet.
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 applies on models that publish a cached rate. Claude Code re-sends the system prompt and file context every turn and marks it withcache_control, which Kyma forwards. On a model with pricing.cached in
/v1/models, cached input bills at that rate. /v1/messages responses do not
carry a cost field; see what each request cost on the
usage page or from GET /v1/auth/usage/logs.
Prompt Caching covers the details.
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.