XciD's picture
XciD HF Staff
Update README.md
5dc1a90 verified
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:

  1. Transform the request to OpenAI format
  2. Forward to HuggingFace's router
  3. 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