> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mountsea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 图片生成

> 根据文本提示词独立生成 Suno 图片

提交独立图片生成任务，通过 [查询任务状态](/zh/api-reference/suno/task) 轮询至 `success`。

## 积分

| `image_gen_category` | 费用                                                          |
| -------------------- | ----------------------------------------------------------- |
| `basic`              | 0 积分/张                                                      |
| `advanced`           | 按策略扣减（如 `conf_task_policy[image_generate].cost`，默认 20 积分/张） |

总费用 = **每张积分 × 数量**。系统内部固定生成 **2** 张，不对外暴露 `quantity` 参数。

## 结果

任务完成后 `result` 包含 batch 及两张图片：

```json theme={null}
{
  "taskId": "f45b6bd0-...",
  "result": {
    "batch_id": "xxx",
    "items": [
      { "status": "complete", "image_url": "https://..." },
      { "status": "complete", "image_url": "https://..." }
    ]
  }
}
```

<Info>
  服务内部会轮询 Suno batch 直至 `complete`，任务结果中已包含 `image_url`。
</Info>

## 示例

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.mountsea.ai/suno/v2/image/generate \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "a futuristic city at sunset",
      "image_gen_category": "advanced"
    }'
  ```

  ```bash 轮询 theme={null}
  curl "https://api.mountsea.ai/suno/v2/status?taskId=YOUR_TASK_ID" \
    -H "Authorization: Bearer your-api-key"
  ```
</CodeGroup>


## OpenAPI

````yaml POST /suno/v2/image/generate
openapi: 3.0.0
info:
  title: Suno AI
  description: API documentation for Suno AI
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: suno
    description: ''
  - name: suno/studio
    description: Studio Song Editor（与 audio/crop|fade|reverse 独立）
paths:
  /suno/v2/image/generate:
    post:
      tags:
        - suno
      summary: generate standalone image
      description: |-
        Submit an image generation task. Returns taskId to poll via /status.
        Credit deduction is parameter-based:
          - image_gen_category=basic  → 0 credits/image
          - image_gen_category=advanced → 20 credits/image
        Total cost = credits_per_image × quantity.
      operationId: ApiPublicController_generateImage
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateImageDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIdDto'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateImageDto:
      type: object
      properties:
        prompt:
          type: string
          description: 图片生成提示词
        image_gen_category:
          enum:
            - basic
            - advanced
          type: string
          description: basic = 0 积分；advanced = 按 conf_task_policy[image_generate].cost 扣减
          default: basic
      required:
        - prompt
        - image_gen_category
    TaskIdDto:
      type: object
      properties:
        taskId:
          type: string
          description: task id. Use this id to query task status.
          example: 15c257ff-43f7-4678-bd41-202ad6b8488b
      required:
        - taskId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````