Set Up Claude Code with Relay365 in Five Minutes
Connecting Claude Code to a relay takes a few terminal settings: the relay address, your API key, and a quick test. This walkthrough uses Relay365, a pay-as-you-go service for multiple model families. Allow about five minutes if you already have an account, an API key, and a supported computer. Account setup and installation may take longer.
The commands below use Bash on macOS, Linux, or Windows through WSL. Keep the same terminal open throughout the setup, because the settings apply to that shell and programs launched from it.
First shift task: cut a Relay365 line key
Sign in to your Relay365 account, generate an API key, and check that your account has credit available for requests. Keep the key private: it authorizes API usage against your account.
Also check which Claude models your account can access. A display name such as Claude Sonnet 5.5 may differ from the model identifier an API expects. If Relay365 provides Claude Code instructions or a model identifier, keep those details nearby.
Second shift task: put Claude Code on your machine
If Claude Code is already installed, run claude --version and continue to the next step. Otherwise, use the official native installer in your Bash terminal:
curl -fsSL https://claude.ai/install.sh | bash
This downloads and runs the installation script. After installation, follow any terminal instructions about updating your PATH, then run claude --version. If the command is unavailable, reopen your terminal and try again before configuring the relay.
Third shift task: point the client at the relay endpoint
Tell Claude Code where to send its API requests:
export ANTHROPIC_BASE_URL="https://api.api365relay.com"
Use this base address without adding /v1. Claude Code uses the Anthropic API configuration. OpenAI SDK clients connecting to Relay365 use a base URL with /v1, but that is a separate client setup.
You can confirm the address without exposing your key by running printenv ANTHROPIC_BASE_URL.
Fourth shift task: load the line key into your shell
To enter the key without displaying it or placing the key itself in your shell command history, run:
read -r -s -p "Relay365 API key: " ANTHROPIC_AUTH_TOKEN
Paste your key and press Enter. The hidden input is intentional. Then run:
export ANTHROPIC_AUTH_TOKEN
Claude Code can now inherit the token when you launch it from this terminal. Avoid printing the token to check it, and keep credentials out of project files, screenshots, and version control.
Fifth shift task: pick a model when the default will not do
If Relay365's Claude Code setup instructions specify a model identifier, set it before starting the application:
export ANTHROPIC_MODEL="YOUR_RELAY365_MODEL_ID"
Replace the placeholder with the exact identifier supplied by Relay365. Do not assume that a model's display name is its API identifier. If the relay supports Claude Code's default model selection, you can leave this variable unset.
Relay365 covers several model families, including Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, and Grok. For this walkthrough, choose a Claude model supported by its Claude Code integration.
Sixth shift task: start Claude Code and send a test call
Move into a project folder you are comfortable letting Claude Code inspect, then run claude. Review any workspace trust prompt before proceeding.
For a small first test, ask: Describe the files in this directory without modifying anything. A successful response checks the basic connection. Review Relay365's usage records, if available, to confirm the request reached your account and inspect its cost.
Seventh shift task: clear the usual setup faults
- Authentication error: Confirm that the key is active and that Claude Code was launched from the terminal where you exported it.
- Model unavailable: Check the exact model identifier and your account's access.
- Connection or route error: Recheck the base address and Relay365's current Claude Code configuration instructions.
These environment settings last for the current terminal session. Once the test succeeds, you can save the endpoint in your shell configuration and load the credential through your preferred secret-management method.
If you want pay-as-you-go access across several supported tools, create a Relay365 account and start with a small test. The service also supports Codex, Gemini CLI, and OpenAI SDK clients, each with its own configuration.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-24 | Estimate Your Coding Agent’s Monthly Cost | Agent shift notes | EN |
| 2026-10-24 | Let a Coding Agent Run Shell Commands Safely | Agent shift notes | EN |
| 2026-10-24 | Recover a Coding Agent Session After a Network Drop | Agent shift notes | EN |
| 2026-10-24 | OpenCode: Multiple Model Providers, One Key | Agent shift notes | EN |
| 2026-10-24 | Review Pull Requests with an Agent and a Checklist | Agent shift notes | EN |
| 2026-10-24 | VS Code Assistants: A Guide to Environment Variables | Agent shift notes | EN |
Curious how it runs on your own code? Sign up →