Generate Image
generate_imageStart generating an image from a prompt with AdaptlyPost AI. This is asynchronous: it returns { jobId, sessionId, status } right away with status queued, not the image. Poll get_image_job with the jobId every few seconds until status is completed or failed (usually 10 to 40 seconds), or wait for the image.completed or image.failed webhook if the workspace has one. A completed job carries imageUrl, a public URL you can pass straight into mediaUrls of create_post, so there is no need to run it through upload_media. The image is also saved to the member's AI image studio in AdaptlyPost; reuse sessionId to group related images. Needs the ai.generate permission, which Admin, Editor and Contributor hold and Viewer does not (403 permission_denied). Charges the member's AI credits when generation starts (2 for standard, 4 for premium) unless the member has their own image provider key connected in AdaptlyPost, and refunds them if generation fails. With no credits left the job ends as failed and its error says so: explain that generation is unavailable with the current credit balance and do not retry automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | standard (default, 2 credits) or premium (higher fidelity, 4 credits) | |
| prompt | Yes | What the image should show, including style and composition (max 2000 characters) | |
| quality | No | LOW, MEDIUM or HIGH rendering quality | |
| sessionId | No | Image studio session to add the image to, as returned by an earlier generate_image. Omit to start a new session | |
| aspectRatio | No | Image shape (default 1:1). Pick one that suits the target platform, e.g. 9:16 for stories and reels, 4:5 for Instagram feed, 16:9 for YouTube and X | |
| workspaceId | No | Workspace to act in: an id from list_workspaces. Omit to act in the workspace list_workspaces marks current. Use the same workspaceId for every call about the same workspace, since ids from one workspace (accounts, posts, uploads) do not exist in another | |
| referenceImages | No | Up to 5 public image URLs that steer the style or subject of the result |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | An object with jobId (pass it to get_image_job), sessionId, and status (queued). |