Prerequisites
Before you start, please confirm the following:Create an imini account
Visit imini.ai to register and verify your email.
Create an API Key
Go to the API Keys management page, create an API Key for server-side use, and store it securely.
Base URL
All imini Open Platform endpoints share the same base URL:/v1/images/generate) should be appended to this base URL.
Authentication
Every request authenticates via an HTTP header using the Bearer Token standard:Asynchronous Task Model
All generation endpoints on imini (image and video) use an asynchronous task model. A complete generation flow is two steps:The image task query endpoint is
/v1/images/tasks/{task_id}; the video task query endpoint is /v1/videos/tasks/{task_id}. A polling interval of 2 seconds is recommended. Image tasks typically complete within 10–30 seconds.Step 1: Submit the Generation Task
The example below uses thegoogle/nano-banana model to generate a 1:1 image:
Step 2: Poll the Task Result
Use thetask_id returned above to poll until status becomes succeeded or failed:
| Status | Meaning |
|---|---|
queued | Task submitted, waiting to enter the processing queue |
processing | Model is generating |
succeeded | Generation succeeded, result is in the images[] field |
failed | Generation failed, details in the error object |
status: succeeded):
Error Handling
All error responses share a unified structure:| Status | Meaning | Typical cause |
|---|---|---|
400 | Invalid request parameters | Missing required field, invalid enum value, or prompt flagged by content safety |
401 | Authentication failed | API Key missing, invalid, or revoked |
402 | Insufficient credits | Account balance cannot cover this call |
404 | Resource not found | The specified task_id does not exist or has expired |
429 | Rate limit exceeded | Exceeded your account’s rate quota; back off and retry |
500 | Internal platform error | Platform-side issue; please retry later |
502 | Upstream model error | Underlying model service unavailable; usually safe to retry immediately |
Production Integration Tips
Before integrating imini into production, review the following practices:- Set reasonable polling intervals: We recommend a first poll at 2 seconds, then exponential backoff (2s / 3s / 5s) to reduce pressure on the query endpoint.
- Configure sensible timeouts: Use a 30-second timeout for submission calls. Set overall polling timeouts based on the model (e.g., 2 minutes for image, 10 minutes for video).
- Error retry strategy: For
429,500, and502, retry 2–3 times with random jitter. Do not retry400,401, or402. - API Key rotation: Store API Keys in a secrets manager (KMS / Secrets Manager), rotate them regularly, and use separate keys per business scenario for observability and isolation.
- Idempotency and request tracing: Record the submitted
task_idandrequest_idon your side to reconcile against platform logs. - Content safety: We recommend pre-screening user-supplied prompts and reference images on your side to reduce the likelihood of triggering
400content-violation errors.
Next Steps
API Reference
Full parameter definitions and an interactive Playground for each model
Pricing
Credit consumption rules by model, resolution, and scenario
Changelog
Track new model launches, parameter changes, and service updates
Terms & Policies
Please read the Terms of Service and Privacy Policy before onboarding

