Get started
Core concepts
Synchronous vs asynchronous
Chat/LLM models are synchronous: the create call returns the answer in a text field. Media models (image/video/audio) are asynchronous: the create call returns a taskId, and you poll (or use a webhook) for the result.
Task states
| state | Meaning |
|---|---|
| waiting | Accepted and queued upstream. |
| generating | The model is running. |
| success | Done — read resultUrls. |
| fail | Failed — read error; credits were refunded. |
Only fail means the task failed. If we briefly cannot reach a running task's status, the poll answers generating rather than an error — the task is still running and was charged once, so keep polling instead of creating it again.
Result URLs
Results are returned as URLs on our own domain (/api/file?t=…) carrying an opaque, signed token. The upstream provider and its storage are never exposed to you or your users.
Credits
A task debits credits when accepted; the amount is returned as creditsCharged. A media task that fails to produce a result is automatically refunded.