Skip to main content

Base URLs

MegaLLM supports two API formats:

OpenAI Format

https://ai.megallm.io/v1
Compatible with OpenAI SDKs and tools

Anthropic Format

https://ai.megallm.io
Compatible with Anthropic Claude SDKs

Authentication

All API endpoints require authentication using one of these methods:
Authorization: Bearer YOUR_API_KEY

API Key Header (Anthropic Format)

x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
Get your API key from the MegaLLM Dashboard.

Core Endpoints

Advanced Features

Quick Start

  • Python
  • JavaScript
  • cURL
from openai import OpenAI

client = OpenAI(
    base_url="https://ai.megallm.io/v1",
    api_key="your-api-key"
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)

Rate Limits

Rate limits vary by plan tier:
TierRequests/minTokens/minConcurrent
Basic6090K10
Pro300450K40
EnterpriseCustomCustomCustom

SDK Support

MegaLLM is compatible with popular AI SDKs:
  • Python: openai, anthropic, langchain
  • JavaScript/TypeScript: openai, @anthropic-ai/sdk
  • Go: go-openai
  • Ruby: anthropic-rb
  • Rust: async-openai
  • Java: openai-java
  • C#: OpenAI-DotNet

Need Help?