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

# Get task result by taskId

> get the task execution result through the task ID

## Response result

The status has the following values:
1.waiting: Tasks waiting to be executed
2.success: The task has been successfully executed
3.executing: Task in progress
4.fail: Task execution failed
5.invoking: Task in progress

Note that gpt-image supports base64 for generating images. If you choose base64, it will return resources.base64

**success**

```json theme={null}
{
    "code": 200,
    "data": {
        "status": "success",
        "taskId": "xxx",
        "resources": [
            {
                "url": "xxx"
            }
        ],
    },
    "message": "success",
    "traceId": "xxx"
}
```

**fail**

```json theme={null}
    {
        "code": 200,
        "data": {
            "status": "fail",
            "taskId": "xxx",
            "errorMessage": "timeout",
            "errorCode": 10035
        },
        "message": "success",
        "traceId": "xxx"
    }
```


## OpenAPI

````yaml get /task/result/{taskId}
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://ai.pmock.com/api
    description: Generated server url
security: []
tags:
  - name: 开放-minimax视频生成
    description: 开放-minimax视频生成
  - name: 开放-Grok开放接口
    description: 开放-Grok开放接口
  - name: 开放-AI同步调用兼容接口
    description: 开放-AI同步调用兼容接口
  - name: 开放-Gemini开放接口
    description: 开放-Gemini开放接口
  - name: 开放-Sora2开放接口
    description: 开放-Sora2开放接口
  - name: 开放-模型列表接口
    description: 开放-模型列表接口
  - name: 开放-火山视频生成
    description: 开放-火山视频生成
  - name: 开放-OpenAi开放接口
    description: 开放-OpenAi开放接口
  - name: 开放-业务相关接口
    description: 开放-业务相关接口
  - name: 开放-任务开放接口
    description: 开放-任务开放接口
paths:
  /task/result/{taskId}:
    get:
      tags:
        - 开放-任务开放接口
      summary: Get task result by taskId
      description: get the task execution result through the task ID
      operationId: getResultByTaskId
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RRMapResult'
components:
  schemas:
    RRMapResult:
      type: object
      description: Unified return structure for response results
      properties:
        code:
          type: integer
          format: int32
          description: Response status code
          example: 200
        message:
          type: string
          description: Response message
        data:
          type: object
          additionalProperties: {}
          description: Response result
          properties:
            empty:
              type: boolean
        traceId:
          type: string
          description: Response traceId

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.