Base URL
All API requests use the base URL:Authentication
Include your API key in the Authorization header:Get API Key
Learn about authentication →
Available Endpoints
Chat & Completions
Endpoint | Method | Description |
---|---|---|
/v1/chat/completions | POST | Create chat completion (recommended) |
/v1/completions | POST | Create text completion (legacy) |
Embeddings
Endpoint | Method | Description |
---|---|---|
/v1/embeddings | POST | Create text embeddings |
Models
Endpoint | Method | Description |
---|---|---|
/v1/models | GET | List all 218+ models |
/v1/models/phala | GET | List Phala confidential models |
TEE Verification
Endpoint | Method | Description |
---|---|---|
/v1/attestation/report | GET | Get TEE attestation report |
/v1/signature/{request_id} | GET | Get request signature |
Request Format
All POST requests use JSON:Response Format
Successful responses return JSON with 200 status:Error Responses
Errors return appropriate HTTP status codes:Common Status Codes
Code | Meaning |
---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Insufficient credits |
404 | Not Found - Endpoint or model doesn’t exist |
429 | Rate Limit Exceeded |
500 | Server Error |
503 | Service Unavailable |
Error Handling
Learn how to handle errors →
Rate Limits
Rate limits are based on your account tier:Tier | Requests/Min | Tokens/Min |
---|---|---|
Free | 60 | 100,000 |
Pro | 600 | 1,000,000 |
Enterprise | Custom | Custom |
OpenAI Compatibility
RedPill is fully compatible with OpenAI SDKs:Custom Headers
RedPill supports optional custom headers:Header | Description | Example |
---|---|---|
x-redpill-provider | Force specific provider | openai |
x-redpill-trace-id | Custom trace ID | my-trace-123 |
x-redpill-metadata | Custom metadata (JSON) | {"user_id": "123"} |
Streaming
Enable streaming for real-time responses:Streaming Guide
Learn about streaming responses →
SDK Support
RedPill works with official OpenAI SDKs:- ✅ Python SDK (
openai
) - ✅ JavaScript/TypeScript SDK (
openai
) - ✅ Go SDK (
go-openai
) - ✅ Ruby SDK (
ruby-openai
) - ✅ Java SDK (
openai-java
) - ✅ .NET SDK (
Azure.AI.OpenAI
)