Routescope APIRoutescope API
Image Models

Imagen

Imagen Fast, Standard, and Ultra image generation overview

Imagen uses the Gemini Native predict protocol with path /v1beta/models/{model}:predict. This page explains how to choose Fast, Standard, and Ultra models and how their parameters differ.

Endpoint Path

MethodPathPurpose
POST/v1beta/models/{model}:predictImagen image generation
POST
/v1beta/models/{model}:predict
curl -X POST "https://api.routescope.ai/v1beta/models/gpt-4o-mini:predict" \  -H "Content-Type: application/json" \  -d '{}'
{}

Authorization

BearerAuth

AuthorizationBearer <token>

Model relay interface recognition. Request heading: Autoration: Bearer .

In: header

Path Parameters

model*string

Gemini model name.

Request Body

application/json

[key: string]?any

Response Body

application/json

Model Selection

Model IDSpeed / QualityTypical Use
imagen-4.0-fast-generate-001Speed firstLow-latency sketches, prototyping, and batch creative exploration.
imagen-4.0-generate-001Standard qualityHigh-quality photorealistic images, illustrations, product visuals, and general creative assets.
imagen-4.0-ultra-generate-001Highest qualityBrand hero visuals, refined product images, and quality-sensitive scenarios.

Common Parameters

FieldTypeRequiredDefaultDescription
instancesarrayYesNonePrediction input array. Imagen usually needs one instance.
instances[].promptstringYesNoneEnglish prompt. Official guidance recommends a maximum of 480 tokens.
parameters.sampleCountintegerNo4Number of images to generate, from 1 to 4. For Ultra, keep it around 1 to 2.
parameters.aspectRatiostringNo1:1Aspect ratio. Supports 1:1, 3:4, 4:3, 9:16, 16:9.
parameters.personGenerationstringNoallow_adultPerson generation policy. Supports dont_allow, allow_adult, and allow_all; some regions do not allow allow_all.

Model-Specific Parameters

FieldApplicable ModelsDefault / RangeDescription
parameters.imageSizeFastDefault 1K; availability depends on the channelFast-version availability depends on the channel.
parameters.imageSizeStandard / UltraDefault 1K; supports 1K and 2KStandard and Ultra support 1K and 2K.

Example Code

curl "https://api.routescope.ai/v1beta/models/imagen-4.0-generate-001:predict" \
  -H "Authorization: Bearer $ROUTESCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instances": [
      { "prompt": "A premium SaaS API gateway product poster, dark background, crisp typography" }
    ],
    "parameters": {
      "sampleCount": 1,
      "aspectRatio": "16:9",
      "imageSize": "2K",
      "personGeneration": "dont_allow"
    }
  }'

Response Structure

Imagen responses use a predictions array. Images are returned through bytesBase64Encoded and mimeType. Do not rewrite them as Gemini candidates or OpenAI data responses.

Notes

  • Billing follows the model and channel ratios configured in the backend.
  • Fast prioritizes speed. For complex text and high-fidelity posters, prefer Standard or Ultra.
  • Imagen 4 outputs include a SynthID watermark.
  • Keep sampleCount controlled during batch generation to avoid oversized requests and timeout.

How is this guide?

Last updated on