Skip to main content
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: 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.
ModelCredits per Generation
Z Image Turbo2
GPT image1.52
Nanobanana 25
Seedream 5.0 Lite5
Seedream 4.55
Nanobanana Pro10
Niji 715
Veo 3.120

Error Responses

All error responses follow this format:
{
  "error": "Error description"
}
Status CodeMeaning
400Bad request — invalid parameters
401Unauthorized — invalid or missing token
402Payment required — insufficient credits
404Not found
429Rate limited
500Server error

Endpoints