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

# Enhancement API — suspended

> The Topaz-backed enhancement endpoint is not currently accepting tasks.

<Warning>
  This service is suspended. New requests return `503 Service Unavailable`. Do not
  build new integrations against this endpoint.
</Warning>

The contract remains published so existing callers can identify the endpoint
and handle the maintenance response. Use the Midjourney
[Upscale](/api-reference/image-generation/upscale) action when it is available
on a completed grid; it is a different capability and is not a drop-in
replacement for Topaz enhancement.


## OpenAPI

````yaml POST /v1/enhance-upscale
openapi: 3.1.0
info:
  title: Legnext AI API
  description: |-
    The Legnext API generates and edits images and videos with Midjourney.

    ## Authentication

    Send your API key in the `x-api-key` header on every request (the
    `Authorization: Bearer <key>` form is also accepted). Create and
    manage keys in the Legnext dashboard.

    The one exception is `GET /v1/job/{job_id}`, which is
    unauthenticated. Its UUID is a capability token: keep it private and do not
    expose it in client-side logs or analytics.

    ## Asynchronous tasks

    Every generation endpoint creates an asynchronous task and returns the full
    `TaskResponse` object immediately (status `pending`, or `staged`
    when the account is at its concurrency limit). The task reaches a terminal
    status — `completed` or `failed` — within seconds to minutes. Poll
    `GET /v1/job/{job_id}` or pass a `callback` URL at creation to be
    notified (the completed TaskResponse is POSTed to it).

    ## Errors

    Task endpoints (everything under `/v1`) report errors in the same
    `TaskResponse` shape as success: `status` is `failed` and the
    `error` object carries `code` (the HTTP status) and `message`.
    Account, usage, and webhook endpoints report errors as
    `{code, message}` where `code` mirrors the HTTP status.

    ## Limits and maintenance

    `402` means insufficient quota, `429` means the account's concurrency
    or staged-queue limit is reached (retry once running tasks finish), and
    `503` means the service (or one provider-backed feature) is under
    maintenance.
  version: 1.0.0
  contact:
    email: support@legnext.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.legnext.ai/api
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Image Generation
    description: Create and derive Midjourney images.
  - name: Video Generation
    description: Create and extend Midjourney videos.
  - name: Image Enhancement
    description: AI image enhancement and upscaling (Topaz).
  - name: Task Management
    description: Track and query asynchronous tasks.
  - name: Account
    description: Account profile, balance, and quota.
paths:
  /v1/enhance-upscale:
    post:
      tags:
        - Image Enhancement
      summary: Enhance and Upscale Image
      description: >-
        Upscale images to ultra-high resolutions (up to 12K) using Topaz Labs AI
        with content-aware enhancement.


        **Currently suspended**: the endpoint returns 503 while the Topaz
        provider is unavailable.
      operationId: enhanceUpscaleImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnhanceUpscaleRequest'
      responses:
        '200':
          description: Enhancement task accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '400':
          description: >-
            Bad Request — invalid request body or parameter values (see
            `error.message`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '401':
          description: Unauthorized — missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '402':
          description: >-
            Payment Required — insufficient quota to freeze for this task
            (`insufficient quota`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '403':
          description: Forbidden — account disabled or daily error limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '429':
          description: >-
            Too Many Requests — concurrency or staged-queue limit exceeded;
            retry after running tasks finish.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '500':
          description: Internal Server Error — unexpected server-side failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '503':
          description: >-
            Service Unavailable — the enhance/upscale provider is temporarily
            suspended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
components:
  schemas:
    EnhanceUpscaleRequest:
      type: object
      properties:
        aspect_ratio:
          type: string
          description: Output aspect ratio.
          enum:
            - keep
            - '1:1'
            - '16:9'
            - '9:16'
            - '4:5'
            - '5:4'
            - '3:2'
            - '2:3'
            - '4:3'
            - '3:4'
          default: keep
        content_type:
          type: string
          description: Content type hint for the enhancer.
          enum:
            - photo
            - illustration
            - text
            - low_res
            - standard
          default: standard
        crop_mode:
          type: string
          description: How to fit the target aspect ratio.
          enum:
            - letterbox
            - crop
          default: letterbox
        face_enhancement_level:
          type: string
          description: Face enhancement preset.
          enum:
            - 'off'
            - none
            - subtle
            - moderate
            - strong
          default: moderate
        image_url:
          type: string
          description: >-
            Direct URL of the image to enhance (must start with http:// or
            https://). Either `image_url` or `jobId`+`imageNo` is required.
          maxLength: 2048
          pattern: ^https?://
        imageNo:
          type: integer
          description: >-
            Index of the image in the parent task's grid (0-3, left-to-right,
            top-to-bottom). Required when using `jobId`.
          minimum: 0
          maximum: 3
        jobId:
          type: string
          format: uuid
          description: >-
            ID of a previous Midjourney task whose grid image should be
            enhanced.
        notify_progress:
          type: boolean
        output_format:
          type: string
          description: Output image format.
          enum:
            - jpeg
            - jpg
            - png
            - tiff
            - tif
          default: jpeg
        target_resolution:
          type: string
          description: Target resolution preset.
          enum:
            - HD
            - FHD
            - 2K
            - 4K
            - 6K
            - 8K
            - 12K
          default: 2K
        webhook_endpoint:
          type: string
        webhook_schema:
          type: string
        webhook_secret:
          type: string
      anyOf:
        - required:
            - image_url
        - required:
            - jobId
            - imageNo
    TaskResponse:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/TaskConfig'
        detail:
          type: 'null'
          description: Reserved for future use; currently null in public API responses.
        error:
          $ref: '#/components/schemas/TaskError'
        input:
          type: object
          description: >-
            Echo of the task's input parameters (shape depends on `task_type`;
            mirrors the create-request body of the operation that created the
            task). Null in error responses.
        job_id:
          type: string
          format: uuid
          description: >-
            Task UUID. Pass it to GET /v1/job/{job_id} to poll, or reference it
            as `jobId` in follow-up operations.
        logs:
          type: array
          description: Operational log lines of the task (progress events, retries).
          items:
            type: string
        meta:
          description: Timestamps and billing usage of the task (null in error responses).
          oneOf:
            - $ref: '#/components/schemas/TaskMeta'
            - type: 'null'
        model:
          type: string
          description: Model family that executed the task.
          enum:
            - midjourney
        output:
          description: >-
            Task result, present once status is `completed` (null before that).
            Image/video tasks return URLs; describe/shorten tasks return text
            prompts.
          oneOf:
            - $ref: '#/components/schemas/ImageOutput'
            - $ref: '#/components/schemas/VideoOutput'
            - $ref: '#/components/schemas/TextOutput'
            - type: 'null'
        status:
          type: string
          description: >-
            Lifecycle state. Terminal states: `completed`, `failed`. `staged`
            means the task is queued behind the account's concurrency limit;
            `retry` means it is being resubmitted after a transient provider
            error.
          enum:
            - pending
            - staged
            - processing
            - retry
            - completed
            - failed
        task_type:
          type: string
          description: Type of the task — the operation that created it.
          enum:
            - diffusion
            - upscale
            - reroll
            - variation
            - inpaint
            - outpaint
            - pan
            - edit
            - remix
            - enhance
            - upload_paint
            - retexture
            - remove_background
            - shorten
            - describe
            - blend
            - video_diffusion
            - extend_video
            - video_upscale
            - enhance_upscale
      required:
        - job_id
        - model
        - task_type
        - status
        - config
        - input
        - output
        - meta
        - detail
        - logs
        - error
    TaskConfig:
      type: object
      properties:
        service_mode:
          type: string
          description: >-
            Service mode the task runs under. Only `public` is currently
            supported.
          enum:
            - public
        webhook_config:
          $ref: '#/components/schemas/TaskWebhookConfig'
      required:
        - service_mode
        - webhook_config
    TaskError:
      type: object
      properties:
        code:
          type: integer
        detail: {}
        message:
          type: string
        raw_message:
          type: string
      required:
        - code
        - raw_message
        - message
        - detail
    TaskMeta:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
        usage:
          $ref: '#/components/schemas/TaskUsage'
      required:
        - created_at
        - started_at
        - ended_at
        - usage
    ImageOutput:
      type: object
      properties:
        available_actions:
          type: object
        image_url:
          type: string
        image_urls:
          type: array
          items:
            type: string
        seed:
          type: string
      required:
        - image_url
        - image_urls
        - seed
    VideoOutput:
      type: object
      properties:
        available_actions:
          type: object
        seed:
          type: string
        video_urls:
          type: array
          items:
            type: string
      required:
        - video_urls
        - seed
    TextOutput:
      type: object
      properties:
        description:
          type: string
        finalPrompt:
          type: string
        promptEn:
          type: string
        prompts:
          type: array
          items:
            type: string
      required:
        - promptEn
        - description
        - finalPrompt
        - prompts
    TaskWebhookConfig:
      type: object
      properties:
        endpoint:
          type: string
        secret:
          type: string
      required:
        - endpoint
        - secret
    TaskUsage:
      type: object
      properties:
        consume:
          type: integer
        frozen:
          type: integer
        type:
          type: string
          description: Billing unit used for the task.
          enum:
            - credit
            - point
      required:
        - type
        - frozen
        - consume
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key from the Legnext dashboard. `Authorization: Bearer <key>` is
        accepted as an alternative.

````

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