Base URL:
https://ai.megallm.io/v1 for all OpenAI-compatible endpointsAvailable Endpoints
Chat Completions
Generate conversational responses with GPT models
Streaming
Real-time streaming responses with Server-Sent Events
Function Calling
Execute functions and tools with parallel support
Models
Browse available models and capabilities
Quick Example
Supported Models
| Model | Context Window | Use Case |
|---|---|---|
gpt-4 | 8,192 tokens | Complex reasoning, analysis |
gpt-4-32k | 32,768 tokens | Long documents, extensive context |
gpt-4-turbo | 128,000 tokens | Large-scale processing |
gpt-3.5-turbo | 16,385 tokens | Fast, cost-effective responses |
Features
Full Compatibility
Drop-in replacement for OpenAI API - use your existing code without changes.High Performance
Fast response times with optimized infrastructure.Usage Tracking
Monitor your API usage and costs.SDK Support
MegaLLM works with all OpenAI-compatible SDKs:- Python:
openaiofficial SDK - Node.js:
openaiofficial SDK - Go:
go-openai - Rust:
async-openai - Java:
openai-java - C#:
OpenAI-DotNet
Rate Limits
| Tier | Requests/min | Tokens/min |
|---|---|---|
| Basic | 60 | 90,000 |
| Pro | 300 | 450,000 |
| Enterprise | Custom | Custom |
Migration Guide
Migrating from OpenAI to MegaLLM is simple:Error Handling
MegaLLM returns OpenAI-compatible error responses:Next Steps
- Explore Chat Completions for conversational AI
- Learn about Function Calling for tool integration
- Implement Streaming for real-time responses

