Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

One Key for Claude Code, Codex, and dsh: The OpenAI-Compatible Pattern

说明与用途

使用单一密钥和基础 URL,可在不需要单独账户的情况下使用 Claude Code、Codex 和 dsh,简化配置和计费。

问题

Managing multiple LLM tools requires separate accounts, keys, and billing, leading to complexity and inefficiency.

结果

Unified configuration reduces operational overhead, eliminates key duplication, and streamlines billing across multiple LLM tools.

工作流

  • 1. Choose a provider that offers an OpenAI-compatible endpoint (e.g., TeamoRouter).
  • 2. Export environment variables for each tool: - Claude Code: ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY - Codex/OpenAI tools: OPENAI_BASE_URL, OPENAI_API_KEY - dsh: DEEPSEEK_BASE_URL, DEEPSEEK_API_KEY - Gemini CLI: GOOGLE_GEMINI_BASE_URL, GEMINI_API_KEY, GEMINI_API_KEY_AUTH_MECHANISM 3. Use the same key (e.g., sk-teamo-<your-key>) for all variables.
  • 4. Configure SDKs or raw HTTP calls with the new base URLs and key.
  • 5. Verify each tool works by making a test request (e.g., curl or SDK call).

证据

Drop these into your shell profile (or prefix a command with them) and each tool routes to the same endpoint with the same key.

来源

  • 记录日期: 2026-09-07T07:37:48.720Z