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

# Get Task

> Fetch a task's status and result with the `task_id` returned on submission.

| status | Meaning |
| - | - |
| `submitted` | Submitted, waiting in the queue |
| `in_progress` | Generating |
| `success` | Done; outputs are in `images` / `videos` / `descriptions`, and `usage.multiplier` is this task's spec multiplier. Query with `X-Billing-Detail: true` and the `X-Billing-Amount` response header shows what this task actually cost |
| `failure` | Failed; see `fail_reason`. The charge is refunded |

If you passed `notify_hook` on submission, the same content as the fetch result is POSTed there when the task ends. Notifications can be lost on the network, so fetch the task if one doesn't arrive in time.


## OpenAPI

````yaml en/openapi/midjourney.json GET /midjourney/task/{task_id}
openapi: 3.1.0
info:
  title: Midjourney API
  version: 1.0.0
  description: Midjourney
servers:
  - url: https://api.ephone.ai
security:
  - bearerAuth: []
paths:
  /midjourney/task/{task_id}:
    get:
      summary: Get Task
      description: >-
        Fetch a task's status and result with the `task_id` returned on
        submission. Poll every 3 to 5 seconds until `status` becomes `success`
        or `failure`.
      operationId: midjourney_get_task
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: The task ID returned when you submitted the task.
          example: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
        - name: X-Billing-Detail
          in: header
          required: false
          schema:
            type: boolean
          description: >-
            Pass `true` to get the `X-Billing-Currency` and `X-Billing-Amount`
            response headers (what this task actually cost) once the task has
            finished; the response body does not change. If you also send it
            when submitting the task, later queries return them without the
            header, and the callback request sent when the task finishes carries
            them as request headers too.
      responses:
        '200':
          description: OK
          headers:
            X-Billing-Currency:
              description: >-
                The currency the model is priced in: `CNY` or `USD`. Only
                present when the request carries `X-Billing-Detail: true` (or it
                was sent on submit) and the task has finished.
              schema:
                type: string
                enum:
                  - CNY
                  - USD
            X-Billing-Amount:
              description: >-
                The actual charge, in the currency given by
                `X-Billing-Currency`, e.g. `0.24`. Discounts and failure refunds
                are already applied; use it as is and do not convert it with an
                exchange rate yourself.
              schema:
                type: string
                example: '0.24'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
              example:
                task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                action: imagine
                status: success
                speed: fast
                prompt: >-
                  a red bicycle leaning on a brick wall, morning light --ar 3:2
                  --v 8.2
                images:
                  - https://.../1.png
                  - https://.../2.png
                  - https://.../3.png
                  - https://.../4.png
                seed: 3277589003
                actions:
                  - upscale
                  - variation
                  - remix
                  - zoom
                  - pan
                  - inpaint
                  - video
                  - reroll
                created_at: 1792154579
                finished_at: 1792154629
                usage:
                  type: call
                  multiplier: 1
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Invalid API key
        '404':
          description: task_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: task_not_found
                  message: Task not found
components:
  schemas:
    Task:
      type: object
      properties:
        task_id:
          type: string
          description: Task ID.
        action:
          type: string
          description: Action name, e.g. `imagine`, `upscale`.
        status:
          type: string
          description: Task status, see the table above.
          enum:
            - submitted
            - in_progress
            - success
            - failure
        speed:
          type: string
          description: >-
            The speed tier chosen on submit: `relax`, `fast` or `turbo`, which
            is also the tier you are billed for. Describe has no speed, so it is
            omitted.
        prompt:
          type: string
          description: The prompt that was submitted.
        images:
          type: array
          items:
            type: string
          description: >-
            Image URLs in index order (the first one is `index: 1`). An image
            that failed content review is an empty string.
        videos:
          type: array
          items:
            type: string
          description: Video URLs (video endpoints) in index order.
        descriptions:
          type: array
          items:
            type: string
          description: Image descriptions (describe).
        seed:
          type: integer
          description: Seed.
        actions:
          type: array
          items:
            type: string
          description: >-
            Operations you can run next on this task, e.g. `["upscale",
            "variation", "reroll"]`. Pass one as `action` to `POST
            /midjourney/action` together with `task_id`; per-image operations
            also take `index`, `reroll` doesn't.
        fail_reason:
          type: string
          description: Failure reason.
        created_at:
          type: integer
          description: Created at (Unix seconds).
        finished_at:
          type: integer
          description: Finished at (Unix seconds).
        usage:
          type: object
          description: >-
            Usage, returned only on `success`, e.g. `{"type": "call",
            "multiplier": 2}`. `multiplier` is the spec multiplier on the unit
            price of the selected speed tier in the price table: 2 for HD, 0.5
            for a V7 draft; videos depend on resolution and count. Account
            discounts are not included; see the `X-Billing-Amount` response
            header (query with `X-Billing-Detail: true`) for what the task
            actually cost.
      required:
        - task_id
        - action
        - status
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API key in the `Authorization: Bearer YOUR_API_KEY` header.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.