SDK Examples

Any Anthropic- or OpenAI-compatible client works — just point it at your configured base URL.

Claude Code / Cursor / Cline / Roo Code

These tools support custom Anthropic base URLs. Set in your IDE settings:

Base URL: https://api.cheapai.cc
API Key: sk-ar-YOUR_KEY_HERE

Anthropic Python SDK

pip install anthropic

from anthropic import Anthropic
client = Anthropic(
    api_key="sk-ar-YOUR_KEY_HERE",
    base_url="https://api.cheapai.cc"
)

OpenAI Python SDK (Compatible Mode)

from openai import OpenAI
client = OpenAI(
    api_key="sk-ar-YOUR_KEY_HERE",
    base_url="https://api.cheapai.cc/v1"
)

Environment Variables

# For Anthropic SDK
ANTHROPIC_API_KEY=sk-ar-YOUR_KEY_HERE
ANTHROPIC_BASE_URL=https://api.cheapai.cc

# For OpenAI-compatible tools
OPENAI_API_KEY=sk-ar-YOUR_KEY_HERE
OPENAI_BASE_URL=https://api.cheapai.cc/v1

Supported Tools

  • Claude Code — Set API key + base URL in settings
  • Cursor — Add as custom Anthropic provider
  • Cline / Roo Code / Kilo Code — Configure in VS Code extension settings
  • Continue — Add as Anthropic provider in .continue/config.json
  • LangChain — Use ChatAnthropic with custom base URL