01
I get 401 Unauthorized
Check that your key starts with hyai- and was copied in full. An OpenAI key (sk-...) does not work on the Router. Create a fresh key under Router if needed.
Guide 03 Serve
A practical step-by-step guide to move your existing OpenAI integration to the EU in minutes.
01 Guide
The EU Router is an OpenAI- and Anthropic-compatible inference gateway that runs open models on European GPUs. Your prompts and answers never leave the EU, there is no US cloud provider in the chain, and you pay per token from one prepaid credit balance. Because the API is drop-in compatible, nothing changes in your application code except the base URL and the API key.
hyai-... format, created under Router in your dashboardIn your dashboard, go to Router and create a new key. Copy the hyai- key right away; you only see it once. This key replaces your OpenAI key.
Set the base URL to https://hostyourai.com/api/v1 and use your HostYourAI key. In Python with the OpenAI SDK, the rest of your code is unchanged:
from openai import OpenAI
client = OpenAI(
base_url="https://hostyourai.com/api/v1",
api_key="hyai-...", # your HostYourAI key
)
resp = client.chat.completions.create(
model="llama-3.3-70b",
messages=[{"role": "user", "content": "Summarise this contract."}],
)
print(resp.choices[0].message.content)In Node.js with the same SDK:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://hostyourai.com/api/v1",
apiKey: process.env.HOSTYOURAI_API_KEY,
});
const resp = await client.chat.completions.create({
model: "llama-3.3-70b",
messages: [{ role: "user", content: "Summarise this contract." }],
});
console.log(resp.choices[0].message.content);Or straight from curl to test quickly:
curl https://hostyourai.com/api/v1/chat/completions \
-H "Authorization: Bearer hyai-..." \
-H "Content-Type: application/json" \
-d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"Hello"}]}'Where you would use gpt-4o on OpenAI, pick an open model from the Model Garden here, for example a Llama, Qwen, Mistral or DeepSeek variant. Use the model slug exactly as it appears in the Model Garden as the value for model. Streaming works identically: set stream=True and you get server-sent events back.
That works too. The Router exposes a /v1/messages shim. Set the base URL to https://hostyourai.com and pass your hyai- 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)Test your first request in the Playground or from your code and track usage, tokens and latency per request in your activity log. Two things to watch when migrating: model names differ (use open-model slugs, not gpt-*), and you pay per token instead of via an OpenAI subscription.
The shared Router is ideal to start with. If you want isolation or guaranteed capacity, promote a model to a dedicated instance on your own EU GPU. Your code stays identical, only the model slug or endpoint changes.
This table puts the settings side by side. For more background on the gateway itself, see the EU Inference Router page.
| Setting | On OpenAI | On the EU Router |
|---|---|---|
| Base URL | https://api.openai.com/v1 | https://hostyourai.com/api/v1 |
| API key | sk-... | hyai-... |
| Model | gpt-4o, gpt-4o-mini | Open models such as Llama, Qwen, Mistral, DeepSeek or Gemma |
| Streaming | stream=true, SSE | Identical, stream=true with server-sent events |
| Anthropic route | Not applicable | /v1/messages shim, buffered streaming, text only |
| Billing | Subscription or usage billing | Pay-as-you-go per token, see pricing |
10 Guide
01
Check that your key starts with hyai- and was copied in full. An OpenAI key (sk-...) does not work on the Router. Create a fresh key under Router if needed.
02
Almost always the base URL is wrong. It must be exactly https://hostyourai.com/api/v1. Make sure your SDK does not append another /v1 to the URL on its own.
03
Not every model is permanently warm. The Model Garden shows per model whether it is warm or still warming up. Pick a warm model or wait a moment; after that, responses are fast as usual.
04
The /v1/messages shim uses buffered streaming and supports text only. If you need token-by-token streaming, use the OpenAI route on /api/v1/chat/completions.
No. You only change the base URL and the API key. Everything else, including streaming and the message structure, stays the same.
Open models such as Llama, Qwen, Mistral, DeepSeek and Gemma. The current catalogue with live status is in the Model Garden.
You pay per token, pay-as-you-go, from one prepaid credit balance, with no subscription. See the pricing page.
Yes. The models run on GPUs in European datacenters and your prompts and answers never leave the EU.
Yes. For isolation or guaranteed capacity, move a model to a dedicated GPU instance. Your key and base URL keep working.
From model hosting to a customer-facing API, it is built for developers and businesses who want their AI running on infrastructure they actually control, inside the EU.
EU-hosted
100%
Your data and your models stay on European GPUs. GDPR-friendly by design.
Verified models, ready to serve
700+
Llama, Qwen, DeepSeek, Mistral, FLUX and plenty more. Pick one and it is warm in minutes, with no DevOps on your end.
OpenAI & Anthropic compatible
2 SDK
Point your existing client at the Router and keep your tools. No rewrite, no lock-in.
No infra to manage. Pick a model, get an OpenAI-compatible URL, ship.
01
Choose from the Model Garden or paste any HuggingFace ID. Set the VRAM and pick an EU GPU.
02
We deploy vLLM, run readiness probes, and hand you a warm OpenAI- and Anthropic-compatible URL plus an API key.
03
Point your client at the Router. It auto-routes to a warm instance and logs every request.
The Router speaks the OpenAI and Anthropic APIs, so it drops straight into the clients and SDKs your team already runs. Just change the base URL.
If a US cloud is off the table, HostYourAI gives you the same developer experience on European infrastructure.
01
Public sector & government
Citizen data that legally has to stay in the EU, with full auditability.
02
Regulated enterprise
Finance, healthcare and legal teams under GDPR, DORA and the AI Act.
03
EU SaaS & scale-ups
Ship AI features your customers trust, without a US sub-processor.
04
Agencies & integrators
Deliver private AI for clients on infrastructure you can stand behind.
Text and image models on dedicated EU GPUs. Every model tested on our own hardware.
Start with one layer and add the others when the work asks for it. They share one key, one balance and one Activity view.
Explore more about EU-hosted AI on HostYourAI.
Build RAG on EU GPUs
Build a RAG pipeline on European GPUs. Link a knowledge base to the Router and ground answers in your own documents, with source citations.
Read moreDeploy your own LLM with vLLM
Learn how to deploy an open LLM on a European GPU with vLLM. From a HuggingFace ID to a warm, OpenAI-compatible endpoint.
Read moreStart with one key today. Add dedicated GPUs when your workload needs them.







