rreAPI Docs
rreAPI Docs
HomeWelcome

Image

midjourney-v8flux-2z-imageqwen-image-2midjourney-v7wan-2-7-imagegpt-image-2gpt-image-2-officialgemini-2.5-flash-image-previewgemini-3-pro-image-previewgemini-3.1-flash-image-previewdoubao-seedream-5-0-liteimagen-4-0

Audio

Mureka V9 Song APIVocal Remover APIMusic Extractor APIVoice Cleaner APIMultistem Splitter APIVoice Changer API

Video

topaz-video-upscalerkling-3-0-turbokling-3-0music-video-1-0wan-2-7-videokling-motion-controlpixverse-v6Seedance 2.5doubao-seedance-2.0doubao-seedance-2.0-officialseedance-2-0-minihappyhorse-1-1happyhorse-1.0happyhorse-1.0-officialviduq3grok-imagine-video-1.5-betagrok-imagine-1.0-videoVeo 3.1gemini-omni

Chat

claude-fable-5minimax-m3deepseek-v4gpt-5.5gpt-5.4claude-opus-4-8claude-opus-4-7claude-sonnet-4-6

Text

ai-essay-writerhumanizeai-text-detector

Tools

enhance-video-1.0
X (Twitter)

imagen-4-0

Google Imagen 4.0 on reAPI — high-fidelity async text-to-image at a flat per-image rate, with five aspect ratios and a single OpenAI-style endpoint.

Google's Imagen 4 model on reAPI. Text-to-image only — no reference images, no inpainting masks. Five aspect ratios at a flat per-image rate. Async-first: submit returns a task_id; poll until ready. See current pricing on the model page.

Quick example

curl https://reapi.ai/api/v1/images/generations \
  -H "Authorization: Bearer rk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-4-0",
    "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k",
    "size": "16:9"
  }'
import requests

resp = requests.post(
    "https://reapi.ai/api/v1/images/generations",
    headers={
        "Authorization": "Bearer rk_live_xxx",
        "Content-Type": "application/json",
    },
    json={
        "model": "imagen-4-0",
        "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k",
        "size": "16:9",
    },
    timeout=30,
)
print(resp.json())
const r = await fetch("https://reapi.ai/api/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer rk_live_xxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "imagen-4-0",
    prompt:
      "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k",
    size: "16:9",
  }),
});
console.log(await r.json());
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    body, _ := json.Marshal(map[string]any{
        "model":  "imagen-4-0",
        "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k",
        "size":   "16:9",
    })
    req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body))
    req.Header.Set("Authorization", "Bearer rk_live_xxx")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    out, _ := io.ReadAll(resp.Body)
    fmt.Println(string(out))
}

The response carries a task_id. Poll GET /api/v1/tasks/{task_id} until status is completed, then read result.images[].url.

Request body

FieldTypeRequiredDefaultDescription
modelstringyes—Must be imagen-4-0.
promptstringyes—Image description. English or Chinese both supported. Up to 4000 characters.
nintegerno1Number of images per request. Only 1 is accepted.
sizestringno16:9Aspect ratio. One of 1:1 / 4:3 / 3:4 / 16:9 / 9:16. Passing an unsupported ratio returns a 400.

imagen-4-0 is text-to-image only. The endpoint rejects image_urls, image, mask, and similar reference fields. For image-to-image, see seedream-5-0-lite or the gemini-3-pro-image-preview family.

Response

Submission returns the standard async envelope:

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
    }
  ]
}

Polled completion (GET /api/v1/tasks/{task_id}):

{
  "code": 200,
  "data": {
    "status": "completed",
    "result": {
      "images": [{ "url": "https://cdn.reapi.ai/..." }]
    }
  }
}

Image URLs are valid for 24 hours from completion. Re-host the asset to your own storage if you need durable access.

Pricing

Flat per-image rate. n is fixed at 1, so total charge is exactly one image per request. See the model page for the live rate.

Errors

imagen-4-0 shares the platform-wide error envelope. The validation surface is small:

  • prompt missing or empty → 400 INVALID_REQUEST.
  • size outside the five accepted ratios → 400 INVALID_REQUEST.
  • n set to any value other than 1 → 400 INVALID_REQUEST.
  • Any reference media (image_urls, image, mask) supplied → 400 INVALID_REQUEST with a text-to-image-only message.

Table of Contents

Quick example
Request body
Response
Pricing
Errors