Codex
Install the native CLI and connect it with two configuration files.
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 and connect it with two configuration files.
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. The same content works on every system.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "OpenAI" model = "gpt-5.6-terra" review_model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" disable_response_storage = true network_access = "enabled" windows_wsl_setup_acknowledged = true [model_providers.OpenAI] name = "OpenAI" base_url = "https://api.zrelay.net/v1" wire_api = "responses" requires_openai_auth = true [features] goals = true
Create auth.json next to config.toml and replace YOUR_API_KEY with your Zrelay key.
~/.codex/auth.json
Windows%USERPROFILE%\.codex\auth.json
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}Confirm the installation and configuration, then start Codex.
codex --version codex doctor codex
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 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": "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=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 = "YOUR_API_KEY" claude
set ANTHROPIC_BASE_URL=https://api.zrelay.net set ANTHROPIC_AUTH_TOKEN=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 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": "YOUR_API_KEY"
},
"models": {
"gpt-5.5": { "name": "GPT-5.5" },
"grok-4.5": { "name": "Grok 4.5" },
"grok-4.5-latest": { "name": "Grok 4.5 (latest)" }
}
}
},
"$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 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": "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 these two files in your home directory. Edit them in Antigravity instead of a basic text editor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "OpenAI" model = "gpt-5.6-terra" review_model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" disable_response_storage = true network_access = "enabled" windows_wsl_setup_acknowledged = true [model_providers.OpenAI] name = "OpenAI" base_url = "https://api.zrelay.net/v1" wire_api = "responses" requires_openai_auth = true [features] goals = true
~/.codex/auth.json
Windows%USERPROFILE%\.codex\auth.json
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}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 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": "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 these two files in your home directory. Edit them in VS Code instead of a basic text editor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "OpenAI" model = "gpt-5.6-terra" review_model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" disable_response_storage = true network_access = "enabled" windows_wsl_setup_acknowledged = true [model_providers.OpenAI] name = "OpenAI" base_url = "https://api.zrelay.net/v1" wire_api = "responses" requires_openai_auth = true [features] goals = true
~/.codex/auth.json
Windows%USERPROFILE%\.codex\auth.json
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}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": "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 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": "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 official Anthropic Messages API.
[
{
"name": "Zrelay (Claude)",
"vendor": "customendpoint",
"apiKey": "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": "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 these two files in your home directory. You can edit them directly in Cursor.
~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
model_provider = "OpenAI" model = "gpt-5.6-terra" review_model = "gpt-5.6-terra" model_reasoning_effort = "xhigh" disable_response_storage = true network_access = "enabled" windows_wsl_setup_acknowledged = true [model_providers.OpenAI] name = "OpenAI" base_url = "https://api.zrelay.net/v1" wire_api = "responses" requires_openai_auth = true [features] goals = true
~/.codex/auth.json
Windows%USERPROFILE%\.codex\auth.json
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}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 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": "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/v1YOUR_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.netYOUR_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 YOUR_API_KEY with your Zrelay key.
export XAI_API_KEY=YOUR_API_KEY
Add the export to ~/.zshrc or ~/.bashrc to keep it between sessions.
$env:XAI_API_KEY = "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-latest" 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