Generate a post image

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Generates the image for a single post and saves it on the plan.

The post's own image_prompt wins over the image_prompt you send, so the request body only decides the prompt for a post that has none. To change an image that already exists, send refinement_instruction.

<Note>If the post already has an image_url and you send no refinement_instruction, the existing image is returned as-is. Nothing is generated and no credits are charged.</Note>

Generating an image costs 1 credit and fails with a 402 when the workspace is out of quota. Image generation is budgeted at up to 60 seconds per attempt, so use a client timeout above that.

This endpoint is limited to 12 requests per minute, separately from the other social content endpoints.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>

post/api/apps/{app_id}/virality/posts/{post_id}/generate-image

Path parameters

post_idstring required

ID of the post, as returned in the content plan. Must be a UUID.

ID of the post, as returned in the content plan. Must be a UUID.

app_idstring required

ID of the app.

ID of the app.

Request body

image_promptstring required

Prompt to generate the image from. Used only when the post carries no image_prompt of its own, which is the prompt the plan generated for it. Send the post's own image_prompt back if you want to be sure of what is used.

refinement_instructionstring nullable

What to change about the existing image. Sending this regenerates the image even when the post already has one. The first 300 characters are used.

Example request

{
  "image_prompt": "A freelancer closing a laptop at a tidy desk, warm morning light",
  "refinement_instruction": "Make the lighting cooler and remove the coffee cup."
}

Response

Successful Response

image_urlstring nullable

URL of the post image.

Example response

{
  "image_url": "https://storage.base44.com/virality/3f2504e0.png",
  "plan": {
    "id": "8c1f9a2e-3b7d-4c5e-9f01-2a3b4c5d6e7f",
    "app_id": "6820f3a4e7b91d003c45a1f2",
    "strategy": {
      "app_summary": "A CRM for freelancers who want to track leads without a spreadsheet.",
      "marketing_approach": "Lead with the spreadsheet pain, then show the app solving it.",
      "platforms": [
        {
          "reasoning": "Instagram rewards a consistent series, so these build on each other.",
          "posts": [
            {
              "id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
              "angle_label": "Pain point",
              "post_number": 1,
              "total_posts": 5,
              "suggested_day": 1,
              "rationale": "Opens on the spreadsheet frustration the audience already has.",
              "content": "Still tracking leads in a spreadsheet? I built the thing I wanted instead.",
              "image_url": "https://storage.base44.com/virality/3f2504e0.png",
              "image_prompt": "A freelancer closing a laptop at a tidy desk, warm morning light",
              "hashtags": [
                "freelance",
                "buildinpublic"
              ],
              "post_title": "I built a CRM because spreadsheets kept losing my leads",
              "suggested_subreddits": [
                "r/freelance",
                "r/SideProject"
              ],
              "launch_comment": "Happy to answer questions about how it works.",
              "option_label": "Direct and personal",
              "best_for_context": "Best if your audience already knows you"
            }
          ]
        }
      ]
    },
    "created_at": "2026-08-24T09:15:00+00:00",
    "updated_at": "2026-08-24T10:02:00+00:00"
  }
}

Changes

Changed in 1 of the 11 revisions of this API.1