Skip to content

AI Image Generate

AI Image Generate API

Overview

Asynchronous image generation flow:

  1. Call create API to get job_id
  2. Wait about 45-60 seconds
  3. Check job status by job_id
  4. When status = completed, read the image URL from result

Guide & Pricing


Authentication

All requests require Bearer token:

Authorization: Bearer sk_live_your_key

Image Models

Model Notes
nano-banana Standard model
nano-banana-pro Higher quality
nano-banana-fast Speed-optimized
nano-banana-pro-fast Pro + fast
imagen-4.0 Imagen latest
imagen-4 Imagen v4
imagen-4-fast Imagen fast
imagen-4-ultra Imagen ultra
flux-2-pro Flux 2 Pro
seedream-4.5 Seedream 4.5
kling-01-image Kling image
chatgpt-image GPT image
nano-banana-2 Nano Banana 2
grok-image Grok image

Use the exact model IDs available in your account.


1) Create Image Job

  • Method: POST
  • URL: https://ai.revidapi.com/v1/image/generate
  • Content-Type: multipart/form-data

Form-data parameters

Name Type Required Description
prompt string Yes Prompt for image generation
model string Yes Model ID
resolution string No e.g. 1k, 2k, 4k
aspect_ratio string No e.g. 1:1, 16:9, 9:16
speed string No e.g. fast, slow
input_image file No Image input for image-to-image
img_url string No Image URL instead of input_image
server_id string No Routing/server tier if needed

Minimal curl example

curl -X POST https://ai.revidapi.com/v1/image/generate \
  -H "Authorization: Bearer sk_live_your_key" \
  -F "prompt=A futuristic city" \
  -F "model=nano-banana"

Full curl example

curl -X POST https://ai.revidapi.com/v1/image/generate \
  -H "Authorization: Bearer sk_live_your_key" \
  -F "prompt=A cinematic shot..." \
  -F "model=nano-banana-pro" \
  -F "resolution=1k" \
  -F "aspect_ratio=16:9" \
  -F "speed=fast"

Create response example

{
  "job_id": "job_abc123"
}

2) Check Job Status

  • Method: GET
  • URL: https://ai.revidapi.com/v1/jobs/{job_id}

Curl example

curl -X GET "https://ai.revidapi.com/v1/jobs/job_abc123" \
  -H "Authorization: Bearer sk_live_your_key"

Processing response

{
  "status": "processing",
  "result": null
}

Completed response

{
  "status": "completed",
  "result": "https://storage.googleapis.com/.../image.png"
}

Error Codes

Code Error Description
400 Bad Request Missing params or invalid payload/file format.
401 Unauthorized Missing or invalid API key.
402 Insufficient Funds Not enough credits in your account.
403 Forbidden API key has no permission for this resource.
404 Not Found Requested job/resource does not exist.
429 Too Many Requests Rate limit exceeded (1000 req/min).
500 Internal Server Error Internal server error.
503 Service Unavailable Model provider is overloaded or under maintenance.