Codex
Install the native CLI, add Zrelay as a custom provider, and use your environment key.
No universal prerequisites and no configuration maze. Pick the app you use and see only the instructions you need.
Native coding agents that run from your shell.
Install the native CLI, add Zrelay as a custom provider, and use your environment key.
Use the native terminal installer and a permanent Zrelay configuration.
Install the CLI, add your API key, and configure Chat Completions.
Connect GPT, Grok, or Claude from one global JSON provider configuration.
Use Zrelay from the editor or desktop app you already know.
Run Codex or Claude Code as a native extension, with a lighter API override alternative.
Use Codex or Claude Code in native panels, or add GPT, Claude, and Grok to Copilot Chat.
Connect GPT or Claude through native coding extensions; Antigravity itself is Gemini-only.
Skip the account screen and add Zrelay as a custom model provider from Settings.
Connect the desktop app through its local third-party inference gateway.
Install the native CLI, add the Zrelay provider, then store your key. Node.js is not required.
Run the official installer, then open a new terminal window.
curl -fsSL https://chatgpt.com/codex/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Create the file shown below. It keeps Zrelay separate from your normal Codex login.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "zrelay" model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" [model_providers.zrelay] name = "Zrelay" base_url = "https://api.zrelay.net/v1" wire_api = "responses" env_key = "ZRELAY_API_KEY" requires_openai_auth = false supports_websockets = false
Use a persistent environment variable so Codex can read the key without changing its own login credentials.
For Bash:
echo 'export ZRELAY_API_KEY="zr_live_YOUR_API_KEY"' >> ~/.bashrc source ~/.bashrc echo "$ZRELAY_API_KEY"
For Zsh (the default shell on macOS):
echo 'export ZRELAY_API_KEY="zr_live_YOUR_API_KEY"' >> ~/.zshrc source ~/.zshrc echo "$ZRELAY_API_KEY"
For a temporary test in the current shell only: export ZRELAY_API_KEY="zr_live_YOUR_API_KEY". It disappears when the shell closes.
Persistent setup (run once):
setx ZRELAY_API_KEY "zr_live_YOUR_API_KEY"
setx saves the variable for your user, but the current terminal does not receive it. Close it and open a new terminal, then verify:
$env:ZRELAY_API_KEY
For a temporary test in the current terminal only: $env:ZRELAY_API_KEY = "zr_live_YOUR_API_KEY".
After saving the key, open a new terminal when required and make a request through Zrelay.
codex exec "Respond exactly with: ZRELAY_OK"
Expected output: ZRELAY_OK. If Codex or an editor extension keeps an old process alive, restart it before trying again. On Windows: Get-Process *codex* -ErrorAction SilentlyContinue | Stop-Process -Force.
codex exec works but interactive codex reports Missing environment variable: ZRELAY_API_KEY, Codex may be reusing a daemon started before the environment variable was available.
codex --no-daemon
codex features disable daemon_auto_start codex app-server daemon stop pkill -f 'app-server daemon pid-update-loop' || true codex
codex features list | grep daemon
The native installer needs no Node.js and keeps itself updated. A permanent settings file is the simplest way to connect it to Zrelay.
Run the native installer, then open a new terminal window.
curl -fsSL https://claude.ai/install.sh | bash
Run the native installer in PowerShell, then open a new terminal. Git for Windows is also recommended so Claude Code can run shell commands.
irm https://claude.ai/install.ps1 | iex
npm installation requires Node.js 18 or newer.
npm install -g @anthropic-ai/claude-codeCreate the settings file for your system and replace zr_live_YOUR_API_KEY with your Zrelay key.
~/.claude/settings.json%USERPROFILE%\.claude\settings.json{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zrelay.net",
"ANTHROPIC_AUTH_TOKEN": "zr_live_YOUR_API_KEY",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}export ANTHROPIC_BASE_URL=https://api.zrelay.net export ANTHROPIC_AUTH_TOKEN=zr_live_YOUR_API_KEY claude
Add the two exports to ~/.zshrc or ~/.bashrc to keep them between sessions.
$env:ANTHROPIC_BASE_URL = "https://api.zrelay.net" $env:ANTHROPIC_AUTH_TOKEN = "zr_live_YOUR_API_KEY" claude
set ANTHROPIC_BASE_URL=https://api.zrelay.net set ANTHROPIC_AUTH_TOKEN=zr_live_YOUR_API_KEY claude
Check the installed version, then start Claude Code normally.
claude --version claude
Add Zrelay as a provider in OpenCode's global JSON config. GPT and Grok share one OpenAI-compatible block; Claude uses the native Anthropic provider.
Both model families use the OpenAI-compatible provider in OpenCode.
Create or edit this file. OpenCode also accepts the .jsonc extension if you want comments.
~/.config/opencode/opencode.jsonReplace zr_live_YOUR_API_KEY with your Zrelay key. The model IDs must match the names you want to select in OpenCode.
{
"provider": {
"zrelay": {
"npm": "@ai-sdk/openai-compatible",
"name": "Zrelay",
"options": {
"baseURL": "https://api.zrelay.net/v1",
"apiKey": "zr_live_YOUR_API_KEY"
},
"models": {
"gpt-5.5": { "name": "GPT-5.5" },
"grok-4.5": { "name": "Grok 4.5" }
}
}
},
"$schema": "https://opencode.ai/config.json"
}Restart OpenCode, then select a Zrelay GPT or Grok model from the model picker. They use the same provider block.
Use OpenCode's native Anthropic provider and its Messages endpoint.
Create or edit this file. OpenCode also accepts the .jsonc extension.
~/.config/opencode/opencode.jsonReplace zr_live_YOUR_API_KEY with your Zrelay key. The Anthropic SDK handles the /messages request format.
{
"provider": {
"anthropic": {
"options": {
"baseURL": "https://api.zrelay.net/v1",
"apiKey": "zr_live_YOUR_API_KEY"
},
"npm": "@ai-sdk/anthropic"
}
},
"$schema": "https://opencode.ai/config.json"
}Restart OpenCode, then select a Claude model from the model picker.
Antigravity ships with Gemini models and does not offer a native bring-your-own-key option. Because it is a VS Code fork, you can still use GPT or Claude through their native coding extensions.
Codex runs in its own Antigravity panel using OpenAI's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for OpenAI Codex, and click Install.
Create this file in your home directory. Edit it in Antigravity instead of a basic text editor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "zrelay" model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" [model_providers.zrelay] name = "Zrelay" base_url = "https://api.zrelay.net/v1" wire_api = "responses" env_key = "ZRELAY_API_KEY" requires_openai_auth = false supports_websockets = false
Reload Antigravity, open the Codex panel from the sidebar, and start a session.
Claude Code runs in its own Antigravity panel using Anthropic's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for Claude Code, and click Install. The extension manages the runtime for you.
Create or edit the settings file for your system and replace zr_live_YOUR_API_KEY with your Zrelay key.
~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zrelay.net",
"ANTHROPIC_AUTH_TOKEN": "zr_live_YOUR_API_KEY",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}Reload Antigravity, open the Claude Code panel from the sidebar, and select a model such as claude-sonnet-5.
Some VS Code forks cannot install the runtime automatically. Install Claude Code from the terminal guide, then reload Antigravity.
Choose a model family. Native extensions are the simplest route for agent work; Copilot Custom Endpoint is available when you want models directly in Chat.
Codex runs in its own VS Code panel using OpenAI's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for OpenAI Codex, and click Install.
Create this file in your home directory. Edit it in VS Code instead of a basic text editor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "zrelay" model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" [model_providers.zrelay] name = "Zrelay" base_url = "https://api.zrelay.net/v1" wire_api = "responses" env_key = "ZRELAY_API_KEY" requires_openai_auth = false supports_websockets = false
Reload VS Code, open the Codex panel from the sidebar, and start a session.
Add GPT models to Copilot Chat through VS Code's built-in Custom Endpoint flow.
[
{
"name": "Zrelay (GPT)",
"vendor": "customendpoint",
"apiKey": "zr_live_YOUR_API_KEY",
"apiType": "responses",
"models": [
{
"id": "gpt-5.5",
"name": "GPT-5.5",
"url": "https://api.zrelay.net/v1/responses",
"toolCalling": true,
"vision": false,
"maxInputTokens": 272000,
"maxOutputTokens": 128000
}
]
}
]Keep the key local and do not commit chatLanguageModels.json to a repository.
Claude Code runs in its own VS Code panel using Anthropic's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for Claude Code, and click Install. The extension manages the runtime for you.
Create or edit the settings file for your system and replace zr_live_YOUR_API_KEY with your Zrelay key.
~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zrelay.net",
"ANTHROPIC_AUTH_TOKEN": "zr_live_YOUR_API_KEY",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}Reload VS Code, open the Claude Code panel from the sidebar, and select a model such as claude-sonnet-5.
Add Claude models to Copilot Chat through the Claude-compatible Messages API through Zrelay.
[
{
"name": "Zrelay (Claude)",
"vendor": "customendpoint",
"apiKey": "zr_live_YOUR_API_KEY",
"apiType": "messages",
"models": [
{
"id": "claude-sonnet-5",
"name": "Claude Sonnet 5",
"url": "https://api.zrelay.net/v1/messages",
"toolCalling": true,
"vision": true,
"maxInputTokens": 1000000,
"maxOutputTokens": 128000
}
]
}
]Keep the key local and do not commit chatLanguageModels.json to a repository.
Use the same VS Code setup flow as GPT, with Chat Completions instead of Responses.
/v1/chat/completions URL.
In the Chat view, open the model picker, click the gear icon, and choose Manage Language Models. You can also run Chat: Manage Language Models.
Choose Add Models → Custom Endpoint, enter a group name and display name, add your Zrelay key, and select Chat Completions.
[
{
"name": "Zrelay (Grok)",
"vendor": "customendpoint",
"apiKey": "zr_live_YOUR_API_KEY",
"apiType": "chat-completions",
"models": [
{
"id": "grok-4.5",
"name": "Grok 4.5",
"url": "https://api.zrelay.net/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 500000,
"maxOutputTokens": 128000
}
]
}
]Save chatLanguageModels.json, reload VS Code if the model does not appear, and choose grok-4.5 from the Chat model picker.
Choose the model family you want to use. The native Codex and Claude Code extensions are recommended because their agent tools work without a format adapter.
Codex runs in its own Cursor panel using OpenAI's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for OpenAI Codex, and click Install.
Create this file in your home directory. You can edit it directly in Cursor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "zrelay" model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" [model_providers.zrelay] name = "Zrelay" base_url = "https://api.zrelay.net/v1" wire_api = "responses" env_key = "ZRELAY_API_KEY" requires_openai_auth = false supports_websockets = false
Reload the editor, open the Codex panel from the sidebar, and start a session.
https://api.zrelay.net/v1gpt-5.5.Grok can use the same OpenAI-compatible base URL in Cursor, but it is served through Chat Completions. Use grok-4.5 as the model id; do not switch this route to the Responses API.
Claude Code runs in its own Cursor panel using Anthropic's native agent.
Open Extensions with Cmd/Ctrl + Shift + X, search for Claude Code, and click Install. The extension manages its runtime for you.
Create or edit the settings file for your system and replace zr_live_YOUR_API_KEY with your Zrelay key.
~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zrelay.net",
"ANTHROPIC_AUTH_TOKEN": "zr_live_YOUR_API_KEY",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}Reload Cursor, open the Claude Code panel from the sidebar, and select a model such as claude-sonnet-5.
https://api.zrelay.net/v1claude-sonnet-5.Use ZCode without connecting a Z.ai account. Skip the login screen, add Zrelay from Model settings, then choose the API format that matches your model.
Launch ZCode, choose Use API Key, then select Skip for now to pass the login panel.
Click the gear icon. Under Basics, open Model settings, then click Add provider.
Fill the provider form with these values. Use the base URL only; the API format determines the final route.
Zrelayhttps://api.zrelay.net/v1zr_live_YOUR_API_KEYSelect the format supported by the model family you want to use:
Responses (/responses)Anthropic messages (/v1/messages)Chat completions (/chat/completions)In Model list, add the exact model IDs you want, such as gpt-5.5, claude-sonnet-5, or grok-4.5. You can also leave the list blank and add models later.
Save the provider, return to the model picker, and select your Zrelay model.
Connect the desktop app through its local Anthropic-compatible gateway option.
Launch Claude Desktop without signing in. Open Help → Troubleshooting → Enable Developer Mode. A Developer menu will appear in the menu bar.
From the menu bar, choose Developer → Configure Third-Party Inference…
Select Gateway (Anthropic-compatible), then enter these values and click Apply locally.
https://api.zrelay.netzr_live_YOUR_API_KEYbearerFully quit and reopen Claude Desktop. Choose Continue with Gateway and the local configuration, then select a Claude model such as claude-sonnet-5.
Install the CLI, expose your Zrelay key as XAI_API_KEY, and add the supported Grok models.
Run xAI's official installer, then open a new terminal window.
curl -fsSL https://x.ai/cli/install.sh | bash
On Windows, install the official package through npm. This option requires Node.js.
npm install -g @xai-official/grok
The npm installer is also a fallback when x.ai is blocked on your network.
Replace zr_live_YOUR_API_KEY with your Zrelay key.
export XAI_API_KEY=zr_live_YOUR_API_KEY
Add the export to ~/.zshrc or ~/.bashrc to keep it between sessions.
$env:XAI_API_KEY = "zr_live_YOUR_API_KEY"
Create the configuration file for your system.
~/.grok/config.toml%USERPROFILE%\.grok\config.toml[model.grok-4-5] model = "grok-4.5" base_url = "https://api.zrelay.net/v1" env_key = "XAI_API_KEY" api_backend = "chat_completions" [model.grok-4-5-latest] model = "grok-4.5" base_url = "https://api.zrelay.net/v1" env_key = "XAI_API_KEY" api_backend = "chat_completions"
api_backend set to chat_completions.
Grok models on Zrelay use /v1/chat/completions. The Responses API is not supported for Grok.
Fully quit and reopen your terminal. Run grok, then select grok-4-5 or grok-4-5-latest from the model picker.
grok