Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
metadata
title: Anthropic Messages Proxy
emoji: 🔄
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
Anthropic Messages Proxy
A proxy that transforms Anthropic's /v1/messages API format to OpenAI's /v1/chat/completions format.
Usage
Send requests to /v1/messages using the Anthropic API format. The proxy will:
- Transform the request to OpenAI format
- Forward to HuggingFace's router
- Transform the response back to Anthropic format
Example
curl -X POST https://YOUR_SPACE.hf.space/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HF_TOKEN" \
-d '{
"model": "Qwen/Qwen2.5-72B-Instruct",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Features
- Full Anthropic Messages API format support
- Streaming (SSE) transformation
- Tool use / function calling support
- Image support (base64 and URL)
- Error format transformation