ClaudeCode Bridge

OpenAI-compatible API bridge using Claude Code OAuth for Claude Max

Status

Checking...
Checking...

Authentication

Manual Code Flow Required
Claude's OAuth only allows their official redirect URLs. After authorizing, you'll see a success page with a code - copy and paste it below.

Step 1: Start Login

This opens Claude's authorization page. Click "Authorize" there.

Step 2: Paste the Code

After authorizing, you'll be redirected to a page showing a code. Copy that code and paste it here:

Available Models

Loading...

Usage

Use this bridge as an OpenAI-compatible API endpoint:

Base URL

Python Example

from openai import OpenAI

client = OpenAI(
    base_url="/v1",
    api_key="not-needed"  # Auth handled by bridge
)

response = client.chat.completions.create(
    model="claude-sonnet-4-20250514",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

cURL Example

curl /v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

API Endpoints

GET  /health              - Health check
GET  /auth/status          - Check authentication status
POST /auth/start           - Start OAuth flow
POST /auth/callback        - Submit auth code manually
POST /auth/refresh         - Refresh access token
POST /auth/logout          - Clear authentication

GET  /v1/models            - List available models
GET  /v1/models/:id        - Get model details
POST /v1/chat/completions  - Chat completion (OpenAI-compatible)
POST /v1/completions       - Text completion (legacy)