@apistation/api-set
v0.2.0
Published
One command to configure AI relay station API for Claude Code, Codex CLI, and cc-switch
Maintainers
Readme
@apistation/api-set
One command to configure apistation.cn API for Claude Code, Codex CLI, and cc-switch.
Quick Start
macOS / Linux
curl -fsSL https://apistation.cn/setup.sh | bash -s sk-xxxxxxxxxxWindows PowerShell
irm https://apistation.cn/setup.ps1 -OutFile setup.ps1; ./setup.ps1 sk-xxxxxxxxxxnpx (Node.js required)
# One-liner — configure all tools
npx @apistation/api-set sk-xxxxxxxxxx
# Interactive mode — choose what to configure
npx @apistation/api-setUsage
# Configure all tools (global)
npx @apistation/api-set sk-xxx
# Configure specific tool only
npx @apistation/api-set sk-xxx --only claude
npx @apistation/api-set sk-xxx --only codex
npx @apistation/api-set sk-xxx --only cc-switch
# Project-level config (writes to .claude/settings.json in current dir)
npx @apistation/api-set sk-xxx --project
# Interactive mode (choose tools + global/project scope)
npx @apistation/api-set
# View current status
npx @apistation/api-set --status
# Restore original config
npx @apistation/api-set --restoreWhat It Configures
| Target | Config File | What Changes |
|--------|------------|--------------|
| Claude Code | ~/.claude/settings.json | ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN |
| Codex CLI | ~/.codex/config.toml or config.json | openai_base_url, OPENAI_API_KEY |
| cc-switch | ~/.cc-switch/cc-switch.db | Inserts provider into SQLite |
Global vs Project
| Mode | Claude Code | Command |
|------|------------|---------|
| Global | ~/.claude/settings.json | npx @apistation/api-set sk-xxx |
| Project | .claude/settings.json in project root | npx @apistation/api-set sk-xxx --project |
Setup Scripts
For users without Node.js, use the one-liner setup scripts:
| Platform | Command |
|----------|---------|
| macOS / Linux | curl -fsSL https://apistation.cn/setup.sh \| bash -s sk-xxx |
| Windows | irm https://apistation.cn/setup.ps1 -OutFile setup.ps1; ./setup.ps1 sk-xxx |
The setup scripts will:
- Check and install Node.js if needed
- Auto-configure npm China mirror (
registry.npmmirror.com) - Run
npx @apistation/api-setwith your API key
License
MIT
