AGENT SKILL

claude-max-proxy-setup

Use when an agent or developer wants to reduce Claude API costs, route requests through a Claude Max or Pro subscription instead of per-token billing, or set up claude-max-api-proxy for OpenClaw or any OpenAI-compatible client

License 许可
MIT
最近更新
2026-06-07
Stars
★ 0
Forks
1

01 前言 Front Matter

name
claude-max-proxy-setup
homepage
https://github.com/atalovesyou/claude-max-api-proxy
description
Use when an agent or developer wants to reduce Claude API costs, route requests through a Claude Max or Pro subscription instead of per-token billing, or set up claude-max-api-proxy for OpenClaw or any OpenAI-compatible client

03 SKILL.md 正文

Claude Max API Proxy Setup

Overview

Replace per-token Claude API billing ($15-75/M tokens) with a flat-rate proxy through your Claude Max ($200/mo) or Pro ($20/mo) subscription. The claude-max-api-proxy package exposes your authenticated Claude Code CLI session as an OpenAI-compatible HTTP endpoint on localhost:3456.

How it works: The proxy uses your already-authenticated claude CLI session to forward requests. No API keys are stored or transmitted by the proxy — it relies on your local CLI login. Any OpenAI-compatible client (OpenClaw, LangChain, custom scripts) connects to localhost:3456.

Source code: github.com/atalovesyou/claude-max-api-proxy — review the source before installing.

When to Use

  • Agent API costs exceed $20/month and you have a Claude Max or Pro subscription
  • You want to run Claude Opus 4.6, Sonnet 4.6, or Haiku 4.5 without per-token charges
  • You're configuring OpenClaw, LangChain, or any OpenAI-compatible client to use Claude

Do not use when:

  • You don't have a Claude Max or Pro subscription (get one first at claude.ai)
  • You need concurrent request throughput >5 (Max plan has rate limits)
  • You're on a shared server where others could access port 3456

Security Notes

  • The proxy binds to localhost only by default — it is not accessible from other machines
  • It uses your authenticated claude CLI session, meaning anyone with access to port 3456 on your machine can make requests against your subscription
  • Never expose port 3456 to the public internet — use firewall rules to restrict access
  • Review the package source before installing

Setup Process

1. Prerequisites Check

# Verify Node.js 20+
node --version

# Verify Claude Code CLI is installed and authenticated
claude --version
claude --print "test"   # Should return a response without errors

If claude is not authenticated, run claude login and complete the browser flow.

2. Install and Start

# Review the package source first: https://github.com/atalovesyou/claude-max-api-proxy
npm install -g claude-max-api-proxy
claude-max-api   # Starts on localhost:3456 by default

# Verify:
curl http://localhost:3456/health
# => {"status":"ok","provider":"claude-code-cli",...}

3. Configure Your Client

For OpenClaw (~/.openclaw/openclaw.json):

{
  "env": {
    "OPENAI_API_KEY": "not-needed",
    "OPENAI_BASE_URL": "http://localhost:3456/v1"
  },
  "models": {
    "providers": {
      "openai": {
        "baseUrl": "http://localhost:3456/v1",
        "apiKey": "not-needed",
        "models": [
          { "id": "claude-opus-4", "name": "Claude Opus 4.6 (Max)", "contextWindow": 200000, "maxTokens": 16384 },
          { "id": "claude-sonnet-4", "name": "Claude Sonnet 4.6 (Max)", "contextWindow": 200000, "maxTokens": 16384 },
          { "id": "claude-haiku-4", "name": "Claude Haiku 4.5 (Max)", "contextWindow": 200000, "maxTokens": 8192 }
        ]
      }
    }
  }
}

For any OpenAI-compatible client:

  • Base URL: http://localhost:3456/v1
  • API key: any non-empty string (proxy ignores it)
  • Model IDs: claude-opus-4, claude-sonnet-4, claude-haiku-4

4. Run as Persistent Service (Optional)

# Create systemd user service
# Adjust paths below to match your system — find yours with:
#   which claude-max-api
#   echo $HOME
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/claude-max-api-proxy.service << EOF
[Unit]
Description=Claude Max API Proxy
After=network.target

[Service]
Type=simple
ExecStart=$(which claude-max-api)
Environment=HOME=$HOME
Environment=PATH=$HOME/.npm-global/bin:/usr/local/bin:/usr/bin:/bin
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target
EOF

systemctl --user daemon-reload
systemctl --user enable claude-max-api-proxy
systemctl --user start claude-max-api-proxy

5. Verify

curl http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-4","messages":[{"role":"user","content":"Say: proxy working"}]}'

Model ID Reference

Proxy Model ID CLI Alias Best For
claude-opus-4 opus Complex reasoning, research, long-form
claude-sonnet-4 sonnet Fast + capable, most tasks
claude-haiku-4 haiku Simple tasks, high speed

Common Mistakes

Mistake Fix
claude: command not found npm install -g @anthropic-ai/claude-code
Proxy returns auth errors Run claude login and complete browser auth
Rate limit errors with Max plan Add "maxConcurrency": 1 to agent config; Max has limits
Config not taking effect Restart your agent/client after changing config
Proxy dies on reboot Set up systemd service (Step 4 above)

Cost Comparison

Setup Monthly Cost
Claude Opus 4.6 API (active agent) $200-500+
Claude Max + this proxy $200 flat
Claude Pro + this proxy $20 flat (lower rate limits)

Need Help?

04 同仓库更多 Skills

javimosch
javimosch/open-claw-skills

crowd-prompting

A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.

★ 0
javimosch
javimosch/open-claw-skills

ceaser

Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).

★ 0
javimosch
javimosch/open-claw-skills

ceaser-send

Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.

★ 0
javimosch
javimosch/open-claw-skills

dilemm-ai

Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).

★ 0
javimosch
javimosch/open-claw-skills

moldium

Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.

★ 0
javimosch
javimosch/open-claw-skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.

★ 0