E2B API Proxy

This is a FastAPI implementation of an API proxy for E2B (fragments.e2b.dev). It provides a compatible interface for various AI model providers including OpenAI, Google, and Anthropic.

API Endpoints

GET /hf/v1/models

List available models

curl http://localhost:7860/hf/v1/models

POST /hf/v1/chat/completions

Send chat completion requests

curl -X POST http://localhost:7860/hf/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-123456" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello, how are you?"}
    ]
  }'

GET /health

Health check endpoint

curl http://localhost:7860/health

Supported Models

The API supports various models from different providers:

View on GitHub