Common Conventions
- All interfaces require request headers
Authorization: Bearer <apiKey>andTopview-Uid: <userId>- Successful response unified structure:
{ "code": "200", "message": "Success", "result": { ... } }- After task submission, returns
taskId. Frontend polls the query interface to get results
I. Text-to-Image
1.1 Submit Task
POST /v1/common_task/text2image/task/submit
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Topview-Uid | string | Yes | User ID |
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model display name, e.g., "Nano Banana 2", "Seedream 5.0", see supported models table below |
prompt | string | Yes | Positive prompt text |
aspectRatio | string | Yes | Aspect ratio, supported values vary by model, see supported models table below |
resolution | string | Model-dependent | Resolution, e.g., "512p", "1K", "2K", "4K"; required for some models, not supported by others, see supported models table below |
quality | string | Model-dependent | Quality tier: low / medium / high (case-insensitive). Supported only by GPT Image 2 and Reve Image; defaults to medium when omitted; not allowed for other models |
generateCount | integer | Yes | Number of images to generate, 1~4 |
boardId | string | No | Board ID. When provided, a task record will be created in the Board |
Supported Models and Parameter Constraints
Note: The
modelparameter should use the model display name (e.g.,"Nano Banana 2"), not the code.
| Model Name | Aspect Ratio Options (aspectRatio) | Resolution (resolution) | Quality (quality) | Remarks |
|---|---|---|---|---|
| Nano Banana 2 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 4:1, 1:4, 8:1, 1:8 | 512p, 1K, 2K, 4K (required) | Not supported, do not pass | Supports 14 aspect ratios |
| Nano Banana 2 Lite | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 4:1, 1:4, 8:1, 1:8 | 1K (required, only supports 1K) | Not supported, do not pass | Supports 14 aspect ratios |
| Nano Banana Pro | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | |
| Nano Banana | 9:16, 3:4, 1:1, 4:3, 16:9 | Not supported, do not pass | Not supported, do not pass | |
| Seedream 5.0 Pro | auto, 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | auto means the model automatically determines the aspect ratio |
| Seedream 5.0 Lite | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K (required, only supports 2K) | Not supported, do not pass | JSON standard name; Seedream 5.0 is a compatibility alias |
| Seedream 5.0 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K (required, only supports 2K) | Not supported, do not pass | Compatibility alias, equivalent to Seedream 5.0 Lite |
| Seedream 4.5 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K, 4K (required) | Not supported, do not pass | auto means the model automatically determines the aspect ratio |
| Seedream 4.0 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | auto means the model automatically determines the aspect ratio |
| Reve Image | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9 | 1K, 2K, 4K (required) | low / medium / high (optional, default medium) | Text-to-Image only |
| Midjourney v8.1 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | Not supported, do not pass | Not supported, do not pass | Supports 13 aspect ratios |
| Midjourney v7 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | Not supported, do not pass | Not supported, do not pass | Supports 13 aspect ratios |
| Wan 2.7 Image Pro | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2 | 1K, 2K, 4K (required) | Not supported, do not pass | |
| Wan 2.7 Image | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2 | 1K, 2K (required) | Not supported, do not pass | |
| Kling V3 Omni | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | |
| Kling V3 | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | |
| Kling 2.1 | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | |
| Grok Image Quality | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 20:9, 9:20, 19.5:9, 9:19.5 | 1K, 2K (required) | Not supported, do not pass | Supports 13 aspect ratios |
| Grok Image | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 20:9, 9:20, 19.5:9, 9:19.5 | 1K, 2K (required) | Not supported, do not pass | Supports 13 aspect ratios |
| GPT Image 2 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | 1K, 2K, 4K (required) | low / medium / high (optional, default medium) | Supports 13 aspect ratios |
| Kontext-Pro | 9:16, 3:4, 1:1, 4:3, 16:9 | Not supported, do not pass | Not supported, do not pass | |
| Imagen 4 | 9:16, 3:4, 1:1, 4:3, 16:9 | Not supported, do not pass | Not supported, do not pass |
aspectRatio: Required for all models, must be one of the supported ratios for that modelresolution: Models marked as "required" must pass this parameter; models marked as "not supported, do not pass" will return an error if providedquality: Supported only by GPT Image 2 and Reve Image; defaults tomediumwhen omitted; other models return an error if providedgenerateCount:1~4, required
Request Example
POST /v1/common_task/text2image/task/submit
Topview-Uid: user_123
{
"model": "GPT Image 2",
"prompt": "A futuristic city skyline at dusk, neon lights reflected on wet streets, cinematic composition",
"aspectRatio": "16:9",
"resolution": "2K",
"quality": "high",
"generateCount": 2
}Response Example
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_t2i_20251128001",
"status": "success",
"noticeUuid": "uuid_abc"
}
}If
boardIdis provided, the response will additionally returnboardTaskIdsandboardIdfields.
1.2 Query Task Result
GET /v1/common_task/text2image/task/query
Request Parameters (Query)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
taskId | string | Yes | - | Task ID returned from submission |
needCloudFrontUrl | boolean | No | false | Whether to return CloudFront URL |
Request Example
GET /v1/common_task/text2image/task/query?taskId=task_t2i_20251128001
Topview-Uid: user_123
Response Example (In Progress)
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_t2i_20251128001",
"status": "running",
"errorMsg": null,
"costCredit": "0.000",
"images": []
}
}Response Example (Success)
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_t2i_20251128001",
"status": "success",
"errorMsg": null,
"costCredit": "0.400",
"images": [
{
"status": "success",
"errorMsg": null,
"fileId": "file_img_001",
"filePath": "https://cdn.example.com/images/output_001.jpg",
"width": 2560,
"height": 1440,
"boardTaskId": null
},
{
"status": "success",
"errorMsg": null,
"fileId": "file_img_002",
"filePath": "https://cdn.example.com/images/output_002.jpg",
"width": 2560,
"height": 1440,
"boardTaskId": null
}
]
}
}Response Example (Failure)
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_t2i_20251128001",
"status": "fail",
"errorMsg": "Model service unavailable",
"costCredit": "0.000",
"images": []
}
}II. Image Edit
Image editing supports generating edited images by providing one or more reference images + a prompt. Supports instruction-based modifications, style transfer, and other scenarios.
2.1 Submit Task
POST /v1/common_task/image_edit/task/submit
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Topview-Uid | string | Yes | User ID |
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model display name, e.g., "Seedream 5.0", "Kontext-Pro", see supported models table below |
prompt | string | Yes | Edit prompt text describing the modifications to be made to the image |
inputImageFileIds | string[] | Yes | List of reference image fileIds, maximum quantity varies by model (get fileId from upload interface) |
aspectRatio | string | Yes | Aspect ratio; Seedream / Nano Banana / Kontext-Pro series support "auto" (follow input image ratio), see supported models table below |
resolution | string | Model-dependent | Resolution, e.g., "512p", "1K", "2K", "4K"; required for some models, not supported by others, see supported models table below |
quality | string | Model-dependent | Quality tier: low / medium / high (case-insensitive). Supported only by GPT Image 2, Reve Image Edit, and Reve Image Remix; defaults to medium when omitted; not allowed for other models |
generateCount | integer | Yes | Number of images to generate, 1~4 |
boardId | string | No | Board ID. When provided, a task record will be created in the Board |
Supported Models and Parameter Constraints
Note: The
modelparameter should use the model display name (e.g.,"Seedream 5.0"), not the code.
| Model Name | Aspect Ratio Options (aspectRatio) | Resolution (resolution) | Quality (quality) | Max Input Images | Remarks |
|---|---|---|---|---|---|
| Nano Banana 2 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 4:1, 1:4, 8:1, 1:8 | 512p, 1K, 2K, 4K (required) | Not supported, do not pass | 14 | auto follows input image ratio |
| Nano Banana 2 Lite | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 4:1, 1:4, 8:1, 1:8 | 1K (required, only supports 1K) | Not supported, do not pass | 14 | auto follows input image ratio |
| Nano Banana Pro | auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | 6 | auto follows input image ratio |
| Nano Banana | auto, 9:16, 3:4, 1:1, 4:3, 16:9 | Not supported, do not pass | Not supported, do not pass | 6 | auto follows input image ratio |
| Seedream 5.0 Pro | auto, 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | 14 | auto follows input image ratio |
| Seedream 5.0 Lite | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K (required, only supports 2K) | Not supported, do not pass | 14 | JSON standard name; Seedream 5.0 is alias |
| Seedream 5.0 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K (required, only supports 2K) | Not supported, do not pass | 14 | Compatibility alias |
| Seedream 4.5 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 2K, 4K (required) | Not supported, do not pass | 14 | auto follows input image ratio |
| Seedream 4.0 | auto, 9:16, 3:4, 1:1, 4:3, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | 5 | auto follows input image ratio |
| Reve Image Edit | auto, 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9 | 1K, 2K, 4K (required) | low / medium / high (optional, default medium) | 1 | Image Edit only; single image mode |
| Reve Image Remix | auto, 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9 | 1K, 2K, 4K (required) | low / medium / high (optional, default medium) | 6 | Image Edit only; multi-image mode |
| Midjourney v8.1 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | Not supported, do not pass | Not supported, do not pass | 4 | Supports 13 aspect ratios |
| Midjourney v7 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | Not supported, do not pass | Not supported, do not pass | 4 | Supports 13 aspect ratios |
| Wan 2.7 Image Pro | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2 | 1K, 2K (required) | Not supported, do not pass | 9 | |
| Wan 2.7 Image | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2 | 1K, 2K (required) | Not supported, do not pass | 9 | |
| Kling V3 Omni | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K, 4K (required) | Not supported, do not pass | 10 | |
| Kling V3 | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | 4 | |
| Kling 2.1 | 9:16, 3:4, 2:3, 1:1, 3:2, 4:3, 16:9, 21:9 | 1K, 2K (required) | Not supported, do not pass | 4 | |
| Grok Image Quality | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 20:9, 9:20, 19.5:9, 9:19.5 | 1K, 2K (required) | Not supported, do not pass | 3 | |
| Grok Image | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 20:9, 9:20, 19.5:9, 9:19.5 | 1K, 2K (required) | Not supported, do not pass | 3 | |
| GPT Image 2 | 9:16, 3:4, 1:1, 4:3, 16:9, 2:3, 3:2, 5:4, 4:5, 21:9, 9:21, 1:2, 2:1 | 1K, 2K, 4K (required) | low / medium / high (optional, default medium) | 16 | Supports 13 aspect ratios |
| Kontext-Pro | auto, 9:16, 3:4, 1:1, 4:3, 16:9 | Not supported, do not pass | Not supported, do not pass | 1 | Specialized for image editing; single image mode |
Request Example
POST /v1/common_task/image_edit/task/submit
Topview-Uid: user_123
{
"model": "GPT Image 2",
"prompt": "Change the background to a snowy mountain landscape, keep the subject unchanged",
"inputImageFileIds": ["file_src_img_001"],
"aspectRatio": "1:1",
"resolution": "2K",
"quality": "medium",
"generateCount": 1
}Request Example (Multi-Image Reference)
POST /v1/common_task/image_edit/task/submit
Topview-Uid: user_123
{
"model": "Nano Banana 2",
"prompt": "Blend the style of both images into a unified artistic composition",
"inputImageFileIds": ["file_img_style001", "file_img_content001"],
"aspectRatio": "1:1",
"resolution": "2K",
"generateCount": 2
}Response Example
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_ie_20251228001",
"status": "success",
"noticeUuid": "uuid_ie_xyz"
}
}If
boardIdis provided, the response will additionally returnboardTaskIdsandboardIdfields.
2.2 Query Task Result
GET /v1/common_task/image_edit/task/query
Request Parameters (Query)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
taskId | string | Yes | - | Task ID returned from submission |
needCloudFrontUrl | boolean | No | false | Whether to return CloudFront URL |
Request Example
GET /v1/common_task/image_edit/task/query?taskId=task_ie_20251228001
Topview-Uid: user_123
Response Example (Success)
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_ie_20251228001",
"status": "success",
"errorMsg": null,
"costCredit": "0.200",
"images": [
{
"status": "success",
"errorMsg": null,
"fileId": "file_edited_001",
"filePath": "https://cdn.example.com/images/edited_001.jpg",
"width": 2560,
"height": 1440,
"boardTaskId": null
}
]
}
}Response Example (Partial Success)
{
"code": "200",
"message": "Success",
"result": {
"taskId": "task_ie_20251228002",
"status": "success",
"errorMsg": "Partial tasks failed (1/2): Content policy violation",
"costCredit": "0.200",
"images": [
{
"status": "success",
"errorMsg": null,
"fileId": "file_edited_002",
"filePath": "https://cdn.example.com/images/edited_002.jpg",
"width": 2560,
"height": 1440,
"boardTaskId": null
},
{
"status": "fail",
"errorMsg": "Content policy violation",
"fileId": null,
"filePath": null,
"width": null,
"height": null,
"boardTaskId": null
}
]
}
}III. Common Specifications
Task Status Enumeration
| Status Value | Meaning |
|---|---|
init | Task submitted, waiting for processing |
running | Task is being processed |
success | Task completed successfully |
fail | Task failed, see errorMsg field for error reason |
Polling Recommendations
Recommended polling interval: 3–5 seconds, timeout should be set to 5 minutes.
Sub-tasks in images
imagesWhen generateCount > 1, the images list contains multiple sub-task results. Each sub-task has an independent status.
- Parent task
status=success: All sub-tasks are completed (some sub-tasks may befail, check the sub-task'sstatusanderrorMsg) - Parent task
status=fail: All sub-tasks failed
When partial failures occur, the parent task's errorMsg summarizes the failure reasons, e.g., "Partial tasks failed (1/2): Content policy violation".
Query Response Fields
| Field | Type | Description |
|---|---|---|
taskId | string | Task ID |
status | string | Task status, see enumeration above |
errorMsg | string | Error message (has value when task fails or partially fails) |
costCredit | number | Credits consumed by task (floating point number) |
boardId | string | Associated Board ID (returned if task comes from Board) |
images | array | List of generated image results, each item contains: status, errorMsg, fileId, filePath, width, height, boardTaskId |
IV. Credit Billing Explanation
totalCost = unitCost × generateCount
Credit types: Text-to-Image is
common_task_text2image, Image Edit iscommon_task_image_edit.
Billing Explanation: Credits are deducted when the task is submitted, settled based on actual consumption when the task succeeds, and refunded if the task fails.
Pricing Rules:
- Models that support
quality: preferpricing[resolution_quality](e.g.,pricing["2K_high"]); when omitted, API defaults tomedium - Models with
resolutionbut withoutquality: price bypricing[resolution](e.g.,pricing["2K"]) - Models without
resolutionparameter: price bypricing["default"]
4.1 Text-to-Image (textToImage) Pricing Table
Models Billed by Resolution (Unit: Credits/Generation, generateCount=1)
| Model Name | 512p | 1K | 2K | 4K |
|---|---|---|---|---|
| Nano Banana 2 | 0.25 | 0.40 | 0.60 | 0.85 |
| Nano Banana 2 Lite | — | 0.30 | — | — |
| Nano Banana Pro | — | 0.80 | 0.80 | 1.40 |
| Seedream 5.0 Pro | — | 0.40 | 0.80 | — |
| Seedream 5.0 Lite | — | — | 0.20 | — |
| Seedream 5.0 | — | — | 0.20 | — |
| Seedream 4.5 | — | — | 0.20 | 0.20 |
| Seedream 4.0 | — | 0.15 | 0.15 | 0.15 |
| Reve Image | — | 1.60 | 1.80 | 2.00 |
| Grok Image Quality | — | 0.60 | 1.00 | — |
| Grok Image | — | 0.30 | 0.30 | — |
| GPT Image 2 | — | 0.20 | 0.80 | 1.40 |
| Kling 2.1 | — | 0.15 | 0.15 | — |
| Kling V3 | — | 0.30 | 0.30 | — |
| Kling V3 Omni | — | 0.30 | 0.30 | 0.60 |
| Wan 2.7 Image | — | 0.40 | 0.40 | — |
| Wan 2.7 Image Pro | — | 0.80 | 0.80 | 0.80 |
Fixed Price Models (Unit: Credits/Generation, not differentiated by resolution)
| Model Name | Unit Price |
|---|---|
| Nano Banana | 0.30 |
| Kontext-Pro | 0.50 |
| Imagen 4 | 0.50 |
| Midjourney v8.1 | 0.50 |
| Midjourney v7 | 0.50 |
4.2 Image Edit (imageEdit) Pricing Table
Image Edit pricing follows Text-to-Image model pricing in general. Image Edit does not include Imagen 4, GPT Image 1.5, or Reve Image;
Reve Image Edit/Reve Image Remixsupport Image Edit only;Wan 2.7 Image Proin Image Edit supports only1K/2K(no4Kpricing).
Models Billed by Resolution (Unit: Credits/Generation, generateCount=1)
| Model Name | 512p | 1K | 2K | 4K |
|---|---|---|---|---|
| Nano Banana 2 | 0.25 | 0.40 | 0.60 | 0.85 |
| Nano Banana 2 Lite | — | 0.30 | — | — |
| Nano Banana Pro | — | 0.80 | 0.80 | 1.40 |
| Seedream 5.0 Pro | — | 0.40 | 0.80 | — |
| Seedream 5.0 Lite | — | — | 0.20 | — |
| Seedream 5.0 | — | — | 0.20 | — |
| Seedream 4.5 | — | — | 0.20 | 0.20 |
| Seedream 4.0 | — | 0.15 | 0.15 | 0.15 |
| Reve Image Edit | — | 1.60 | 1.80 | 2.00 |
| Reve Image Remix | — | 1.60 | 1.80 | 2.00 |
| Grok Image Quality | — | 0.60 | 1.00 | — |
| Grok Image | — | 0.30 | 0.30 | — |
| GPT Image 2 | — | 0.20 | 0.80 | 1.40 |
| Kling 2.1 | — | 0.15 | 0.15 | — |
| Kling V3 | — | 0.30 | 0.30 | — |
| Kling V3 Omni | — | 0.30 | 0.30 | 0.60 |
| Wan 2.7 Image | — | 0.40 | 0.40 | — |
| Wan 2.7 Image Pro | — | 0.80 | 0.80 | — |
Fixed Price Models (Unit: Credits/Generation, not differentiated by resolution)
| Model Name | Unit Price |
|---|---|
| Nano Banana | 0.30 |
| Kontext-Pro | 0.50 |
| Midjourney v8.1 | 0.50 |
| Midjourney v7 | 0.50 |