---
title: "Generate marketing-ready images"
method: POST
path: "/ai/generate-image"
tags: ["AI Services"]
---

# Generate marketing-ready images

`POST /ai/generate-image`

## Request

- Base URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api`
- URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/ai/generate-image`
- Auth: HTTP bearer

Generate branded images with automatic failover between DALL·E 3 and Stable Diffusion XL, with built-in credit tracking.

**For AI agents**: Use when a user asks for social media creatives, hero images, thumbnails, or ad visuals.

## Headers

- `x-app-id` string, required

## Request body

- object
  - `prompt` string, required: Visual description of the desired image.
  - `size` '1024x1024' | '1536x1024' | '1024x1536': Output resolution in pixels.
  - `quality` 'low' | 'medium' | 'high' | 'auto': Rendering quality level.
  - `style` 'professional' | 'creative' | 'minimal' | 'technical': High-level art direction.

## Response `200`

Image generated successfully

- object
  - `imageUrl` string, uri: Signed URL for the generated image (valid for 1 year).
  - `filename` string
  - `revisedPrompt` string: Provider-optimized prompt, if available.
  - `duration` number: Processing time in milliseconds.
  - `creditsRemaining` union: Remaining image credits; admins see `unlimited`.
    - integer
    - string

## Other responses

- `401`: Missing or invalid authentication token
- `402`: Image credits exhausted
- `429`: Rate limit exceeded
- `500`: Provider error or storage failure

---

[API](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api.md) · [All operations](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/revisions/53e075911af9?raw)
