Claude Code model router

Claude2openai Proxy

Claude API client to OpenAI API compatible API gateway/proxy. This can run Claude-Code with OpenAI API

Install

From source
git clone https://github.com/ziozzang/claude2openai-proxy.git

From the README

claude-to-openai proxy

Overview
FastAPI proxy translating Anthropic-style /v1/messages to OpenAI via LiteLLM. Handles model mapping, content block conversion, streaming (SSE), tools, and token counting with reduced logging noise.

- Original code came from: https://github.com/1rgs/claude-code-proxy
- fixed for generic usages

Features
- Model mapping via env and prefixes (anthropic/* passthrough, openai/* normalized)
- Content-block to OpenAI messages conversion (text/image/tool_use/tool_result)
- SSE streaming compatible with Anthropic clients
- Tool calls passthrough; converts to Anthropic tool_use blocks on response
- Token counting endpoint using LiteLLM token_counter
- Minimal logging with filtered noise and pretty request logs
- OpenAPI schema and Swagger UI with Anthropic-compatible models and endpoint docs

Run

API Docs (OpenAPI / Swagger)
- OpenAPI JSON: GET /_openapi.json or /openapi.json (FastAPI default)
- Swagger UI: GET /docs
- ReDoc: GET /redoc

App metadata (title/description/version) and schema descriptions are embedded so the docs reflect the Anthropic request/response shapes and streaming behavior.

Anthropic Compatibility Notes
- Endpoints accept Anthropic Messages API-shaped payloads.
- Streaming when stream=true returns Anthropic-style SSE events in this order:
  - message_start → content_block_start (text) → content_block_delta(n) → content_block_stop
  - optional tool call blocks: content_block_start (tool_use) → input_json_delta(n) → content_block_stop
  - message_delta (includes stop_reason, usage) → message_stop → final data: [DONE]
- Tooling:
  - Request tools follow Anthropic tools[] with name, description, input_schema (JSON Schema).
  - Responses may include tool_use blocks for Claude-family models; for non-Claude models, tool info is…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
3 August 2025

FAQ

What is Claude2openai Proxy?

Claude API client to OpenAI API compatible API gateway/proxy. This can run Claude-Code with OpenAI API It is a model router for Claude Code, from ziozzang/claude2openai-proxy on GitHub.

How do I install Claude2openai Proxy?

Clone ziozzang/claude2openai-proxy from GitHub and follow the setup steps in its README.

Is Claude2openai Proxy popular?

ziozzang/claude2openai-proxy has 30 GitHub stars and 6 forks. It was last updated on 3 August 2025.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.