# Check generation result

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/video-generations/check-result:
    post:
      summary: Check generation result
      deprecated: false
      description: Fetch by taskId in real time and write back to the database.
      tags:
        - Sora 2 API/Video
        - Video
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckResultRequest'
            examples:
              default:
                value:
                  taskId: task_1234567890
                summary: default
      responses:
        '200':
          description: Success response with task status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckResultResponse'
              examples:
                running:
                  summary: running
                  value:
                    code: 0
                    message: Success
                    data:
                      status: running
                      progress: 35
                      result_url: https://your-domain.com/storage/videos/xxx.mp4
                      result_urls:
                        - https://your-domain.com/storage/videos/xxx.mp4
                      failure_reason: ''
                      error_message: null
                      credits_refunded: false
                      refund_trans_no: null
                      result_pid: s_xxx
                      result_pids:
                        - s_xxx
                      metadata:
                        remixTargetId: s_prev
                        characters:
                          - url: https://.../hero.mp4
                            timestamps: 0,3
          headers: {}
          x-apifox-name: ''
        '400':
          description: Missing parameter.
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 400
                message: taskId is required
          headers: {}
          x-apifox-name: ''
        '401':
          description: Not logged in.
          content:
            application/json:
              schema: *ref_0
              example:
                code: 401
                message: Unauthorized
          headers: {}
          x-apifox-name: ''
        '403':
          description: Forbidden.
          content:
            application/json:
              schema: *ref_0
              example:
                code: 403
                message: Forbidden
          headers: {}
          x-apifox-name: ''
        '404':
          description: Task not found.
          content:
            application/json:
              schema: *ref_0
              example:
                code: 404
                message: Task not found
          headers: {}
          x-apifox-name: ''
        '500':
          description: Failed to sync task result.
          content:
            application/json:
              schema: *ref_0
              example:
                code: 500
                message: Failed to sync task result
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Sora 2 API/Video
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/7601215/apis/api-395235467-run
components:
  schemas:
    CheckResultRequest:
      type: object
      required:
        - taskId
      properties:
        taskId:
          type: string
          description: Task ID.
      x-apifox-orders:
        - taskId
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    CheckResultResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        data:
          $ref: '#/components/schemas/CheckResultData'
      x-apifox-orders:
        - code
        - message
        - data
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    CheckResultData:
      type: object
      properties:
        status:
          type: string
          enum:
            - pending
            - running
            - succeeded
            - failed
            - cancelled
        progress:
          type: integer
          minimum: 0
          maximum: 100
        result_url:
          type: string
          nullable: true
        result_urls:
          type: array
          items:
            type: string
        failure_reason:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
        credits_refunded:
          type: boolean
        refund_trans_no:
          type: string
          nullable: true
        result_pid:
          type: string
          nullable: true
        result_pids:
          type: array
          items:
            type: string
        metadata:
          type: object
          description: Full metadata including remixTargetId and characters.
          properties:
            remixTargetId:
              type: string
            characters:
              type: array
              items:
                $ref: '#/components/schemas/CharacterItem'
          x-apifox-orders:
            - remixTargetId
            - characters
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - status
        - progress
        - result_url
        - result_urls
        - failure_reason
        - error_message
        - credits_refunded
        - refund_trans_no
        - result_pid
        - result_pids
        - metadata
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    CharacterItem:
      type: object
      properties:
        url:
          type: string
          description: Direct link to character video.
        timestamps:
          type: string
          description: Range string in "start,end" format.
      required:
        - url
        - timestamps
      x-apifox-orders:
        - url
        - timestamps
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
      x-apifox-orders:
        - code
        - message
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
servers:
  - url: https://freesoragenerator.com
    description: Prod Env
security: []

```
