On this page
Anthropic SDK, EU models
Besides the OpenAI API, the Router also speaks the Anthropic API. Through /v1/messages you point your existing Anthropic client at HostYourAI with x-api-key authentication (an Authorization: Bearer header works too). You keep your tooling; inference runs on open models in the EU.
What is supported?
- The
/v1/messagesshape of the Anthropic API, includingcount_tokens - Authentication via
x-api-keyorAuthorization: Bearer - True token-by-token streaming (SSE), in the Anthropic event format
- Tool calling: agents such as Claude Code, Cline and opencode can call tools
- The same open models as the OpenAI route
This lets you use one platform for both OpenAI- and Anthropic-based applications, without two separate vendors.
One Router, two APIs
Whether your team uses the OpenAI or the Anthropic SDK, both point at the same Router and the same EU GPUs. That simplifies your stack and keeps all your inference inside Europe.
Example in code
With the Anthropic SDK you set the base URL to the Router and use your key as x-api-key:
from anthropic import Anthropic
client = Anthropic(
base_url="https://hostyourai.com",
api_key="hyai-...",
)
msg = client.messages.create(
model="llama-3.3-70b",
max_tokens=512,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)
Prefer the OpenAI SDK? The same Router also runs our OpenAI-compatible API.
Using it with Claude Code
Claude Code works directly on the Router. Set a few environment variables and pick a model from the catalog:
export ANTHROPIC_BASE_URL="https://hostyourai.com"
export ANTHROPIC_AUTH_TOKEN="hyai-rt-..."
export ANTHROPIC_MODEL="Qwen/Qwen3.6-27B-FP8"
export ANTHROPIC_SMALL_FAST_MODEL="Qwen/Qwen3.6-27B-FP8"
claude
Pick a model that supports tools, otherwise Claude Code cannot read files or run commands. GET /v1/models shows supports_tools per model and how much context is currently being served (served_context_length). Agentic coding uses a lot of context; if you want guaranteed large context for your coding sessions, email info@hostyourai.com. Other Anthropic tools such as Cline and opencode are set up the same way: base URL to HostYourAI, your own key and a model from the catalog. Everything about coding agents on our router is on HostYourAI Code.
What is supported, honestly
| Anthropic feature | Status at HostYourAI |
|---|---|
/v1/messages request and response | Supported |
/v1/messages/count_tokens | Supported (fast estimate) |
x-api-key and Bearer authentication | Supported |
| System and user messages | Supported |
| Streaming | Token by token, Anthropic event format |
| Tool calling | Supported on models with tool support (see catalog) |
| Images in messages | Not yet, text-only |
If you need multimodal input, use the OpenAI-compatible route on the same Router.
Questions about the Anthropic-compatible API
Why use this instead of the Claude API?
Because your code is already built on the Anthropic SDK and you want to move processing to the EU. You change the base URL and the key; your application stays the same. See also the Claude API alternative.
Am I running Claude models then?
No. You call open models such as Llama, Qwen and Mistral, served on European GPUs. The API shape is Anthropic; the models are open weights from the catalog.
Does streaming work?
Yes, token by token. The Router translates the stream live into the Anthropic event format, so streaming clients such as Claude Code just work.
Does Claude Code work on this?
Yes. Set ANTHROPIC_BASE_URL to https://hostyourai.com, use your HostYourAI key and pick a model from the catalog. See the example above.
Can I mix OpenAI and Anthropic clients?
Yes. Both routes run over the same Router, the same API key and the same credit balance. Useful when different teams use different SDKs.
Where does my data run?
On GPUs in European datacenters. Your prompts never leave the EU, a Data Processing Agreement is available and there is no training on your data.
What does it cost?
The same as the OpenAI route: per token, per model class, from one prepaid balance. See the pricing page.