Prerequisites: You need an API key from the Developer Portal. All requests
require the
X-API-Key header.Authenticate
Every request must include your API key in the You should receive a JSON response with your profiles (empty if you haven’t created any yet):
X-API-Key header. Verify your key works by listing your profiles:Create a profile
A profile represents a subject whose identity you want to preserve across edits and generations. Provide to
publicly accessible image URLs of the subject (person, dog, or cat):The response includes the new profile ID:
Training starts immediately and runs asynchronously. The profile is not ready for use until training completes. See
the Profiles guide for tips on choosing good training photos.
Poll for training status
Check the profile status until it reaches Possible status values:
READY:| Status | Meaning |
|---|---|
IN_PROGRESS | Training is still running. Poll again in a few seconds. |
READY | Training completed. The profile is ready for edits. |
ERROR | Training failed. Check the message field for details. |
Edit an image
Once the profile is The response contains the generated images as base64-encoded PNGs:
READY, you can reference it in an edit request. Provide input images as base64 strings or public
URLs, along with a text prompt. Pass the user’s profile IDs in the profile_ids field so the API knows which
identities to preserve. You can also use [[profile_id]] in the prompt to reference a specific profile explicitly:Generate an image
You can also generate images from scratch — no input image needed. Reference profiles directly in the prompt using
The response format is the same as
[[profile_id]] syntax:/edit:The
/generate endpoint does not accept images or profile_ids. Reference profiles in the prompt with
[[profile_id]] syntax instead. If you need to transform an existing photo, use /edit.Next steps
Authentication
Learn about API key management and best practices.
Use cases
See detailed examples of each capability with visual previews.
Profiles guide
Deep-dive into profiles, identity preservation, and prompt syntax.
