---
title: "Submit Task"
method: POST
path: "/v1/common_task/text2image/task/submit"
tags: ["AI Image"]
---

# Submit Task

`POST /v1/common_task/text2image/task/submit`

Submit a text-to-image generation task. The system will generate images based on the provided prompt and model specifications.

## Headers

- `Topview-Uid` string, required
- `Authorization` string, required

## Request body

- object
  - `model` string, required — Model name (required), e.g., 'DALL-E 3', 'Midjourney v6', 'Stable Diffusion XL'
  - `prompt` string, required — Positive prompt (required) describing the image to generate
  - `aspectRatio` string — Aspect ratio, e.g., '1:1', '16:9', '9:16', '4:3'
  - `generateCount` integer — Number of images to generate (1-4)
  - `resolution` string — Resolution, e.g., '1K', '2K', '4K', '512p'
  - `boardId` string — Board ID (optional). If provided, the task will be associated with this board.
  - `noticeUrl` string — Callback URL for task completion notifications (optional). The system will send a POST request to this URL when the task is completed with task status and results.

## Response `200`

Task submitted successfully

- object
  - `code` string — Response code
  - `message` string — Response message
  - `result` object
    - `taskId` string — Unique task identifier
    - `status` 'init' | 'running' | 'success' | 'fail' — Task status
    - `errorMsg` string, nullable — Error message if task submission failed
    - `subTaskId` string, nullable — Sub-task identifier (optional)
    - `boardTaskIds` string[], nullable — List of board task IDs (if task is associated with a board)
    - `boardId` string, nullable — Associated board ID (if provided in request)
    - `noticeUuid` string, nullable — UUID for callback notification tracking

---

[API](https://skmtc.net/topview/apis/image-character-swap-apis-editable-in-readme.md) · [All operations](https://skmtc.net/topview/apis/image-character-swap-apis-editable-in-readme/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/topview/image-character-swap-apis-editable-in-readme/revisions/83cd46ca7859/schema)
