Gemini 2.5 Flash

3D AI Studio

Gemini 2.5 Flash

Google Gemini 2.5 Flash image API reference. Cost-effective AI image generation and editing. Ideal for high-volume applications via REST API.

Generate Image

POST

/v1/images/gemini/2.5/flash/generate/

Generate images from a text prompt at a flat rate of 5 credits per image. Gemini 2.5 Flash is the most cost-effective Gemini model, ideal for high-volume workflows. Supports batch generation of up to 4 images.

Request
curl -X POST https://api.3daistudio.com/v1/images/gemini/2.5/flash/generate/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a watercolor painting of a mountain landscape",
    "output_format": "png",
    "aspect_ratio": "16:9",
    "num_images": 4
  }'
Response
{
  "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "created_at": "2026-02-25T12:00:00Z"
}

Generate Parameters

ParameterTypeRequiredDescription
promptstringYesText description of the image to generate.
output_formatstringNo"png", "jpeg", or "webp". Default: "png".
aspect_ratiostringNo"auto", "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", or "9:16". Default: "auto".
num_imagesintegerNoNumber of images (1 to 4). Default: 1. Credits multiply accordingly.

Edit Image

POST

/v1/images/gemini/2.5/flash/edit/

Edit existing images with natural-language instructions. Provide one or more base64-encoded source images and a text prompt describing the desired changes.

Request
curl -X POST https://api.3daistudio.com/v1/images/gemini/2.5/flash/edit/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Make the sky more dramatic with storm clouds",
    "images": ["data:image/png;base64,iVBOR..."],
    "output_format": "png"
  }'
Response
{
  "task_id": "f7e8d9c0-b1a2-3456-7890-abcdef012345",
  "created_at": "2026-02-25T12:00:00Z"
}

Edit Parameters

ParameterTypeRequiredDescription
promptstringYesText instruction describing the edit to apply.
imagesarrayYesArray of 1 to 14 base64-encoded source images (data:image/...;base64,...).
output_formatstringNo"png", "jpeg", or "webp". Default: "png".
aspect_ratiostringNoOutput aspect ratio. Default: "auto".
num_imagesintegerNoNumber of output images (1 to 4). Default: 1.

Checking Status

GET

/v1/generation-request/<task_id>/status/

Poll this endpoint with the task_id from the submit response. When status is "FINISHED", the results array contains your generated or edited images with download URLs and thumbnails. Results expire after 24 hours.

Request
curl https://api.3daistudio.com/v1/generation-request/YOUR_TASK_ID/status/ \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "status": "FINISHED",
  "progress": 100,
  "results": [
    {
      "asset_url": "https://cdn.3daistudio.com/images/img_001.png",
      "asset": "https://storage.3daistudio.com/assets/img_001.png",
      "asset_type": "IMAGE",
      "thumbnail": "https://storage.3daistudio.com/thumbnails/img_001.png"
    }
  ]
}

Credit Costs

Gemini 2.5 Flash has a flat rate with no resolution tiers. This makes it the most affordable Gemini model for high-volume use cases.

ModelPer Image
Gemini 2.5 Flash5 credits

Processing Times

Image generation typically takes 30–60 seconds per image. Editing takes a similar amount of time depending on the complexity of the edit. Batch requests (multiple images) may take longer.

Errors

Common errors for Gemini 2.5 Flash image endpoints.

StatusError CodeDescription
402insufficient_creditsNot enough credits. Top up your wallet.
429rate_limitedRate limit exceeded. Wait and retry.
400validation_failedMissing or invalid parameters.