konduit.

OpenAI-compatible API in Europe: three settings

by Dr. Christian Meter · Published on

You have code that uses the OpenAI SDK, and you want the requests to be processed by providers in Europe. konduit is an OpenAI-compatible API for exactly that, and you change three settings: the base_url, the API key and the model ID. The third cannot be avoided, because the models behind konduit are not the ones OpenAI runs; they are open models such as Mistral, Llama, Qwen or gpt-oss. Response quality and features such as tool calls, JSON mode or image input therefore depend on the model you choose; which model can do what is listed under capabilities in GET /v1/models. This article shows the switch in Python, TypeScript, curl and LangChain, and it says just as plainly what konduit cannot do and where it changes your request.

In short:

  • base_url becomes https://api.konduit.eu/v1.
  • api_key becomes your konduit key, which starts with kdt-.
  • model becomes an ID from GET /v1/models, for example mistral-small-3.2.

Which OpenAI API endpoints are compatible

konduit is an OpenAI-compatible gateway. Today it serves these endpoints under https://api.konduit.eu/v1:

  • POST /v1/chat/completions, with streaming as well
  • POST /v1/embeddings
  • GET /v1/models and GET /v1/models/{model}
  • POST /v1/completions (the older completions API) and POST /v1/fim/completions (fill-in-the-middle for code editors)
  • GET /v1/usage for the organisation's balance and the limits of the key and the organisation

Among the things konduit does not offer are the Responses API, the Assistants API, image generation and text-to-speech. If you build on those, those parts have to stay where they are.

Python

The official openai package, unchanged. Compared with an OpenAI configuration, base_url, api_key and model differ:

python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.konduit.eu/v1",
    api_key=os.environ["KONDUIT_API_KEY"],
)

completion = client.chat.completions.create(
    model="mistral-small-3.2",
    messages=[{"role": "user", "content": "Say hello in one word."}],
    max_tokens=64,
)
print(completion.choices[0].message.content)

TypeScript

The openai npm package, likewise unchanged:

ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.konduit.eu/v1",
  apiKey: process.env.KONDUIT_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "mistral-small-3.2",
  messages: [{ role: "user", content: "Say hello in one word." }],
  max_tokens: 64,
});
console.log(completion.choices[0]?.message.content);

curl

bash
curl https://api.konduit.eu/v1/chat/completions \
  -H "Authorization: Bearer $KONDUIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "mistral-small-3.2", "max_tokens": 64,
       "messages": [{"role": "user", "content": "Say hello in one word."}]}'

The key goes in the Authorization header, as with OpenAI. It is not read as a query parameter.

LangChain

ChatOpenAI from langchain-openai accepts base_url, api_key and model. Set use_responses_api=False as well: otherwise LangChain may switch to the Responses API of its own accord, for instance when certain parameters are set, and konduit does not serve it.

python
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="mistral-small-3.2",
    base_url="https://api.konduit.eu/v1",
    api_key=os.environ["KONDUIT_API_KEY"],
    use_responses_api=False,
)
print(llm.invoke("Say hello in one word.").content)

Which provider answered the request?

The response is the provider's, passed on unchanged. Two response headers come from konduit: Konduit-Provider names the operator that actually ran the model, Konduit-Deployment the exact deployment ID. Read them even if you pin nothing: if the first provider declines, konduit can fall back to a second.

Choosing a model by operator, country and attestation

GET /v1/models returns first the four fields every OpenAI SDK knows, then konduit's own: price, capabilities, operator, hosting country, ownership, attestation tier and the evidence on file, with links. A compact overview:

bash
curl -s https://api.konduit.eu/v1/models \
  -H "Authorization: Bearer $KONDUIT_API_KEY" \
  | jq -r '.data[] | select(.deployment.experimental | not)
      | [.id, .deployment.provider_display_name, .sovereignty.hosting_country,
         .sovereignty.tier, ([.sovereignty.certifications[].type] | join(","))] | @tsv'

The attestation tier tier has four values: sovereign (third-party audited at the highest level), certified (third-party audited with a narrower scope), declared (a commitment from the operator without a third-party audit) and flagged (European operation with non-European ownership or hybrid routing). It classifies the evidence; it is not a seal of quality for konduit itself. Evidence without a link to its source does not appear in the catalogue. Details such as the country or zero retention, by contrast, are statements made by the operator. An attestation often covers the operator's infrastructure and not the AI product built on top of it; the catalogue records that scope. Whether this is enough for your use case is for your own data protection review to decide; konduit supplies the information for it. The fields are described one by one in the documentation.

Optional: restrict where a request may run

The only part that does not belong to the OpenAI API is an optional provider object in the request body. llama-3.3-70b-instruct, for example, is run by one provider in France and one in Germany. If you need an LLM API with processing in Germany only, this is how you allow Germany and nothing else:

python
completion = client.chat.completions.create(
    model="llama-3.3-70b-instruct",
    messages=[{"role": "user", "content": "Say hello in one word."}],
    max_tokens=64,
    extra_body={"provider": {"countries": ["DE"]}},
)

Instead of filtering by country you can filter by attestation, using an attestation type such as c5-type-2: {"require": ["c5-type-2"]}. The value is compared with the type in sovereignty.certifications, as a whole string and case-insensitively, so c5 does not match c5-type-2. All the attestations you name must be present. The scope of an attestation is not a filter criterion here. Further fields are zero_retention and order, a preferred order. In LangChain, provider also goes into extra_body. In TypeScript it sits directly in the call, but under strict it needs a // @ts-expect-error line above it, because the SDK's types do not know the field; it is sent all the same.

A filter is never quietly relaxed: if no deployment matches, konduit answers with 404 no_deployment_matches_policy instead of sending the request somewhere else. A typo in a field name yields 400 invalid_policy, because an ignored country filter would be worse than an error. The full description is under Routing and sovereignty.

Streaming and usage

Streaming works as it does with OpenAI: server-sent events, terminated by data: [DONE]. One detail is different, and it comes down to billing. konduit bills solely by the token counts the provider itself reports, never by an estimate of its own. A stream only delivers those counts if someone asks for them. That is why konduit sets stream_options.include_usage to true on every stream, whatever you sent.

Whether you receive the counts is up to you. If you want them, ask for them:

python
stream = client.chat.completions.create(
    model="mistral-small-3.2",
    messages=[{"role": "user", "content": "Count to three."}],
    max_tokens=64,
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="")
    elif chunk.usage:
        print("\n", chunk.usage)

If you do not ask, konduit withholds the usage-only chunk. If a provider attaches the counts to a chunk that carries content, that chunk arrives with "usage": null. If a stream breaks off after the first bytes have been sent, konduit appends an error frame of its own and deliberately writes no [DONE]. A client that only watches for the terminator can tell from this that the response is incomplete. If the provider's counts are missing altogether, the request is marked for review and not estimated. More on this under Streaming.

Where konduit changes the bytes it relays

Requests and responses are passed on byte for byte, with exactly four exceptions:

  1. On a stream, stream_options.include_usage is set to true.
  2. If you did not ask for usage on a stream, you do not get it back. Non-streamed responses contain usage as the provider delivered it.
  3. model is replaced by the name the chosen provider uses for the deployment, and the provider object is removed. The provider does not know konduit's model ID, and konduit's routing vocabulary is no provider's business.
  4. For the few deployments whose chat template accepts only nine-character alphanumeric tool-call IDs, konduit replaces IDs such as call_… with suitable ones, the same for a call and its result. Without that, such deployments reject any history that carries OpenAI IDs.

Everything else is passed on as it arrived. A rewritten body may differ only in key order and whitespace.

Three practical notes

Send max_tokens (or max_completion_tokens, which takes precedence). Before the request, konduit reserves part of your balance for the longest possible response. Without an upper limit, that is the deployment's published output limit, which for some deployments is the entire context window, priced at the most expensive deployment the request could fall back to. Several parallel requests can then trigger a 402 insufficient_balance even though the balance is enough for the actual responses. The difference is released once the request has been billed.

Prompts and responses do not end up in konduit's logs, traces or metrics. What is recorded is metadata such as model, provider, token counts, latency and status. The content is processed by the provider; zero_retention in the catalogue shows whether the provider stores it.

If konduit's control plane fails, meaning the console and catalogue maintenance, inference requests keep running with the catalogue last loaded and the keys already known; billing and new keys then catch up with a delay. If, on the other hand, the balance ledger cannot be reached, konduit rejects requests with 503 ledger_unavailable rather than serving against an unchecked balance.

Early access

konduit is taking on its first teams right now, and we activate each organisation individually. Until then, neither a top-up nor API calls are possible. A key starts with kdt- and is shown exactly once. After that, swap the base URL, the key and the model ID in your code, and check under capabilities whether the model has the features your code uses.

Frequently asked questions

Is konduit a drop-in replacement for the OpenAI API?

For chat completions, embeddings and the model list, yes: the same SDKs, the same request and response formats. You swap the base_url, the key and the model ID. The models are different from OpenAI's, and konduit does not offer the Responses API, the Assistants API, image generation or text-to-speech.

Can I use OpenAI's GPT models through konduit?

No. konduit serves open models such as Mistral, Llama, Qwen or gpt-oss, run by providers in Europe. GET /v1/models returns the current list.

How do I make sure a request is processed only in Germany?

With "provider": {"countries": ["DE"]} in the request body. If no deployment matches, konduit answers with 404 no_deployment_matches_policy and does not fall back to another country.

Does streaming work with the OpenAI SDK?

Yes, over server-sent events as with OpenAI. You receive the token counts if you set stream_options={"include_usage": True}.

Do my prompts end up in konduit's logs?

No. konduit records metadata such as model, provider, token counts, latency and status, but neither prompts nor responses. Whether the provider stores content is shown by zero_retention in the catalogue.

If you would like to try konduit with your code, join early access; we will get in touch as soon as we can activate your organisation. If you would like to talk about your use case first, we are happy to do that on a call.