Skip to main content
POST
/
generate
/
k
/
imagen4
Generate images with Imagen4
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/imagen4 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "aspect_ratio": "1:1",
  "negative_prompt": "blurry, low quality",
  "num_images": 1,
  "prompt": "a futuristic cityscape at sunset",
  "seed": 0
}'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Google’s latest image generation model, delivering exceptional image quality and detail representation.

Authorizations

Authorization
string
header
required

Please use your API Token for authentication

Body

application/json

Task parameters

prompt
string
required

Prompt (required, max 5000 characters)

Maximum length: 5000
Example:

"a futuristic cityscape at sunset"

aspect_ratio
enum<string>
default:1:1

Aspect ratio (optional, default 1:1)

Available options:
1:1,
16:9,
9:16,
3:4,
4:3
Example:

"1:1"

negative_prompt
string

Negative prompt (optional)

Example:

"blurry, low quality"

num_images
integer
default:1

Number of images to generate (optional, 1-4, default 1)

Required range: 1 <= x <= 4
Example:

1

seed
integer

Random seed (optional, integer type)

Example:

0

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"