Generate Image
generate_imageCreate an image from the user's prompt with AdaptlyPost AI and save it to the user's own AI image studio in AdaptlyPost. Nothing is posted. It returns { jobId, sessionId, status } right away with status queued; poll get_image_job with the jobId every few seconds until status is completed or failed (usually 10 to 40 seconds). A completed job carries imageUrl, which can go straight into mediaUrls of create_post. Reuse sessionId to keep related images together. Needs the ai.generate permission, which Admin, Editor and Contributor hold and Viewer does not (403 permission_denied). Uses the member's AdaptlyPost AI credits (2 for standard, 4 for premium, none when the member connected their own image provider key) and refunds them if the job fails. With no credits left the job fails with an error saying so; tell the user and do not retry.
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 image URLs the user provided, such as publicUrl values from upload_media, to guide the style or subject |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | An object with jobId (pass it to get_image_job), sessionId, and status (queued). |