Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Use this endpoint for unified async polling across task types such as video, image, music, and 3D generation. If a create response includes poll_url, call that exact path. Some image models may return task-based responses under either an image-specific status path or /v1/tasks/{id}.

Path Parameters

id
string
required
The task ID returned by the create request.

Response

id
string
Canonical async task identifier.
task_id
string
Async task identifier alias.
poll_url
string
Preferred polling URL when the create response supplies one.
status
string
Task status such as pending, processing, completed, or failed. Cancelled tasks are represented as failed with cancelled: true.
cancelled
boolean
true when a queued async task was cancelled before execution.
cancellation_status
string
Cancellation marker. Present as cancelled when cancellation succeeds.
data
array
For completed image tasks, generated image results are returned here. Image tasks return URLs in data[].url.
progress
number
Progress percentage when available.
video_url
string
Result asset URL when the task completes and produces a video.
video
object
Single video payload with url, duration, width, and height when available.
videos
array
Multiple video payloads when more than one output is available.
error
string
Error message when the task fails.
created
integer
Creation timestamp when available.
updated
integer
Last update timestamp when available.
model
string
Model used by the task when available.

Error Behavior

If the task no longer exists, has expired, or cannot be resolved through the public async-task contract, LemonData returns:
{
  "error": {
    "message": "Task not found or no longer available.",
    "type": "invalid_request_error",
    "code": "async_task_not_found"
  }
}

Examples

curl "https://api.lemondata.cc/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
  -H "Authorization: Bearer sk-your-api-key"
Python
import requests

poll_url = "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
response = requests.get(
    f"https://api.lemondata.cc{poll_url}",
    headers={"Authorization": "Bearer sk-your-api-key"},
)
print(response.json())
JavaScript
const pollUrl = '/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const response = await fetch(`https://api.lemondata.cc${pollUrl}`, {
  headers: { Authorization: 'Bearer sk-your-api-key' },
});
console.log(await response.json());