Quick start
Two terminal commands and you're coding. Replace sk-paste-your-key-here with the key the operator sent you.
export ANTHROPIC_BASE_URL="https://claude.9relay.com"
export ANTHROPIC_AUTH_TOKEN="sk-paste-your-key-here"
claude --model coding-claude
That's it. The rest of this page explains how to make the most of it.
Set up Claude Code
For permanent setup, add the two export lines to your shell config so they survive new terminal windows.
1. Edit your shell config
If you use zsh (default on macOS), edit ~/.zshrc. If you use bash, edit ~/.bashrc.
export ANTHROPIC_BASE_URL="https://claude.9relay.com"
export ANTHROPIC_AUTH_TOKEN="sk-paste-your-key-here"
2. Reload the shell
source ~/.zshrc # or ~/.bashrc
3. Launch
claude --model coding-claude
You should see the Claude Code banner show coding-claude · API Usage Billing and a prompt. Try asking "say hi in three words" to verify the round trip works.
Set up Codex CLI
For Codex CLI, the relay is configured as a custom OpenAI-compatible provider.
1. Edit Codex config
Open or create ~/.codex/config.toml and add this block (don't overwrite anything that's already there):
model = "coding-codex"
model_provider = "9relay"
[model_providers.9relay]
name = "9relay"
base_url = "https://api.9relay.com/v1"
env_key = "OPENAI_API_KEY"
2. Set the API key
Add to ~/.zshrc or ~/.bashrc:
export OPENAI_API_KEY="sk-paste-your-key-here"
Then source the file.
3. Launch
codex
Your first session
If you've never used Claude Code or Codex before, here's a 10-minute warmup that builds intuition fast.
- Open a project you know well. Don't start with an empty directory — give it real code to look at.
- Ask it to explain something. "What does
src/auth.tsdo?" Read the answer critically — does it match reality? This calibrates your trust. - Ask for a tiny change. "Add a docstring to the
verifyTokenfunction insrc/auth.ts." See how it proposes edits. - Ask for a small bug fix. If you have an open issue, paste it in. "Issue #42 says the date parser breaks on YYYY-MM. Find the cause and propose a fix."
- Verify everything before accepting. Run tests, read the diff, check git status. The model is fast and confident — your job is to be the slow careful one.
Working effectively
Pick the right model for the job
| Alias | When to use it |
|---|---|
coding-claude | Default. Best coding quality. Use for real work where correctness matters. |
coding-codex | OpenAI-flavored model. Try when Claude is stuck on a specific style. |
coding-cheap | Fast and inexpensive. Good for scratch ideas, format conversions, low-stakes exploration. Conserves quota. |
Switch on the fly: inside Claude Code, type /model to pick. In Codex, pass --model on the command line.
Give it real context
The model can only reason about what it sees. Before asking a complex question, make sure the relevant files are in its context — paste them, mention them by path, or open them in your editor if Claude Code is attached.
Plan before doing
For anything non-trivial, ask the model to plan first, then implement. Two-step prompts work much better than one-step:
1. "Read src/payments/*.ts and describe the current
flow when a card payment fails. Don't write code yet."
2. (after reading the plan)
"Now implement the retry logic you described."
Verify, don't trust
Always run tests, lint, and build after the model makes changes. Always read the diff. The model is fast and confident — your job is to be the slow careful one.
Common tasks
Prompt patterns that work well. Copy, adapt, and use.
Add a feature
"I want to add a CSV export to the reports page.
The data source is src/reports/data.ts. Existing
export buttons live in src/components/ExportMenu.tsx.
Follow the same pattern. Add tests for the CSV
formatting in src/reports/__tests__/."
Refactor a file
"src/api/users.ts is 400 lines and mixes HTTP handling
with business logic. Split it: keep HTTP in users.ts,
move business logic to src/users/service.ts. Don't
change behavior. Add or update tests as needed."
Debug a failing test
"Test 'src/auth/__tests__/login.test.ts' is failing
on the third assertion. Read the test, read the
implementation, identify the root cause, and propose
a fix. Show your reasoning before patching."
Generate tests for existing code
"Write tests for src/utils/dateRange.ts covering:
- happy path
- empty input
- timezone edges
- invalid date strings
Match the style of existing tests in src/utils/__tests__/."
Code review
"Review the diff between main and feat/new-checkout.
Focus on: error handling, edge cases, security, and
whether tests cover the new behavior. Be concise and
prioritize CRITICAL > HIGH > MEDIUM."
Explain a codebase
"I just inherited this repo. Walk me through the
overall architecture: where requests come in, what
the data flow looks like, where state is stored,
and which 3 files I should read first."
Quota and billing
Your plan has a monthly budget (in USD), an RPM limit (requests per minute), and a TPM limit (tokens per minute). Hit any of them and the relay returns a clear error — it will not silently route you to a more expensive model.
| Plan | Budget | RPM | TPM | Models |
|---|---|---|---|---|
| Starter | $5/mo | 5 | 50k | coding-cheap, coding-codex |
| Pro | $15/mo | 10 | 100k | all three aliases |
| Max | $40/mo | 20 | 200k | all three aliases |
coding-cheap for exploratory work, draft prompts, and format conversions. Save coding-claude for the moments where correctness matters most.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
401 Unauthorized |
API key wrong, wrong env var name, or key disabled | Check you used ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY) for Claude Code, and the full sk-... value. Contact the operator if you suspect the key was disabled. |
quota exceeded or budget exceeded |
You hit your monthly cap | Wait for the cap to reset on your renewal date, or upgrade your plan. |
rate limit exceeded |
Too many requests per minute | Pause for ~60 seconds. If this happens often, ask the operator to bump your RPM. |
model not found |
You requested an alias not on your plan | Switch to coding-cheap (always included) or ask the operator to add the alias. |
Connection refused or timeouts |
Network issue or the relay is down | Check your internet connection. If other sites work, message the operator. |
Privacy
9relay does not persist your prompts or model responses. Only metadata (token counts, latency, model alias, status code) is logged — never your source code or your conversations. Request headers including your API key are redacted from access logs.
If you observe behavior that suggests otherwise, message the operator immediately.
Support
Phase 1 is invitation-only. There's no ticket system — just reply to the email or message you got the key in. That's a direct line to the operator.
For questions about Claude Code itself (commands, features, key bindings), see the official Claude Code docs. For Codex CLI, see the Codex repo.