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

# Get a KIE-compatible task



## OpenAPI

````yaml /openapi/gateway-openapi.json get /kie/api/v1/jobs/recordInfo
openapi: 3.1.0
info:
  title: YIR Async AI Gateway
  version: 1.0.0-stage3a2
  description: >-
    Source-compatible asynchronous image generation routes certified by YIR.
    Authenticate every request with a YIR API key. Provider credentials are
    managed by YIR and must never be sent by clients.
servers:
  - url: https://gateway.yir.ai
    description: YIR production Gateway
security:
  - BearerAuth: []
tags:
  - name: KIE GPT Image 2
  - name: APIMart GPT Image 2
paths:
  /kie/api/v1/jobs/recordInfo:
    get:
      tags:
        - KIE GPT Image 2
      summary: Get a KIE-compatible task
      operationId: getKIEGPTImage2Task
      parameters:
        - name: taskId
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/PositiveTaskID'
      responses:
        '200':
          description: Current task state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KIETaskResponse'
        default:
          $ref: '#/components/responses/KIEError'
      security:
        - BearerAuth: []
components:
  schemas:
    PositiveTaskID:
      type: string
      pattern: ^[1-9][0-9]*$
      description: Positive decimal YIR task ID
    KIETaskResponse:
      type: object
      additionalProperties: false
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
          const: 200
        msg:
          type: string
          const: success
        data:
          $ref: '#/components/schemas/KIETaskData'
    KIETaskData:
      type: object
      additionalProperties: false
      required:
        - taskId
        - state
        - progress
      properties:
        taskId:
          $ref: '#/components/schemas/PositiveTaskID'
        state:
          type: string
          enum:
            - waiting
            - generating
            - success
            - fail
        progress:
          type: integer
          minimum: 0
          maximum: 100
        resultJson:
          type: string
          description: On success, a JSON-encoded object containing resultUrls.
        creditsConsumed:
          type: string
          description: Provider usage evidence when present.
        failCode:
          type: string
        failMsg:
          type: string
    KIEErrorResponse:
      type: object
      additionalProperties: false
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
          description: HTTP status code
        msg:
          type: string
          description: Safe public error message
        data:
          type: 'null'
  responses:
    KIEError:
      description: KIE-compatible safe error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/KIEErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: YIR_API_KEY
      description: >-
        Use Authorization: Bearer <YIR_API_KEY>. Upstream provider keys are not
        accepted.

````