> ## 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.
      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
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                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/example.png
                        revised_prompt: A cute corgi astronaut on Mars.
                  created_at: 1761432000.063
                  started_at: '2025-10-26T00:00:00.069+00:00'
                  finished_at: 1761432015.098
                  elapsed: 15.029
                properties:
                  id:
                    type: string
                    description: Openai Tasks Response 200 Id
                  request:
                    type: object
                    description: Openai Tasks Response 200 Request
                  response:
                    type: object
                    description: Openai Tasks Response 200 Response
          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:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from https://platform.acedata.cloud

````