Skip to main content
This guide uses the REST API so you can see the complete request lifecycle. It takes about five minutes.

Prerequisites

API credentials grant access to your account and credits. Use them only in server-side code and never commit them to source control.

1. Configure credentials

2. Submit a generation

The initial response has the queued status:

3. Check the result

Repeat the status request until it reaches a terminal state. A completed image request returns:
The other terminal statuses are failed, nsfw, and canceled.

Next steps

Use an SDK

Submit and wait for results with Python or TypeScript.

Prepare for production

Add backoff, timeouts, terminal-state handling, and webhooks.