AI

Create an AI image generation job

Queue a Nano Banana or Grok Imagine image job on the Railway worker. Returns job_id immediately. Poll /api/v1/ai/image-jobs/{id} for urls. This spends AI credits. Gemini thinking_level does not change the credit price (model + resolution do).

post/api/v1/ai/generate-image

Request

  • Base URL: https://www.poster.ly
  • URL: https://www.poster.ly/api/v1/ai/generate-image
  • Auth: HTTP bearer

Request body

workspace_idstring

Optional. The workspace this call acts in and whose plan and credits it uses (from whoami). Needed only when the key can act in several workspaces.

promptstring required
aspect_ratiostring
stylestring
variationsinteger
provider'google' | 'xai'
model'lite' | 'flash' | 'pro'

Google Nano Banana tier. Ignored when provider is xai.

resolution'1K' | '2K' | '4K'

Google Nano Banana 2.1 supports 1K, 2K, and 4K. 512 is no longer available and returns a 400. xAI Grok supports only 1K and 2K.

quality'low' | 'medium' | 'high'

Google: high enables Gemini thinking. xAI: low or medium credit tiers.

thinking_level'minimal' | 'high'

Google flash/lite thinking. Overrides quality when both are set.

reference_image_urlsstring[]

Google only. Up to 14 HTTPS reference images.

Example request

{
  "prompt": "A clean product launch image for a social media scheduler",
  "aspect_ratio": "1:1",
  "style": "professional"
}

Response

Image generation job accepted

job_idstring required
status'pending' | 'processing' | 'completed' | 'failed' required
messagestring
provider'google' | 'xai'
modelstring
resolutionstring
thinking_level'minimal' | 'high'
credits_usednumber required

Example response

{
  "job_id": "4f4b0f3a-11c6-4ef0-b4fd-3d0e14b32701",
  "status": "pending",
  "message": "Image generation started. Poll /api/v1/ai/image-jobs/{id} for status and urls.",
  "provider": "google",
  "model": "flash",
  "resolution": "1K",
  "thinking_level": "minimal",
  "credits_used": 15
}

Changes

No recorded changes to this operation across all 1 revision of this API.