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

# Tasks

> Query tasks created by /v1/images/generations or /v1/images/edits with callback_url.



## OpenAPI

````yaml /openapi/openai.json post /openai/tasks
openapi: 3.0.0
info:
  title: OpenAI generation
  version: 1.0.0
  description: API reference for OpenAI generation on Ace Data Cloud.
servers:
  - url: https://api.acedata.cloud
    description: Ace Data Cloud API
security:
  - bearerAuth: []
paths:
  /openai/tasks:
    post:
      summary: Tasks
      description: >-
        Query tasks created by /v1/images/generations or /v1/images/edits with
        callback_url.
      operationId: queryOpenaiTasks
      parameters:
        - in: header
          name: accept
          schema:
            enum:
              - application/json
            type: string
          required: false
          description: Openai Tasks Param Accept
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  enum:
                    - retrieve
                    - retrieve_batch
                  default: retrieve
                  description: Openai Tasks Action
                id:
                  type: string
                  description: Openai Tasks Id
                trace_id:
                  type: string
                  description: Openai Tasks Trace Id
                ids:
                  type: array
                  items:
                    type: string
                  description: Openai Tasks Ids
                trace_ids:
                  type: array
                  items:
                    type: string
                  description: Openai Tasks Trace Ids
                application_id:
                  type: string
                  description: Openai Tasks Application Id
                user_id:
                  type: string
                  description: Openai Tasks User Id
                type:
                  type: string
                  enum:
                    - images
                    - images_generations
                    - images_edits
                  description: Openai Tasks Type
                offset:
                  type: integer
                  default: 0
                  description: Openai Tasks Offset
                limit:
                  type: integer
                  default: 12
                  description: Openai Tasks Limit
                created_at_min:
                  type: number
                  description: Openai Tasks Created At Min
                created_at_max:
                  type: number
                  description: Openai Tasks Created At Max
                count_mode:
                  type: string
                  enum:
                    - none
                    - exact
                  default: none
                  description: Openai Tasks Count Mode
              example:
                action: retrieve
                id: task-id
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/OpenaiTaskRecord'
                  - type: object
                    required:
                      - items
                      - count
                      - has_more
                      - count_is_exact
                      - count_relation
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/OpenaiTaskRecord'
                        description: >-
                          Openapi.8Ff29E12B8144484Ab50D39773A7A563.Items.06F43321E55C
                      count:
                        type: integer
                        minimum: 0
                        description: >-
                          Openapi.8Ff29E12B8144484Ab50D39773A7A563.Count.2791694C6B64
                      has_more:
                        type: boolean
                        description: Openai Tasks Has More
                      count_is_exact:
                        type: boolean
                        description: Openai Tasks Count Is Exact
                      count_relation:
                        type: string
                        enum:
                          - eq
                          - gte
                        description: Openai Tasks Count Relation
                  - type: object
                    additionalProperties: false
                    description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.2.Adddb6F1E110
              example:
                id: 42b2ab0f-5676-453b-bd23-9ee001b888ae
                _id: 65ede215550a4144a5fcebac
                type: images
                trace_id: b0a683a4-aecc-450d-849e-c9f0730826a2
                api_id: 8f01fe72-8a3e-4872-8d8d-330cde179b3a
                application_id: e2ee38ba-19ea-4da9-9f3f-4f8567d19feb
                credential_id: null
                user_id: null
                request:
                  model: gpt-image-1
                  prompt: a cute corgi astronaut on Mars
                  size: 1024x1024
                  'n': 1
                response:
                  success: true
                  task_id: 42b2ab0f-5676-453b-bd23-9ee001b888ae
                  trace_id: b0a683a4-aecc-450d-849e-c9f0730826a2
                  created: 1761432000
                  data:
                    - url: >-
                        https://platform.cdn.acedata.cloud/gpt-image/cb104e35-af1f-45be-9fac-b62e2b256753_0.png
                      revised_prompt: A cute corgi astronaut on Mars.
                created_at: 1761432000.063
                started_at: 1761432000.069
                finished_at: 1761432015.098
                elapsed: 15.029
          description: Openai Tasks Response 200
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: token_mismatched
                        message: The specified token is not matched with API.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: token_mismatched
                            description: Openai Tasks Response 400 Error Code
                          message:
                            type: string
                            example: The specified token is not matched with API.
                            description: Openai Tasks Response 400 Error Message
                      trace_id:
                        type: string
                        description: Openai Tasks Response 400 Trace Id
                  - type: object
                    example:
                      error:
                        code: api_not_implemented
                        message: The API is not implemented.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: api_not_implemented
                            description: Openai Tasks Response 400 Error Code 2
                          message:
                            type: string
                            example: The API is not implemented.
                            description: Openai Tasks Response 400 Error Message 2
                      trace_id:
                        type: string
                        description: Openai Tasks Response 400 Trace Id 2
          description: Openai Tasks Response 400
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: invalid_token
                        message: The specified token is invalid or wrong.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: invalid_token
                            description: Openai Tasks Response 401 Error Code
                          message:
                            type: string
                            example: The specified token is invalid or wrong.
                            description: Openai Tasks Response 401 Error Message
                      trace_id:
                        type: string
                        description: Openai Tasks Response 401 Trace Id
          description: Openai Tasks Response 401
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: too_many_requests
                        message: You have exceeded the rate limit.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: too_many_requests
                            description: Openai Tasks Response 429 Error Code
                          message:
                            type: string
                            example: You have exceeded the rate limit.
                            description: Openai Tasks Response 429 Error Message
                      trace_id:
                        type: string
                        description: Openai Tasks Response 429 Trace Id
          description: Openai Tasks Response 429
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: api_error
                        message: Internal server error.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: api_error
                            description: Openai Tasks Response 500 Error Code
                          message:
                            type: string
                            example: Internal server error.
                            description: Openai Tasks Response 500 Error Message
                      trace_id:
                        type: string
                        description: Openai Tasks Response 500 Trace Id
          description: Openai Tasks Response 500
      security:
        - bearerAuth: []
components:
  schemas:
    OpenaiTaskRecord:
      type: object
      required:
        - id
        - type
        - created_at
        - trace_id
        - request
      properties:
        id:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Id.F0C4D04Ac901
        type:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Type.2377365D580B
        trace_id:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Trace Id.294E865Afe7D
        request:
          $ref: '#/components/schemas/OpenaiTaskRequestPayload'
        response:
          $ref: '#/components/schemas/OpenaiTaskResultPayload'
        created_at:
          type: number
          format: double
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Created At.7Eb1Ea25D63F
        started_at:
          type: number
          format: double
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Started At.7B96764Eca42
        finished_at:
          type: number
          format: double
          nullable: true
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Finished At.Af98E2F04Efa
        elapsed:
          type: number
          format: double
          minimum: 0
          nullable: true
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Elapsed.438Ff25Abacb
        user_id:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.User Id.3444939Bec0F
          nullable: true
        actor_user_id:
          type: string
          nullable: true
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Actor User Id.2952Ff9B7F38
        api_id:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Api Id.45Cf1B2E805B
        application_id:
          type: string
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Application Id.3Fbf90Fcc98C
        credential_id:
          type: string
          nullable: true
          description: Openapi.8Ff29E12B8144484Ab50D39773A7A563.Credential Id.7E41Bc205Fd2
        authorization_id:
          type: string
          nullable: true
          description: >-
            Openapi.8Ff29E12B8144484Ab50D39773A7A563.Authorization
            Id.271938Ba5A22
    OpenaiTaskRequestPayload:
      type: object
      additionalProperties: true
      description: >-
        Openapi.8Ff29E12B8144484Ab50D39773A7A563.Openaitaskrequestpayload.5B2983943843
    OpenaiTaskResultPayload:
      type: object
      additionalProperties: true
      description: >-
        Openapi.8Ff29E12B8144484Ab50D39773A7A563.Openaitaskresultpayload.6A35F882Aa4E
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from https://platform.acedata.cloud

````