Step-by-step instructions for connecting your AI tools to Corveil.
Get Corveil running in under 2 minutes. No Docker, no database, no Kubernetes.
curl -sSL https://corveil.com/install.sh | sh
The installer automatically verifies the download against published SHA-256 checksums. Or download directly from GitHub Releases (macOS, Linux, Windows — ARM64 and AMD64) and verify manually.
corveil --dev --openrouter-api-key sk-or-v1-...
That's it. Corveil starts on localhost:8000 with:
You can also use --anthropic-api-key for direct Anthropic access, or any other provider flag. Run corveil --help to see all options.
Create an API key in the dashboard, then point your AI tool at Corveil:
export ANTHROPIC_BASE_URL="http://localhost:8000" export ANTHROPIC_API_KEY="sk-citadel-your-key-from-dashboard"
See the client setup guides below for tool-specific configuration.
Corveil supports two authentication modes for connecting AI tools:
| Tool | Direct Mode | Passthrough | Config Method |
|---|---|---|---|
| aichat | Yes | No | YAML config file |
| Claude Code | Yes | Yes | Env vars or settings.json |
| OpenClaw | — | Yes | CLI config command |
| Cursor IDE | Yes | No | GUI settings |
| OpenCode | Yes | No | Env vars or config file |
| Codex CLI | Yes | No | Env vars or config.toml |
| Gemini CLI | Yes | No | Env vars |
Why the difference? Passthrough mode requires the client to send a custom x-citadel-api-key header. Only Claude Code (via ANTHROPIC_CUSTOM_HEADERS) and OpenClaw (via custom headers config) support this. Tools that use the OpenAI-compatible API (Cursor, Codex CLI, OpenCode) only support Direct mode.
aichat is a powerful AI chat CLI that supports multiple providers via its OpenAI-compatible client configuration.
Direct mode only. aichat uses the OpenAI-compatible client type, which sends your Corveil key as the standard API key.
Open your aichat config file. Run aichat --info to find its location, then add a Corveil client:
clients: - type: openai-compatible name: corveil api_base: https://your-corveil-host/v1 # must include /v1 api_key: sk-citadel-your-key-here models: - name: or-claude-haiku-4.5 - name: or-gpt-5.1
Replace your-corveil-host with your Corveil URL and sk-citadel-your-key-here with your virtual API key. List any models your key has access to — check GET /v1/models for the full list.
# One-shot query aichat -m corveil:or-claude-haiku-4.5 "Explain zero-trust architecture" # Interactive session aichat -m corveil:or-claude-haiku-4.5
If aichat responds, requests are flowing through Corveil. Confirm by checking the Corveil dashboard or logs for the incoming request.
Claude Code is Anthropic's official CLI for Claude. It natively supports custom base URLs and headers, making it one of the most flexible tools for Corveil integration.
Direct and Passthrough modes supported. Claude Code supports both ANTHROPIC_API_KEY override (Direct) and ANTHROPIC_CUSTOM_HEADERS (Passthrough).
Your ANTHROPIC_API_KEY is a Corveil virtual key. Corveil authenticates the request and forwards it upstream using its own provider credentials.
export ANTHROPIC_BASE_URL="https://your-corveil-host" export ANTHROPIC_API_KEY="sk-citadel-your-key-here"
Or configure via settings.json (project .claude/settings.json or global ~/.claude/settings.json):
{
"env": {
"ANTHROPIC_BASE_URL": "https://your-corveil-host",
"ANTHROPIC_API_KEY": "sk-citadel-your-key-here"
}
}
Your own Anthropic API key or OAuth token is sent directly to Anthropic. A separate x-citadel-api-key header authenticates with Corveil for tracking and guardrails.
export ANTHROPIC_BASE_URL="https://your-corveil-host" export ANTHROPIC_CUSTOM_HEADERS="x-citadel-api-key: sk-citadel-your-key-here"
Or configure via settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://your-corveil-host",
"ANTHROPIC_CUSTOM_HEADERS": "x-citadel-api-key: sk-citadel-your-key-here"
}
}
See the Claude Code settings documentation for details on project vs. global settings.
Start Claude Code as usual — it will automatically route all requests through Corveil:
claude
Ask a simple question. If it responds, requests are flowing through Corveil. Confirm in the dashboard or logs:
corveil logs --tail 5
OpenClaw is an AI gateway client that supports custom provider routing with headers, making it ideal for Corveil's passthrough mode.
Passthrough mode only. OpenClaw forwards your existing Anthropic credentials upstream. The x-citadel-api-key header authenticates with Corveil for tracking and guardrails.
Tell OpenClaw to route Anthropic requests through Corveil:
openclaw config set models.providers.anthropic '{
"baseUrl": "https://your-corveil-host",
"api": "anthropic-messages",
"headers": {
"x-citadel-api-key": "sk-citadel-your-key-here"
},
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"reasoning": true,
"input": ["text", "image"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 16384
}
]
}'
Replace your-corveil-host with your Corveil URL and sk-citadel-your-key-here with your virtual API key. Setting costs to 0 is recommended since Corveil tracks spend on its side.
# If using the Mac app, restart from the menu bar # Otherwise: openclaw gateway restart
# Check provider status openclaw channels status --probe # Send a test message openclaw message send "Hello from OpenClaw via Corveil"
Cursor is an AI-powered code editor with built-in support for custom OpenAI-compatible endpoints.
Direct mode only. Cursor uses the OpenAI-compatible API and does not support custom headers for passthrough authentication.
In Cursor, go to Settings > Models (or press Cmd+Shift+P / Ctrl+Shift+P and search for "Models").
Open a file in Cursor and use the AI features (inline edit, chat, or Cmd+K). If Cursor responds with AI suggestions, requests are flowing through Corveil.
OpenCode is an open-source AI coding assistant that runs in your terminal. It supports the OpenAI-compatible API via environment variables.
Direct mode only. OpenCode uses the standard OpenAI environment variables and does not support custom headers.
export OPENAI_BASE_URL="https://your-corveil-host/v1" export OPENAI_API_KEY="sk-citadel-your-key-here"
Add these to your shell profile (~/.zshrc, ~/.bashrc, etc.) for persistence.
opencode
Ask OpenCode a question. If it responds, requests are flowing through Corveil. Confirm in the Corveil dashboard or logs.
Codex CLI is OpenAI's open-source coding agent that runs in your terminal. It supports custom base URLs via environment variables.
Direct mode only. Codex CLI uses the standard OpenAI environment variables and does not support custom headers.
export OPENAI_BASE_URL="https://your-corveil-host/v1" export OPENAI_API_KEY="sk-citadel-your-key-here"
Add these to your shell profile for persistence.
codex
Run a coding task. If Codex responds with suggestions, requests are flowing through Corveil.
For deployments with custom TLS certificates (common in GovCloud environments), Codex CLI supports a dedicated environment variable:
# Point to your custom CA certificate export CODEX_CA_CERTIFICATE="/path/to/your/ca-cert.pem"
Gemini CLI is Google's command-line interface for Gemini models. Environment variable support for custom endpoints is still evolving upstream.
Direct mode only (Beta). Gemini CLI can be pointed at a custom base URL via environment variables. This is experimental — env var support is still evolving upstream.
export GEMINI_API_KEY="sk-citadel-your-key-here"
Add these to your shell profile for persistence.
gemini
Ask a question. If Gemini CLI responds, requests are flowing through Corveil. Confirm in the dashboard or logs.