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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_openai_proxy-0.1.4.tar.gz.
File metadata
- Download URL: claude_openai_proxy-0.1.4.tar.gz
- Upload date:
- Size: 91.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9695d51fd5165511a7b3cff24083532a541ee3d64c9017bb535b8979353d097e
|
|
| MD5 |
833ab4cd62cda658d51f9188ea462c94
|
|
| BLAKE2b-256 |
b587b4bd87728863e473473e94260e159ef348d420922ed01ceb1c87f3b57776
|
File details
Details for the file claude_openai_proxy-0.1.4-py3-none-any.whl.
File metadata
- Download URL: claude_openai_proxy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c26be300e718a5a0398e6ef332af6a7aec4048e5f4f15b49e922f9c3c6ce499
|
|
| MD5 |
372c5103c8966bcc9ed8cfa544f6635c
|
|
| BLAKE2b-256 |
5c19fc48c96127604b6050058b22657ba224a695610fb414573aabe04f9e357a
|