Developer Docs
Build with MiniMaxAI API
OpenAI-compatible API. Get started in minutes with your favorite language.
Drop-in Replacement
Full OpenAI Compatibility
Simply change the base URL — all existing OpenAI SDK code works with MiniMaxAI
Quick Start
3 simple steps to start making API calls
1
Get Your API Key
Sign up and create an API key from your dashboard
2
Install SDK
Use the OpenAI SDK — our API is fully compatible
3
Make Your First Call
Start generating images, text, or videos instantly
Code Examples
Ready-to-use code snippets in popular languages
python
import openai
client = openai.OpenAI(
base_url="https://api.minimaxai.shop/v1",
api_key="your-api-key"
)
# Image Generation
response = client.images.generate(
model="sora-image",
prompt="A sunset over mountains",
n=1,
size="1024x1024"
)
print(response.data[0].url)javascript
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.minimaxai.shop/v1',
apiKey: 'your-api-key',
});
// Image Generation
const response = await client.images.generate({
model: 'sora-image',
prompt: 'A sunset over mountains',
n: 1,
size: '1024x1024',
});
console.log(response.data[0].url);curl
curl https://api.minimaxai.shop/v1/images/generations \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-image",
"prompt": "A sunset over mountains",
"n": 1,
"size": "1024x1024"
}'API Reference
Authentication
Learn how to authenticate your API requests using API keys
→
Image Generation
Generate images with models like Sora Image, Flux, and Nano Banana
→
Video Generation
Create videos using Sora 2, Veo 3.1, and other video models
→
Text Generation
Chat completions with GPT-4o, Gemini, Claude, and more
→
Error Handling
Handle errors gracefully with our standardized error codes
→
Rate Limits
Understand rate limits and how to optimize your requests
→