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

# タスク詳細を照会

> 非同期の画像、動画、または将来の音声タスクの現在の状態と最終結果を返します。



## OpenAPI

````yaml /ja/openapi.json get /v1/tasks/{task_id}
openapi: 3.1.0
info:
  title: APIAny.AI 公開 API
  version: 1.0.0
  description: APIAny.AI のモデル統合、非同期メディアタスク、チャット生成、クレジット照会、タスク照会のための公開 API。
servers:
  - url: https://apiany.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Models
    description: 公開モデルカタログ。
  - name: Chat
    description: テキスト生成およびチャット互換エンドポイント。
  - name: Images
    description: 画像生成および画像編集エンドポイント。
  - name: Videos
    description: 動画生成エンドポイント。
  - name: Moderation
    description: Image safety and moderation endpoints.
  - name: Tasks
    description: 非同期タスク照会。
  - name: Account
    description: アカウントおよびクレジットの照会。
  - name: Free APIs
    description: Free utility APIs protected by API key rate limits.
paths:
  /v1/tasks/{task_id}:
    get:
      tags:
        - Tasks
      summary: タスク詳細を照会
      description: 非同期の画像、動画、または将来の音声タスクの現在の状態と最終結果を返します。
      operationId: getTask
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          example: task_123
      responses:
        '200':
          description: タスク詳細。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: タスクが存在しません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TaskResponse:
      type: object
      properties:
        task_id:
          type: string
          example: task_123
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - expired
        model:
          type: string
        created_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        result:
          oneOf:
            - $ref: '#/components/schemas/MediaResult'
            - type: 'null'
        error:
          oneOf:
            - c1ce5583-b411-4332-b638-ba563a61c2f5
            - type: 'null'
      required:
        - task_id
        - status
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - auth_error
                - rate_limit
                - insufficient_quota
                - content_policy
                - timeout
                - network_error
                - service_error
                - billable_error
                - unknown
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - 'null'
          required:
            - type
            - message
      required:
        - error
    MediaResult:
      description: >-
        完了したタスクの結果。画像タスクは OpenAI 画像形式を使用します（画像 URL は data[0].url）。動画および音声タスクは
        video_url/audio_url と urls[] 配列を提供します。
      oneOf:
        - $ref: '#/components/schemas/ImageTaskResult'
        - $ref: '#/components/schemas/MediaUrlResult'
    ImageTaskResult:
      type: object
      description: 画像タスクの結果（OpenAI 画像形式）。画像 URL は data[0].url にあります。
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              b64_json:
                type: string
              revised_prompt:
                type: string
      required:
        - data
    MediaUrlResult:
      type: object
      description: 動画または音声タスクの結果。主 URL は video_url または audio_url で、すべての出力は urls[] にも列挙されます。
      properties:
        status:
          type: string
        video_url:
          type: string
          format: uri
        audio_url:
          type: string
          format: uri
        output_url:
          type: string
          format: uri
        urls:
          type: array
          items:
            type: string
            format: uri
  responses:
    Unauthorized:
      description: API Key が指定されていないか、API Key が無効です。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````