Base URL
The Gateway API is available at:- Production:
https://api.llmgateway.io - Local Development:
http://localhost:4001
Key Features
Multi-Provider Support
Route requests to multiple providers including:- OpenAI
- Anthropic
- Google Vertex AI
- AWS Bedrock
- Azure OpenAI
- And more
Intelligent Routing
The gateway automatically:- Selects the best provider based on cost, latency, and uptime
- Falls back to alternative providers on failure
- Routes to model-specific providers when requested
- Handles provider-specific request/response transformations
Cost Optimization
- Automatic selection of cheapest available provider
- Response caching with Redis to reduce redundant requests
- Usage tracking and cost analytics
- Support for free models
Enterprise Features
- API key management
- Organization and project isolation
- IAM-based access control
- Rate limiting and usage quotas
- Data retention controls
- Guardrails and content filtering
API Endpoints
The Gateway API exposes the following endpoints:| Endpoint | Description |
|---|---|
POST /v1/chat/completions | Create chat completions using OpenAI format |
POST /v1/images/generations | Generate images from text prompts |
POST /v1/images/edits | Edit images with text prompts |
GET /v1/models | List all available models |
POST /v1/messages | Create messages using Anthropic format |
GET / | Health check endpoint |
GET /metrics | Prometheus metrics |
Content Type
All POST requests must include theContent-Type: application/json header. The gateway validates this and returns a 415 Unsupported Media Type error if missing.
Exceptions:
/mcpendpoint (handles its own content type validation)/oauthendpoints (accept form-urlencoded or JSON)/v1/images/editsendpoint (accepts multipart/form-data for file uploads)
Error Handling
The gateway returns standardized error responses:400- Bad Request (invalid parameters)401- Unauthorized (missing or invalid API key)402- Payment Required (insufficient credits)403- Forbidden (IAM policy violation)410- Gone (project archived)415- Unsupported Media Type (missing Content-Type header)429- Too Many Requests (rate limit exceeded)499- Client Closed Request (client disconnected)500- Internal Server Error503- Service Unavailable (health check failed)504- Gateway Timeout (upstream provider timeout)
Health Check
The root endpoint/ provides health status:
skip- Comma-separated list of health checks to skip (e.g.,redis,database)
Next Steps
Authentication
Learn how to authenticate with the Gateway API
Chat Completions
Create chat completions with multiple providers
Images
Generate and edit images
Models
List available models and capabilities