Skip to main content
POST
/
images
/
generate
curl --request POST \
  --url https://rawugc.com/api/v1/images/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "nano-banana-2",
  "prompt": "Comic poster: cool banana hero in shades leaps from sci-fi pad",
  "aspectRatio": "16:9",
  "resolution": "1K",
  "outputFormat": "jpg"
}
'
{
  "imageId": "<string>",
  "model": "<string>",
  "status": "pending",
  "creditsUsed": 123,
  "newBalance": 123,
  "estimatedCompletionTime": "<string>",
  "createdAt": 123
}

Authorizations

Authorization
string
header
required

Use your API key from the RawUGC dashboard. Include as: Authorization: Bearer YOUR_API_KEY

Body

application/json
model
enum<string>
required

Image generation model. 'google/nano-banana-edit' for image editing (2 credits), 'nano-banana-2' for text-to-image (4 credits).

Available options:
google/nano-banana-edit,
nano-banana-2
prompt
string
required

Text description of the image to generate or the edit to apply.

Required string length: 1 - 20000
imageUrls
string<uri>[]

Image URLs. Required for google/nano-banana-edit (source images to edit). Optional for nano-banana-2 (reference images, max 14). Must be publicly accessible HTTP/HTTPS URLs.

Maximum array length: 14
imageSize
enum<string>

Aspect ratio for google/nano-banana-edit model.

Available options:
1:1,
9:16,
16:9,
3:4,
4:3,
3:2,
2:3,
5:4,
4:5,
21:9,
auto
outputFormat
enum<string>

Output image format. Defaults to jpg for nano-banana-2, png for nano-banana-edit.

Available options:
png,
jpeg,
jpg
aspectRatio
enum<string>

Aspect ratio for nano-banana-2 model. Defaults to auto.

Available options:
1:1,
1:4,
1:8,
2:3,
3:2,
3:4,
4:1,
4:3,
4:5,
5:4,
8:1,
9:16,
16:9,
21:9,
auto

Use Google Web Search grounding to generate images based on real-time information (nano-banana-2 only). Defaults to false.

resolution
enum<string>

Output resolution for nano-banana-2 model. Defaults to 1K.

Available options:
1K,
2K,
4K

Response

Image generation initiated

imageId
string

Unique image identifier (img_xxx format)

model
string

Image model used for generation

status
enum<string>

Current generation status

Available options:
pending,
processing,
completed,
failed
creditsUsed
number

Number of credits deducted for this generation

newBalance
number

Remaining credit balance after deduction

estimatedCompletionTime
string

Estimated time until image is ready (human-readable)

createdAt
number

Timestamp when generation was initiated (milliseconds since epoch)