Code Generation
AI coding agents such as Claude Code and Codex normally send every request — including your source code — to the cloud service of their vendor. If your code must not leave your own infrastructure, you can point both tools at adito-code, a coding model served by the ADITO AI Runtime. All requests then stay on ADITO Cloud infrastructure in Germany, and no data is sent to external AI services.
This guide shows how to configure both tools so the self-hosted model is available on demand, without breaking your regular vendor-hosted setup.
Prerequisites
- An ADITO AI API key. Managed cloud systems receive a system API key at startup; if you need a personal key, contact the AI team.
- Claude Code (current version) or Codex 0.143 or later installed.
Model
| Model ID | adito-code |
| Base model | Qwen/Qwen3.6-35B-A3B |
| Hosting | ADITO Cloud infrastructure, Germany |
| Base URL | https://ai.adito.cloud |
| Interfaces | Anthropic Messages API (used by Claude Code), OpenAI Responses API (used by Codex) |
The examples below expect your API key in the environment variable ADITO_AI_API_KEY:
export ADITO_AI_API_KEY="your-api-key"
Keep your API key confidential. Do not commit it to repositories or expose it in client-side code.
Claude Code
Claude Code reads its API endpoint and credentials from environment variables at startup. Redirecting it to the ADITO AI Runtime therefore requires no changes to your Claude Code configuration files:
export ANTHROPIC_BASE_URL="https://ai.adito.cloud"
export ANTHROPIC_API_KEY="$ADITO_AI_API_KEY"
claude --model adito-code
On the first start, Claude Code asks whether to use the configured API key. Confirm once; the decision is remembered.
Recommended: an opt-in launcher
Endpoint and authentication are fixed for the lifetime of a session. Exporting the variables globally would route all Claude Code sessions through the self-hosted model, including those you want to run against your regular Anthropic account. A small shell function keeps the setup opt-in:
# ~/.zshrc or ~/.bashrc
claude-adito-code() {
ANTHROPIC_BASE_URL="https://ai.adito.cloud" \
ANTHROPIC_API_KEY="$ADITO_AI_API_KEY" \
ANTHROPIC_SMALL_FAST_MODEL="adito-code" \
ANTHROPIC_DEFAULT_HAIKU_MODEL="adito-code" \
ANTHROPIC_CUSTOM_MODEL_OPTION="adito-code" \
ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="ADITO Code" \
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Self-hosted coding model" \
claude --model adito-code "$@"
}
The extra variables redirect Claude Code's background Haiku calls to adito-code (they would otherwise fail, since the ADITO AI Runtime doesn't serve Anthropic models) and register the model in the /model picker.
claude-adito-code starts a fully self-hosted session; plain claude keeps using your regular setup. Additional arguments are passed through, for example claude-adito-code -c to continue a previous conversation.
Claude Code has no per-model endpoint routing. Switching models inside a session only changes the model ID sent to the endpoint the session started with — you cannot use Anthropic models and adito-code in the same session.
Codex
Codex supports layered configuration profiles: codex --profile <name> loads ~/.codex/<name>.config.toml on top of your base configuration. Your existing ~/.codex/config.toml stays untouched.
Create ~/.codex/adito-code.config.toml:
# Top-level keys must come before the first table header.
model = "adito-code"
model_provider = "adito"
[model_providers.adito]
name = "ADITO AI Runtime"
base_url = "https://ai.adito.cloud"
wire_api = "responses"
env_key = "ADITO_AI_API_KEY"
Then start Codex with the profile:
codex --profile adito-code
Plain codex keeps using your regular provider and login.
At startup, Codex may log failed to refresh available models errors and a Model metadata for adito-code not found warning. Both are caused by Codex expecting vendor-specific metadata that third-party endpoints do not provide. Requests work regardless.
Verifying the setup
Run a one-shot prompt through each tool:
claude-adito-code -p "Reply with: OK"
codex --profile adito-code exec "Reply with: OK"
Codex prints a session header that shows adito-code as the active model and adito as the provider.
See also: AI Models | Text Generation | AI Compliance