Skip to content

Latest commit

Β 

History

History
179 lines (128 loc) Β· 3.95 KB

File metadata and controls

179 lines (128 loc) Β· 3.95 KB

πŸ’Έ ddollar

Never hit token limits again πŸ”₯

Run AI CLI tools all night with automatic token rotation. Zero config.

export ANTHROPIC_API_KEY=sk-ant-...
ddollar claude --continue
# Go to bed. Wake up to finished task.

🎯 What It Does

  • πŸ” Monitors rate limits every 60 seconds
  • πŸŒ™ Auto-rotates tokens when >95% used
  • ⚑ Gracefully restarts with --continue
  • πŸ’€ Run agents all night, zero babysitting

Supported: OpenAI Β· Anthropic Β· Cohere Β· Google AI


🎬 Quick Start

# Set tokens
export ANTHROPIC_API_KEY=sk-ant-...
export ANTHROPIC_API_KEY_2=sk-ant-...

# Run any CLI tool with auto rotation
ddollar claude --continue

# Interactive mode (prompts on limit hit)
ddollar --interactive python long_script.py

What happens:

6pm:  Start with token 1
2am:  95% of token 1 used β†’ rotate to token 2 β†’ restart
4am:  95% of token 2 used β†’ rotate to token 3 β†’ restart
8am:  Task done πŸŽ‰

⚑ Install

macOS/Linux:

curl -LO https://github.com/ahoward/ddollar/releases/latest/download/ddollar-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)
chmod +x ddollar-*
sudo mv ddollar-* /usr/local/bin/ddollar

Build from source:

git clone https://github.com/ahoward/ddollar.git
cd ddollar
go build -o ddollar ./src

πŸš€ Usage

# Run any long-running CLI
ddollar claude --continue
ddollar python train_model.py
ddollar node agent.js

# Interactive mode (get prompted on limit hit)
ddollar --interactive claude --continue

Multiple tokens (3 ways):

# 1. Comma-separated
export ANTHROPIC_API_KEY=sk-ant-primary...
export ANTHROPIC_API_KEYS=sk-ant-1...,sk-ant-2...,sk-ant-3...

# 2. File with one token per line
echo "sk-ant-1..." > ~/.ddollar-keys
echo "sk-ant-2..." >> ~/.ddollar-keys
export ANTHROPIC_API_KEYS_FILE=~/.ddollar-keys

# 3. Mix and match (all get deduplicated)
export ANTHROPIC_API_KEY=sk-ant-primary...
export ANTHROPIC_API_KEYS=sk-ant-1...,sk-ant-2...
export ANTHROPIC_API_KEYS_FILE=~/.ddollar-keys

ddollar claude --continue
# Rotates through ALL discovered tokens

πŸ› οΈ How It Works

  1. Spawns your command with token in ENV
  2. Makes 1-token API call every 60s to check rate limits
  3. When >95% used β†’ SIGTERM subprocess β†’ rotate token β†’ restart
  4. Your tool's --continue flag picks up where it left off

KISS: No proxy, no DNS, no config. Just process supervision + token rotation.


πŸ•΅οΈ Tor Integration (Mask Your IP)

Use ddollar with Tor to anonymize your API requests:

# Install Tor
sudo apt-get install tor        # Linux
brew install tor                # macOS

# Start Tor daemon
sudo systemctl start tor        # Linux
brew services start tor         # macOS

# Run through Tor
torify ddollar claude --continue

Benefits:

  • πŸ”’ Hide your IP from AI providers
  • πŸ”„ New IP with each token rotation
  • 🌍 Geographic diversity (different exit nodes)
  • πŸ›‘οΈ Multi-account isolation

Advanced usage:

# Multiple tokens + Tor = new IP per rotation
export ANTHROPIC_API_KEYS=key1,key2,key3
torify ddollar claude --continue

# Verify Tor is working
torify curl -s https://api.ipify.org

See docs/TOR_INTEGRATION.md for:

  • Per-token Tor circuits
  • Auto-renewing circuits on rotation
  • Country-specific exit nodes
  • Performance optimization
  • Security considerations

πŸ› Troubleshooting

  • "No tokens found" β†’ Set ANTHROPIC_API_KEY (etc) in shell
  • Process won't rotate β†’ Tool must support --continue flag
  • Limit hit before rotation β†’ Tokens hitting limits faster than 60s check interval

πŸ“¦ Platforms

βœ… macOS (Intel + Apple Silicon) βœ… Linux (x86_64 + ARM64) βœ… Windows (x86_64)

Single binary. No dependencies. No runtime.


🀝 Contributing

PRs welcome. Issues welcome. GitHub


max out those tokens πŸ’ΈπŸ”₯

an #n5 joint 🚬