Client guides
Wire up any client.
Set up Claude Code, Codex, Cursor, Cline, OpenCode, Open Claw, Hermes Agent, 9Router and MCP against the gateway. Two lines per client.
00 Pick your client
Every client below needs the same two things: the gateway base URL and your sk- key. The rest is copy-paste.
Claude Code
The Anthropic Messages format. Two environment variables and the CLI is on the gateway.
Codex
Set a custom model provider in ~/.codex/config.toml pointing at the gateway.
Cursor
Override the OpenAI base URL in Settings so Cursor talks to the gateway.
Cline
Add an OpenAI Compatible provider with the gateway base URL and key.
OpenCode
Register the gateway as a provider with @ai-sdk/openai-compatible in opencode.json.
Open Claw
OpenAI-compatible. Point the base URL at the gateway and set the key.
Hermes Agent
Hermes runs on an OpenAI-compatible provider. Add the gateway as a custom endpoint.
9Router
Add the gateway as an OpenAI-compatible upstream in 9Router.
MCP
Connect an MCP client to the gateway MCP server and call models as tools.
01 Claude Code
The Anthropic Messages format. Two environment variables and the CLI is on the gateway.
Install Claude Code
npm install -g @anthropic-ai/claude-code
Export the base URL and key
Claude Code reads ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
Run it
claude — every request now routes through the gateway.
echo 'export ANTHROPIC_BASE_URL="https://router.byvall.com/v1"' >> ~/.zshrc && echo 'export ANTHROPIC_AUTH_TOKEN="val-router-..."' >> ~/.zshrc && source ~/.zshrcexport ANTHROPIC_BASE_URL="https://router.byvall.com/v1"
export ANTHROPIC_AUTH_TOKEN="val-router-..."
claude02 Codex
Set a custom model provider in ~/.codex/config.toml pointing at the gateway.
Install Codex
npm install -g @openai/codex
Edit ~/.codex/config.toml
Add the agw provider with the gateway base URL.
Export the key and run
codex reads AGW_KEY from the environment.
model = "deepseek/deepseek-v4-pro-0813"
[model_providers.agw]
name = "AI Gateway"
base_url = "https://router.byvall.com/v1"
env_key = "AGW_KEY"export AGW_KEY="val-router-..."03 Cursor
Override the OpenAI base URL in Settings so Cursor talks to the gateway.
Open Settings → Models
Scroll to the OpenAI API section.
Enable "Override OpenAI Base URL"
Paste the gateway base URL.
Paste your key and add a model
Use any model id from the catalogue.
https://router.byvall.com/v1val-router-...04 Cline
Add an OpenAI Compatible provider with the gateway base URL and key.
Open Cline settings → API Provider
Choose "OpenAI Compatible".
Set the base URL and key
Base URL is the gateway, key is your val-router- key.
Pick a model
Paste a model id from the catalogue.
Base URL: https://router.byvall.com/v1
API Key: val-router-...
Model: deepseek/deepseek-v4-pro-081305 OpenCode
Register the gateway as a provider with @ai-sdk/openai-compatible in opencode.json.
Create or edit opencode.json
In your project root or ~/.config/opencode/.
Add the agw provider
Use the @ai-sdk/openai-compatible npm package.
Select the model
opencode lists the models you declare.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"agw": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://router.byvall.com/v1",
"apiKey": "val-router-..."
},
"models": {
"deepseek/deepseek-v4-pro-0813": {}
}
}
}
}06 Open Claw
OpenAI-compatible. Point the base URL at the gateway and set the key.
Open Open Claw settings
Find the provider / endpoint section.
Set the base URL
Use the gateway base URL.
Set the key and model
val-router- key plus any catalogue model id.
OPENAI_BASE_URL=https://router.byvall.com/v1
OPENAI_API_KEY=val-router-...07 Hermes Agent
Hermes runs on an OpenAI-compatible provider. Add the gateway as a custom endpoint.
Open the Hermes provider config
Add a custom OpenAI-compatible provider.
Set base URL and key
Base URL is the gateway, key is your val-router- key.
Choose a model
Any id from the catalogue works.
base_url = https://router.byvall.com/v1
api_key = val-router-...
model = deepseek/deepseek-v4-pro-081308 9Router
Add the gateway as an OpenAI-compatible upstream in 9Router.
Open 9Router → Providers
Add a new OpenAI-compatible provider.
Enter the base URL and key
Base URL is the gateway.
Route a model to it
Map any catalogue model to the provider.
https://router.byvall.com/v109 MCP
Connect an MCP client to the gateway MCP server and call models as tools.
Open your MCP client config
For example Cline or Claude mcp settings.
Add the gateway server
Point the URL at the gateway MCP endpoint.
Authorize with your key
Pass the val-router- key as a bearer token.
{
"mcpServers": {
"ai-gateway": {
"url": "https://router.byvall.com/v1/mcp",
"headers": { "Authorization": "Bearer val-router-..." }
}
}
}10 Next steps
Full endpoint reference, or talk to support if a client is not listed.