Skip to content

Seedream/4.5 Text To Image API Documentation

Generate content using the 4.5 Text To Image model

Generate content using the 4.5 Edit

Pricing: 12 credits per image (≈ $0.032)

Overview

This document describes how to use the 4.5 Text To Image model for content generation. The process consists of two steps:

  1. Create a generation task

  2. Query task status and results

Authentication

All API requests require a Bearer Token in the request header:

x-api-key: YOUR_API_KEY

Get API Key:

  1. Visit API Key to get your API Key

  2. Add to request header: x-api-key: YOUR_API_KEY


1. Create Generation Task

API Information

  • URL: POST https://api.revidapi.com/paid/seedream/create
  • Header: x-api-key : Your-API-Key

Request Parameters

Parameter Type Required Description
model string Yes Model name, format: seedream/4.5-text-to-image
input object Yes Input parameters object
callBackUrl string No Callback URL for task completion notifications. If provided, the system will send POST requests to this URL when the task completes (success or fail). If not provided, no callback notifications will be sent. Example: "https://your-domain.com/api/callback"

Model Parameter

The model parameter specifies which AI model to use for content generation.

Model Price Description
seedream/4.5-text-to-image 12 credit The exact model identifier for this API
seedream/4.5-edit 12 credit The exact model identifier for this API

Type string Must be passed as a string value Required yes This parameter is mandatory for all requests

Note: The model parameter must match exactly as shown above. Different models have different capabilities and parameter requirements.

Callback URL Parameter

The callBackUrl parameter allows you to receive automatic notifications when your task completes.

Property Value Description
Purpose Task completion notification Receive real-time updates when your task finishes
Method POST request The system sends POST requests to your callback URL
Timing When task completes Notifications sent for both success and failure states
Content Query Task API response Callback content structure is identical to the Query Task API response
Parameters Complete request data The param field contains the complete Create Task request parameters, not just the input section
Optional Yes If not provided, no callback notifications will be sent

Important Notes: - The callback content structure is identical to the Query Task API response - The param field contains the complete Create Task request parameters, not just the input section
- If callBackUrl is not provided, no callback notifications will be sent

input Object Parameters

prompt

  • Type: string
  • Required: Yes
  • Description: A text description of the image you want to generate
  • Max Length: 3000 characters
  • Default Value: "A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of \"commercial attributes + aesthetic design.\" Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio."

aspect_ratio

  • Type: string
  • Required: Yes
  • Description: Width-height ratio of the image, determining its visual form.
  • Options:
  • 1:1: 1:1
  • 4:3: 4:3
  • 3:4: 3:4
  • 16:9: 16:9
  • 9:16: 9:16
  • 2:3: 2:3
  • 3:2: 3:2
  • 21:9: 21:9
  • Default Value: "1:1"

quality

  • Type: string
  • Required: Yes
  • Description: Basic outputs 2K images, while High outputs 4K images.
  • Options:
  • basic: Basic
  • high: High
  • Default Value: "basic"

Request Example

{
  "model": "seedream/4.5-text-to-image",
  "input": {
    "prompt": "A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of \"commercial attributes + aesthetic design.\" Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio.",
    "aspect_ratio": "1:1",
    "quality": "basic"
  }
}

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "281e5b0*********************f39b9"
  }
}

Response Parameters

Parameter Type Description
code integer Response status code, 200 indicates success
msg string Response message
data.taskId string Task ID for querying task status

2. Query Task Status

API Information

  • URL: POST https://api.revidapi.com/paid/get/taskid
  • Parameter: taskId (passed via URL parameter)

Request Example

POST https://api.revidapi.com/paid/get/taskid?taskId=281e5b0*********************f39b9

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "281e5b0*********************f39b9",
    "model": "seedream/4.5-text-to-image",
    "state": "waiting",
    "param": "{\"model\":\"seedream/4.5-text-to-image\",\"input\":{\"prompt\":\"A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of \\"commercial attributes + aesthetic design.\\" Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio.\",\"aspect_ratio\":\"1:1\",\"quality\":\"basic\"}}",
    "resultJson": "{\"resultUrls\":[\"https://static.aiquickdraw.com/tools/example/1764852542872_Bz0RzMXs.webp\"]}",
    "failCode": null,
    "failMsg": null,
    "costTime": null,
    "completeTime": null,
    "createTime": 1757584164490
  }
}

Response Parameters

Parameter Type Description
code integer Response status code, 200 indicates success
msg string Response message
data.taskId string Task ID
data.model string Model name used
data.state string Task status: waiting(waiting), success(success), fail(fail)
data.param string Task parameters (JSON string)
data.resultJson string Task result (JSON string, available when task is success). Structure depends on outputMediaType: {resultUrls: []} for image/media/video, {resultObject: {}} for text
data.failCode string Failure code (available when task fails)
data.failMsg string Failure message (available when task fails)
data.costTime integer Task duration in milliseconds (available when task is success)
data.completeTime integer Completion timestamp (available when task is success)
data.createTime integer Creation timestamp

Usage Flow

  1. Create Task: Call POST https://api.revidapi.com/paid/seedream/create to create a generation task
  2. Get Task ID: Extract taskId from the response
  3. Wait for Results:
  4. If you provided a callBackUrl, wait for the callback notification
  5. If no callBackUrl, poll status by calling POST https://api.revidapi.com/paid/get/taskid
  6. Get Results: When state is success, extract generation results from resultJson

Error Codes

Status Code Description
200 Request successful
400 Invalid request parameters
401 Authentication failed, please check API Key
402 Insufficient account balance
404 Resource not found
422 Parameter validation failed
429 Request rate limit exceeded
500 Internal server error