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

# タスク取得

> タスクIDに基づいてタスクの実行状態と結果を照会

タスク ID を使用して非同期タスクの実行状態と生成結果を取得します。すべての画像・動画生成はこのエンドポイントを使用してタスクステータスをポーリングする必要があります。


## OpenAPI

````yaml /ja/openapi.yaml GET /tasks/{id}
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AIモデルタスクスケジューリングプラットフォーム API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: 本番サーバー
security: []
paths:
  /tasks/{id}:
    get:
      tags:
        - public
      summary: タスク情報を照会
      description: タスクIDに基づいてタスクの実行状態と結果を照会
      parameters:
        - description: タスクID
          example: 01234567-89ab-cdef-0123-456789abcdef
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.TaskResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '404':
          description: タスクが存在しません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    dto.TaskResponse:
      properties:
        error_code:
          type: string
        error_msg:
          description: 分かりやすいエラーメッセージ（空の場合はerror_codeにフォールバック）
          type: string
        id:
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
        result:
          items:
            $ref: '#/components/schemas/dto.MediaItem'
          type: array
        status:
          example: processing
          type: string
      required:
        - id
        - status
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: '機械可読なエラーコード（例: TASK.INVALID_PARAMS）'
          type: string
        message:
          description: ユーザーフレンドリーなエラーメッセージ
          type: string
      type: object
    dto.MediaItem:
      properties:
        type:
          description: image, video, audio
          type: string
        url:
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Tokenを使用して認証を行ってください

````