Generations
The generation APIs are currently provided as a preview. Be aware of the following:
- There might be unannounced breaking changes.
- Any breaking changes to preview APIs won't produce a new API version.
- Public apps that use preview APIs will not pass the review process, and can't be made available to all Canva users.
The generation APIs let you generate content from a text prompt:
- Design generation: Generate a Canva document or presentation.
- Image generation: Generate an image.
Design generation
The generations endpoint lets you generate a Canva document or presentation from a text brief.
Design generation APIs
- Create design generation job: Create an asynchronous job to generate a design.
- Get design generation job: Get the status and results of the generation job, including the generated design.
Image generation
The image generation APIs let you generate an image from a plain-text prompt. A successful job returns the generated image as a download URL that's valid for 24 hours. You can also save the image to the user's Canva account as an image asset, so it appears in their uploads.
The image generation APIs act on behalf of a user, and require the asset:write scope. Starting a job consumes the user's AI credit allowance(opens in a new tab or window).
Models
You can choose the model that generates the image with the model parameter. If you don't set model, Canva selects the best available model for the request.
Model | Value | Status |
|---|---|---|
Lucid Origin | lucid_origin | Available |
Z Image Turbo | z_image_turbo | Available |
If you request a specific model, Canva never uses a different model to serve the request. If that model can't serve the request, the job fails with one of the following error codes:
model_not_available: The model can't serve the request right now. This is usually temporary. Try again later, try again withoutmodel, or use a different model.model_retired: The model has been permanently retired from this version of the API. Use a different model.
Any model can return model_not_available at any time, so your app must handle this error.
A retired model keeps its model value for the lifetime of the API version, and its status in the table above changes to Retired. The model is then removed in the next API version.
Results and retries
- A completed job, and the download URL for its image, are available for 24 hours. Download the image or save it as an asset within that time.
- If you retry a request with the same
idempotency_key, you get the original job, even if that job failed. To start a new attempt, use a new key. - Canva checks both the prompt and the generated image for unsafe content. A prompt can be rejected when you create the job, or the job can fail with the
unsafe_inputerror code.
Image generation APIs
- Create image generation job: Create an asynchronous job to generate an image from a text prompt.
- Get image generation job: Get the status and results of an image generation job, including the generated image.