CLI configuration guide
Point the two terminal-based assistants — Claude Code and OpenAI Codex — at Starsg so they share one gateway, one set of API keys and one usage view.
1. Environment check
Confirm Node.js is installed by running npm list -g --depth-0 in your terminal. If the shell reports "command not found", follow this guide to install the Node.js environment Claude Code / Codex need, then rerun the command.
npm list -g --depth-0
Install both CLIs in one go:
npm i -g @anthropic-ai/claude-code@latest npm i -g @openai/codex@latest
claude codex
If the terminal opens a chat prompt, prints a welcome banner or shows a selection menu, that CLI is installed correctly.
2. Claude Code
Open ~/.claude/settings.json (create the file if it does not exist) and write:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.starsg.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-abc...xyz",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
}
}Replace sk-abc...xyz with a key created in the console. Run claude in your terminal — a successful chat reply confirms the wiring.
3. Codex
Edit ~/.codex/config.toml — this file holds the gateway endpoint, model defaults and reasoning effort:
disable_response_storage = true model = "gpt-5.5" model_provider = "novamaas" model_reasoning_effort = "high" model_verbosity = "high" [features] web_search_request = true [model_providers.novamaas] base_url = "https://api.starsg.ai/v1" name = "novamaas" requires_openai_auth = true wire_api = "responses"
Then write your API key into ~/.codex/auth.json:
{
"OPENAI_API_KEY": "sk-abc...xyz"
}4. Verify
Run claude or codex in a terminal — once you receive a chat reply, the integration is live.