⚓ AIProxy

Claude API Proxy · Load Balancing · Custom Authentication

⚔ THIS SYSTEM IS OUT OF SCOPE ⚔

External security assessment activities are prohibited

⚙ Example Code Package

Pre-configured Python implementation ready for immediate deployment.

Download Code Archive

Deployment Guide

1Extract Package

Retrieve and extract the example code archive.

unzip cptc-ai-example.zip
cd cptc-ai-example

2Install Dependencies

Install required dependencies using uv:

uv sync

Installation command for uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

3Configure Credentials

Initialize configuration file:

cp config.yaml.example config.yaml

Update config.yaml with your credentials:

api_key: your_custom_api_key_here  # e.g., sk-cptc-alice
base_url: 

4Execute

uv run main.py

Response from Claude will include usage metrics.

API Operations

Base Endpoint

Authentication Protocol

Provide credentials via x-api-key header:

x-api-key: sk-cptc-your-key-here

Request Example (curl)

curl /v1/messages \
  -H "x-api-key: sk-cptc-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5-20250929",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello, Claude!"}
    ]
  }'

Available Endpoints

⚙ Rate Limit Monitor

Verify current rate limit status for your API key.

Python SDK Integration

Implementation using the Anthropic Python SDK:

from anthropic import Anthropic

client = Anthropic(
    api_key="sk-cptc-your-key",
    base_url=""
)

message = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(message.content[0].text)

Claude Code CLI Integration

Configure Anthropic's Claude Code CLI to use this proxy server.

Installation: Install Claude Code CLI

Environment Configuration

Set the following environment variables in your shell:

export ANTHROPIC_BASE_URL=""
export ANTHROPIC_AUTH_TOKEN="sk-cptc-your-key-here"

Add to Shell Profile

To make these settings persistent, add them to your shell profile (~/.bashrc, ~/.zshrc, etc.):

echo 'export ANTHROPIC_BASE_URL=""' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-cptc-your-key-here"' >> ~/.bashrc
source ~/.bashrc

Verify Configuration

Test your Claude Code setup:

claude-code --version
# Claude Code will now use your custom API endpoint
Support: For API key provisioning or technical issues, contact your system administrator.

📚 Anthropic Documentation & Resources