Create images and videos from scripts and check their status using your account credits.
Pass your API key in the Authorization header. Keep the key in a server environment or a local shell.
Endpoints
GET /api/v1/models lists image and video models and their supported settings.
GET /api/v1/credits returns your available credits.
POST /api/v1/quote calculates the credit cost for a generation request.
POST /api/v1/generate submits a job and returns its task ID. Reuse the same Idempotency-Key header when retrying a request.
GET /api/v1/task?id=TASK_ID returns the job status and results. Include the same authorization when downloading a private relative URL.
Example generation request
{
"model": "gemini-3.1-flash-lite-image",
"mediaType": "image",
"prompt": "A still life of rosemary and lemons in morning light",
"options": {
"aspect_ratio": "1:1",
"resolution": "1K"
}
}
The API returns a JSON envelope with code, message and, on success, data. Poll the task until success or failed.
Quote before submitting and store the API task ID. Keep the API key on the server. A successful job may return private media paths that need the same authorization.
When this helps
A backend starting a render should record its own job ID, the API task ID and the idempotency key so the result can be retrieved separately.
Examples
Store the API task ID with the source assets when another person will pick up the job.
Example
Use one idempotency key for the first submission and all retries of the same local job. Use a new key for a different generation request.
Run your first request
Keep the API key in your server environment.
Quote the job and submit it with an idempotency key.
Poll by task ID and use the same authorization for private result URLs.
Requirements
Authentication
Bearer API key
API version
/api/v1
Task types
Image and video generation
Questions about AI Image and Video Generation API
How do I authenticate API calls?
Send your unlucid ai key in the Authorization header using the Bearer scheme.
Can I quote without submitting?
Yes. Send the request settings to POST /api/v1/quote and review the returned credit estimate.
How do I download private results?
Use the result media path and the same Authorization header used to look up the task.
What should my script save after starting a job?
Save the returned task ID together with the local job identifier. Query the task until it finishes. If the submission timed out, reuse its original idempotency key so your retry can refer to the same job.