{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "sinholms-setup-gateway--point-claude-code-at-gateway",
 "repo": "Sinholms/setup-gateway",
 "repo_url": "https://github.com/Sinholms/setup-gateway",
 "repo_slug": "sinholms-setup-gateway",
 "title": "Point Claude Code at your own OpenAI-compatible gateway",
 "page_title": "How to point Claude Code at your own OpenAI-compatible gateway with Setup Gateway",
 "summary": "Write the gateway URL, key, and model into Claude Code settings without losing existing config.",
 "who": "A developer or team lead who wants Claude Code to route through a company LiteLLM, OpenRouter, or internal proxy instead of the default endpoint.",
 "problem": "Editing ~/.claude/settings.json by hand is error prone, and a wrong edit can break other environment settings the user already relies on.",
 "outcome": "Claude Code uses the chosen gateway, the original settings are kept, and a timestamped backup exists for rollback.",
 "steps": [
  "Clone the repo and run `node bin/setup-gateway.mjs claude` in a terminal to start the interactive setup.",
  "Enter the Base URL, the API key, and pick a model from the list that appears.",
  "Restart Claude Code so the new env values are read.",
  "Run `node setup-gateway.mjs status` to confirm the base URL and model (the key is shown masked)."
 ],
 "agent_prompt": "Work in the cloned repo Sinholms/setup-gateway. Run `node bin/setup-gateway.mjs claude --base-url <GATEWAY_BASE_URL> --api-key <API_KEY> --model <MODEL_ID> --yes` and report the written file path. Then run `node setup-gateway.mjs status` and verify the printed base URL and model match the values passed in.",
 "agents": [
  "claude-code"
 ],
 "difficulty": "Intermediate",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "Base URLs that start with http:// trigger a warning and need y/N confirmation, or --yes in non-interactive mode, because the key is sent without TLS.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "javascript",
 "requirements": [
  "Node.js 18 or newer installed",
  "A gateway base URL that exposes /v1 and an API key for it",
  "A model id the gateway serves, or access to GET /v1/models so the picker can list them",
  "For Codex: a gateway that serves the Responses API (/v1/responses)"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The API key is written in plaintext into the Claude Code config file, so restrict that file's permissions and do not commit it."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/sinholms-setup-gateway/point-claude-code-at-gateway/",
 "md": "https://dedupedai.com/use-cases/sinholms-setup-gateway/point-claude-code-at-gateway/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/sinholms-setup-gateway--point-claude-code-at-gateway.json",
 "api_version": "v1"
}
