Skip to main content

Thin OpenAI-compatible API proxy backed by Anthropic Vertex AI

Project description

Claude OpenAI Proxy

A thin Python proxy that wraps the Anthropic Vertex AI SDK and exposes an OpenAI-compatible /v1/chat/completions API.

Requests are translated from the OpenAI message format to the Anthropic format, sent to Claude via the Vertex AI API, and the responses are converted back to OpenAI-compatible JSON (or SSE for streaming).

Prerequisites

  • Python 3.11+
  • A Google Cloud project with the Anthropic Vertex AI API enabled
  • Google Cloud credentials configured (e.g. gcloud auth application-default login)

Install

pip install --user claude-openai-proxy

Make sure ~/.local/bin is in your PATH.

More options (uv tool, pipx, from source) are covered in the installation guide.

Run

claude-openai-proxy                          # localhost:1234
HOST=0.0.0.0 PORT=5000 claude-openai-proxy   # all interfaces, custom port

Endpoints

Method Path Description
GET /health Health check
GET /v1/models List available Claude models
POST /v1/chat/completions Chat completions (streaming + sync)

Development

uv sync --group dev

Lint

uv run ruff check .          # check for issues
uv run ruff check --fix .    # auto-fix issues

Format

uv run ruff format .         # format all files
uv run ruff format --check . # check without writing

Test

uv run pytest               # run all tests
uv run pytest -v            # verbose output

Environment Variables

Variable Default Description
HOST 127.0.0.1 Server listen address
PORT 1234 Server listen port
LOG_LEVEL INFO Python logging level
MAX_TOKENS 8192 Default max tokens per response
ANTHROPIC_TIMEOUT 600 Request timeout in seconds for the Anthropic SDK
CLOUD_ML_REGION Google Cloud region (e.g. us-east5)
ANTHROPIC_VERTEX_PROJECT_ID Google Cloud project ID

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_openai_proxy-0.1.5.tar.gz (88.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_openai_proxy-0.1.5-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file claude_openai_proxy-0.1.5.tar.gz.

File metadata

  • Download URL: claude_openai_proxy-0.1.5.tar.gz
  • Upload date:
  • Size: 88.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_openai_proxy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6c2d99d9d47a4fc35c27ab2487a70635339a9152eb506a1e1980ecce19585929
MD5 ee8b94ecb7de7bed6235436b2789c843
BLAKE2b-256 b2d004e71c21fef4497601b6d3309ab58ec6da6a53d85ade28fa7c73e81a5d6a

See more details on using hashes here.

File details

Details for the file claude_openai_proxy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: claude_openai_proxy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_openai_proxy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1af06650f4cbaf69e81160d6eb1058f24573929599121f926220d0b88522573c
MD5 1271501659ebfb616c76e446221e84a3
BLAKE2b-256 aaddd6e129402440fb9c26bcd2ed485995e331dffdc2cc69431bbe0d4b502619

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page