メインコンテンツへスキップ
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-3-pro-image-preview-official",
    "prompt": "A futuristic city skyline with neon lights, cyberpunk style",
    "size": "16:9",
    "n": 1,
    "metadata": {
      "temperature": 1.0,
      "topP": 0.95,
      "resolution": "2K",
      "personGeneration": "ALLOW_ALL",
      "thinkingConfig": {
        "thinkingLevel": "HIGH"
      }
    }
  }'
{
  "id": "task_img_abc123def456",
  "object": "generation.task",
  "model": "gemini-3-pro-image-preview-official",
  "status": "queued",
  "progress": 0,
  "created_at": 1703884800,
  "metadata": {}
}
  • Direct connection to Google Vertex AI using the Gemini 3 Pro Image native API
  • Select the gemini-3-pro-image-preview-official model via the model parameter
  • Supports text-to-image and image-to-image generation
  • Supports native generation parameters like temperature, topP, and maxOutputTokens
  • Supports resolution (1K/2K/4K), personGeneration, and imageOutputOptions image configuration
  • Supports thinkingConfig thinking mode for improved complex scene generation
  • Supports safetySettings for content safety control
  • Asynchronous task management with task ID for result querying
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in image_urls. Please use the Upload Image endpoint to upload images first, then use the returned URL in this API.

Authorizations

Authorization
string
必須
All endpoints require Bearer Token authenticationGet API Key: Visit the API Key Management page to obtain your API KeyAdd to request headers:
Authorization: Bearer YOUR_API_KEY

Body

model
string
デフォルト:"gemini-3-pro-image-preview-official"
必須
Image generation model nameExample: "gemini-3-pro-image-preview-official"
prompt
string
必須
Text description for image generation
size
string
Image aspect ratioSupported formats:
  • 1:1 - Square
  • 3:2 / 2:3
  • 3:4 / 4:3
  • 4:5 / 5:4
  • 9:16 / 16:9
  • 21:9
n
integer
デフォルト:1
Number of images to generateFixed at 1
image_urls
string[]
Reference image URL array for image-to-image generation or editing⚠️ Only URL format is supported (base64 is no longer supported)
  • Publicly accessible image URLs (http:// or https://)
  • Use the Upload Image endpoint to upload local images and get URLs
Limits:
  • Maximum 14 images
  • Maximum file size per image: 10MB
  • Supported formats: .jpeg, .jpg, .png, .webp
metadata
object
Vertex AI native extension parameters

レスポンス

id
string
Unique task identifier for querying task status
object
string
Object type, always generation.task
model
string
モデル name used
status
string
Task status
  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
progress
integer
Task progress percentage (0-100)
created_at
integer
Task creation timestamp (Unix timestamp)
metadata
object
Task metadata
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-3-pro-image-preview-official",
    "prompt": "A futuristic city skyline with neon lights, cyberpunk style",
    "size": "16:9",
    "n": 1,
    "metadata": {
      "temperature": 1.0,
      "topP": 0.95,
      "resolution": "2K",
      "personGeneration": "ALLOW_ALL",
      "thinkingConfig": {
        "thinkingLevel": "HIGH"
      }
    }
  }'
{
  "id": "task_img_abc123def456",
  "object": "generation.task",
  "model": "gemini-3-pro-image-preview-official",
  "status": "queued",
  "progress": 0,
  "created_at": 1703884800,
  "metadata": {}
}