Generate
Generations and Jobs
Generation doesn't finish instantly. When you send a request, you get a job ID. Use that ID to check the status or receive the result via webhook.
Generation requests
POST /generations
| Field | Required | Description |
|---|---|---|
model | Required | Model ID. Find it in the model list. |
input | Required | Model-specific input. Follow parameters in the model details. Options not in the list are rejected with 400 invalid_request. |
webhook_url | Optional | HTTPS URL that receives completion and failure notifications. Up to 2048 characters. |
Idempotency-Key | Optional | Header. 8–128 characters, kept for 24 hours. |
The body takes only model, input, and webhook_url. Any other field is rejected with 400 invalid_request.
curl -X POST https://openapi.aistudio.dropshot.io/v1/generations \
-H "Authorization: Bearer $DROPSHOT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "MODEL_ID",
"input": {
"prompt": "A red fox running through snow"
},
"webhook_url": "https://example.com/webhooks/dropshot"
}'A new request returns 202 with a short job object (id, status, model, credit_cost, created_at), and the model's list price in credits is deducted at that point. Rejected requests are not charged.
{
"id": "api_8f14e45fceea167a5a36dedd4bea2543",
"status": "queued",
"model": "MODEL_ID",
"credit_cost": 150.03,
"created_at": "2026-11-17T09:00:00.123Z"
}Resend
- When you resend after a network error, use the same Idempotency-Key.
- With the same key and the same body, no new job is created and you get 200 with the original job. It is the full job object, the same as a status lookup, not the short 202 object.
- If you send a different body with the same key, you'll get a 409 idempotency_conflict.
- Requests rejected without creating a job, such as 400, 402, or 429, don't record the key. If you fix the cause (for 402, add credits) and resend with the same key, it's accepted as a new request, and a different body won't return 409.
Attachments
Pass images, videos and audio in input as https URLs. You can use URLs on your own server as they are.
Attachment specs such as size, length, resolution and aspect ratio vary by option. Check parameters[].media_input and constraints in GET /models/MODEL_ID.
If an attachment exceeds the spec, doesn't match the option type, or uses an internal network URL, the request is rejected with 400 invalid_request and no credits are deducted.
- A request can include up to 20 attachments in total. More than that is rejected with 400 invalid_request.
- The file format is determined by the file content, not the Content-Type of the response. Even if Content-Type is missing or application/octet-stream, the file is accepted when its content is an image, video, or audio the option accepts. Other formats such as HTML, SVG, or executables are rejected.
- The size is measured by the bytes actually received. Files without Content-Length are accepted, and the download stops and is rejected as soon as it exceeds the maximum size. If Content-Length is larger than the maximum size, the request is rejected before downloading.
- You can also attach result URLs created by the API (output[].url). However, a result URL stays open for at least 24 hours; once the file is deleted and the URL is closed after that, it can't be downloaded and the request is rejected with 400 invalid_request.
- Multiple attachments are downloaded in parallel. If an attachment can't be fully downloaded within 30 seconds for an image, or 5 minutes for a video or audio file, the request is rejected with 400 invalid_request. Attachments without Content-Length wait for their turn when the server is busy, so they may take longer. If the download can't start in time, the request is rejected with 503 server_busy, so wait for the number of seconds in Retry-After and send it again. The response to a generation request comes after all attachments are downloaded, so set your HTTP client's timeout to 6 minutes or more when attaching large files.
Check Status
GET /generations/{id}
| Status | Description |
|---|---|
queued | Waiting. You can only cancel a job in this state. |
processing | Waiting for its turn to generate, or generating |
completed | Completed. The result is in output. |
failed | Failed. The reason is in error, and credits are refunded. |
canceled | Canceled. Credits are refunded. |
Poll every 5 seconds for images and audio, and every 15 seconds for videos. How long it takes depends on the model.
curl https://openapi.aistudio.dropshot.io/v1/generations/$JOB_ID \
-H "Authorization: Bearer $DROPSHOT_API_KEY"
# status: queued | processing | completed | failed | canceledJob response
{
"id": "api_8f14e45fceea167a5a36dedd4bea2543",
"status": "completed",
"model": "MODEL_ID",
"credit_cost": 150.03,
"is_refunded": false,
"created_at": "2026-11-17T09:00:00.123Z",
"completed_at": "2026-11-17T09:01:12.345Z",
"output_expires_at": "2026-11-18T09:01:12.345Z",
"is_output_expired": false,
"error": null,
"output": [
{
"type": "video",
"url": "https://...",
"poster_url": "https://...",
"width": 1280,
"height": 720,
"duration": 5.04,
"text": null
}
]
}| Field | Description |
|---|---|
model | Full model name. It is returned even if the request used the name without the hash. |
credit_cost | Credits deducted for this job. Can be a decimal (e.g. 150.03). |
is_refunded | Whether credits were refunded because of a failure or cancellation |
created_at | When the request was received. All timestamps are ISO 8601 (UTC) with milliseconds. |
completed_at | When the job finished. null while it's still in progress. |
output[] | List of results. Present only when the job is completed and within the retention period; otherwise null. |
output[].type | image · video · audio · text |
output[].url | URL of the output file. null for text output. |
output[].poster_url | URL of the video's poster image |
output[].width · height | Image or video size (px). Can be null even for images when the size is unknown. |
output[].duration | Video or audio length (seconds). Can be a decimal. |
output[].text | Content of the text output |
output_expires_at | When output is hidden from responses: 24 hours after completion. null unless the job is completed. |
is_output_expired | Whether the 24-hour retention period has passed and output is no longer available |
error | Why it failed. Contains code, group, and message. |
Result URLs you receive stay open for at least 24 hours and may close after that. Results aren't saved to your web assets, so download anything you want to keep. Job records remain.
Job list
GET /generations returns the most recent jobs first. You can filter by limit (default 20, max 100), cursor, status, and model. The list doesn't include output.
The response has data and next_cursor. next_cursor is a string or null; pass it as cursor to read the next page. null means the last page, and it is also null when there are no jobs at all.
When filtering by status, next_cursor can be present even if data has fewer items than limit or is empty. The list ends only when next_cursor is null.
If you send a cursor that can't be read, including an empty value (cursor=) or one that is too long, you get 400 invalid_request with details.parameter set to cursor and the reason in details.reason.
If limit or status is invalid, you get the same 400 invalid_request, but details has issues instead of parameter, and issues[].path holds that name.
model also accepts the name without the hash. It's resolved to the full name for filtering, and if the name matches several models or no known model, you get 400 invalid_request. In that case details.parameter is model and details.reason gives the reason. Filter jobs of closed models by the full name shown in the job response.
curl "https://openapi.aistudio.dropshot.io/v1/generations?limit=20&status=completed" \
-H "Authorization: Bearer $DROPSHOT_API_KEY"
# { "data": [...], "next_cursor": "..." | null }Cancel
Only jobs in the queued state can be canceled. When canceled, status becomes canceled and all credits are refunded. No webhook is sent.
For jobs that are processing or already finished, you'll get a 409 generation_not_cancelable.
A job stays queued only for a very short moment after it's accepted. Jobs waiting their turn to generate or already generating have the status processing and can't be canceled.
curl -X POST https://openapi.aistudio.dropshot.io/v1/generations/$JOB_ID/cancel \
-H "Authorization: Bearer $DROPSHOT_API_KEY"