The MeiGen API allows you to generate images programmatically. All endpoints are available at https://www.meigen.ai/api/.
Authentication
API requests require a Bearer token. There are two authentication methods:
API Token (Recommended)
Use an API key that starts with meigen_sk_. Create one from your account settings under API Keys.
Authorization: Bearer meigen_sk_YOUR_API_KEY
API tokens can only use purchased credits. Daily free credits are not available for API calls. Ensure your account has purchased credits before making API requests.
Session Token
For browser-based integrations, you can use a Supabase session access token. This method uses both daily and purchased credits.
Base URL
https://www.meigen.ai/api
Rate Limits
API requests are subject to rate limiting. If you receive a 429 Too Many Requests response, wait before retrying.
Credits
Each generation consumes credits based on the model used. Check the Models page for per-model pricing.
| Model | Credits per Generation |
|---|
| Z Image Turbo | 2 |
| GPT image1.5 | 2 |
| Nanobanana 2 | 5 |
| Seedream 5.0 Lite | 5 |
| Seedream 4.5 | 5 |
| Nanobanana Pro | 10 |
| Niji 7 | 15 |
| Veo 3.1 | 20 |
Error Responses
All error responses follow this format:
{
"error": "Error description"
}
| Status Code | Meaning |
|---|
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — invalid or missing token |
| 402 | Payment required — insufficient credits |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server error |
Endpoints