inference.eu

Coding agents · OpenAI Codex CLI

Use OpenAI Codex CLI with open-source models hosted in the EU

Codex CLI is OpenAI's open-source coding agent for the terminal. It supports custom model providers in its config.toml, so you can keep the agent and run it on open-weight models at inference.eu, processed in European data centres and covered by a GDPR data processing agreement.

  1. 01API format: OpenAI
  2. 02EU data centres
  3. 03Covered by one DPA

Set it up in a few minutes

  1. 1

    Create an API key in your inference.eu account and export it as INFERENCE_EU_API_KEY.

  2. 2

    Install Codex CLI, for example with npm install -g @openai/codex.

  3. 3

    Add the [model_providers.inference-eu] table to ~/.codex/config.toml and set model_provider = "inference-eu".

  4. 4

    Set model to an inference.eu model id such as qwen3-coder-480b-a35b-instruct.

  5. 5

    Run codex in your repository and give it a small task to confirm that commands and file edits work.

~/.codex/config.toml
model = "qwen3-coder-480b-a35b-instruct"
model_provider = "inference-eu"

[model_providers.inference-eu]
name = "inference.eu"
base_url = "https://api.inference.eu/v1"
env_key = "INFERENCE_EU_API_KEY"
wire_api = "responses"

What Codex CLI is

Codex CLI is a coding agent from OpenAI that runs locally in your terminal. It reads your code, proposes and applies changes, runs commands inside a sandbox and asks for approval according to the mode you choose. The same agent powers the Codex IDE extension and can be scripted with codex exec for CI jobs.

Codex is built to work with OpenAI's models, but its configuration lets you define your own model providers with a base URL and an API key. That is the route to running it on open-weight models hosted in the EU.

How the configuration works

Custom providers live in ~/.codex/config.toml under [model_providers.<id>]. base_url points at inference.eu, env_key names the environment variable that holds your key, and wire_api = "responses" selects the Responses API, which current Codex versions use for every provider. inference.eu serves the Responses API, so streaming, tool calls and reasoning items work as Codex expects.

Set model_provider to the provider id and model to the model id. The ids openai, ollama and lmstudio are reserved, which is why the example uses inference-eu. Provider settings must sit in your user config: Codex ignores model_providers in project-level config files.

Which models to choose

qwen3-coder-480b-a35b-instruct is a good default. It is trained for agentic coding and handles Codex's shell-heavy workflow of reading files, running tests and applying patches. For tasks that need more planning across a large codebase, try glm-5.3 or kimi-k3, both of which follow tool schemas closely.

gpt-oss-120b is the closest match to the reasoning style Codex was designed around and responds quickly, which suits quick fixes and codex exec runs in CI. Use profiles in config.toml to switch between models without editing the file each time.

Troubleshooting

If Codex asks you to sign in with ChatGPT, it is still using the built-in openai provider. Check that model_provider is set at the top level of ~/.codex/config.toml, not inside a table. A 401 error means INFERENCE_EU_API_KEY is not set in the shell that started Codex.

A 404 usually means base_url has an extra path; it should end in /v1. "Model not found" means the model value differs from the inference.eu model id. If the agent stops after one step or prints commands instead of running them, the model is not returning tool calls; switch to one of the coding models above.

Keeping code and data in the EU

Codex sends model requests from your machine to the provider you configure. With inference.eu as the provider, prompts, file contents and command output are processed in EU data centres and never used for training. We sign a data processing agreement under Article 28 GDPR, share our subprocessor list and bill in euros.

No OpenAI account is needed for this setup. Be aware that features tied to OpenAI's cloud, such as Codex cloud tasks, do not use your custom provider. For a fully EU-based setup, run Codex locally with the custom provider and leave those features off.

OpenAI Codex CLI: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Ask a question

Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

  • Reply within one working day
  • Pricing for your volume
  • DPA ready to sign