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

# List architectures

> GET /v1/architectures returns every model the Mage API can generate with, each with its input fields, option tokens, defaults, JSON Schema, and gem price.

The API describing itself: every architecture you can generate with, in one call. Use it to build a model picker, to validate a request before sending it, or to read the field names and tokens of a model at runtime instead of hard-coding them. The list changes without a version bump: architectures appear when they launch and disappear when they are retired.

Each entry carries `type` (`image`, `video`, or `audio`: what the model generates), `image_inputs` and `video_inputs` (the config field each media role writes to, so you can tell an image-to-video model from a text-only one before submitting), `options` and `options_by_model` (the tokens each adjustable field accepts, narrowed per variant), `input_schema` (the request body as JSON Schema, defaults folded in), `gems` (the price of the default config), and `generate_url`.


## OpenAPI

````yaml api/openapi.json GET /v1/architectures
openapi: 3.1.0
info:
  title: Mage API
  version: v1
  description: >-
    Run Mage models from your own code: submit a generation, poll its status,
    download the result. Every request is paid in gems.
  contact:
    name: Mage
    url: https://www.mage.space
    email: mage@mage.space
servers:
  - url: https://api.mage.space
    description: Production
security:
  - apiKey: []
tags:
  - name: Requests
    description: Submit, poll, and cancel generations.
  - name: Catalog
    description: What the API can generate with.
  - name: Account
    description: The gems balance.
  - name: Uploads
    description: Large input files.
  - name: Characters
    description: Saved characters a prompt mentions by `@handle`.
  - name: References
    description: Saved image and audio references a prompt mentions by `@handle`.
  - name: Image models
    description: One endpoint per image architecture.
  - name: Video models
    description: One endpoint per video architecture.
  - name: Audio models
    description: One endpoint per audio architecture.
paths:
  /v1/architectures:
    get:
      tags:
        - Catalog
      summary: List architectures
      description: >-
        Every architecture the API can generate with, with its fields, tokens,
        defaults, and price.
      operationId: list_architectures
      responses:
        '200':
          description: The catalog.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArchitectureList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '500':
          $ref: '#/components/responses/InternalError'
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |-
            import Mage from '@mage-space/sdk';

            const mage = new Mage(); // reads MAGE_API_KEY

            const { architectures } = await mage.architectures.list();

            for (const architecture of architectures) {
              console.log(architecture.id, architecture.gems);
            }
        - lang: python
          label: Python SDK
          source: |-
            from mage_space import Mage

            mage = Mage()  # reads MAGE_API_KEY

            catalog = mage.architectures.list()

            for architecture in catalog["architectures"]:
                print(architecture["id"], architecture["gems"])
components:
  schemas:
    ArchitectureList:
      type: object
      properties:
        architectures:
          type: array
          items:
            $ref: '#/components/schemas/Architecture'
      required:
        - architectures
    Architecture:
      type: object
      properties:
        id:
          type: string
          description: The architecture id, as used in its endpoint path.
        name:
          type: string
          description: The display name.
        type:
          type: string
          enum:
            - image
            - video
            - audio
          description: What the architecture generates.
        description:
          type: string
          description: What the model is for and its usage rules.
        image_inputs:
          type: object
          properties:
            first_frame:
              description: The field a first frame image goes in, or null.
              type:
                - string
                - 'null'
            last_frame:
              description: The field a last frame image goes in, or null.
              type:
                - string
                - 'null'
            references:
              anyOf:
                - type: object
                  properties:
                    field:
                      type: string
                      description: The field the first reference image goes in.
                    additional_field:
                      description: The list field further reference images go in, or null.
                      type:
                        - string
                        - 'null'
                  required:
                    - field
                    - additional_field
                  additionalProperties: false
                - type: 'null'
              description: >-
                Reference image fields, or null when the architecture takes
                none.
          required:
            - first_frame
            - last_frame
            - references
          additionalProperties: false
          description: >-
            The request field for each image role; an absent role is not
            supported.
        video_inputs:
          anyOf:
            - type: object
              properties:
                field:
                  type: string
                  description: The field holding the source video or videos.
              required:
                - field
              additionalProperties: false
            - type: 'null'
          description: >-
            The source-video field, or null when the architecture takes no
            video.
        base_config:
          type: object
          propertyNames:
            type: string
          additionalProperties: true
          description: The default config every request starts from.
        options:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: array
            items:
              type: string
          description: Allowed tokens per adjustable field, across all variants.
        options_by_model:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: object
            propertyNames:
              type: string
            additionalProperties:
              type: array
              items:
                type: string
          description: >-
            Per-variant narrowing of `options`, keyed by `model_id`; empty when
            variants share the lists.
        mentions:
          type: object
          properties:
            characters:
              type: array
              items:
                type: string
              description: >-
                Model ids whose prompts may mention `@character` handles; empty
                when none may.
            references:
              type: array
              items:
                type: string
              description: >-
                Model ids whose prompts may mention image `@reference` handles;
                empty when none may.
            audio_references:
              type: array
              items:
                type: string
              description: >-
                Model ids whose prompts may mention audio `@reference` handles;
                empty when none may.
            max_audio_references:
              type: integer
              description: >-
                Audio references per request. On a model that also sends
                character voices, the voices share these slots. 0 when the model
                takes no audio references, which does not stop it sending
                voices.
            character_voices:
              type: boolean
              description: >-
                Whether a mentioned character's voice is sent with its image,
                unless the request sets `use_character_voices` to false.
          required:
            - characters
            - references
            - audio_references
            - max_audio_references
            - character_voices
          additionalProperties: false
          description: >-
            Which saved characters and references a prompt may mention by
            `@handle`, per model variant.
        max_images:
          type: integer
          description: >-
            Image inputs, characters, and references per request, which share
            one budget.
        max_images_by_model:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: integer
          description: >-
            Per-variant overrides of `max_images`, keyed by `model_id`; empty
            when every variant shares it.
        input_schema:
          type: object
          properties:
            properties:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: object
                propertyNames:
                  type: string
                additionalProperties: true
            required:
              type: array
              items:
                type: string
          required:
            - properties
            - required
          additionalProperties: true
          description: The request body as JSON Schema (draft 2020-12), defaults folded in.
        gems:
          type: number
          description: The gem price of the default config.
        generate_url:
          type: string
          format: uri
          description: The endpoint to submit a generation to.
      required:
        - id
        - name
        - type
        - description
        - image_inputs
        - video_inputs
        - base_config
        - options
        - options_by_model
        - mentions
        - max_images
        - max_images_by_model
        - input_schema
        - gems
        - generate_url
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - invalid_request
                - invalid_config
                - architecture_not_found
                - architecture_retired
                - request_not_found
                - character_not_found
                - reference_not_found
                - not_found
                - insufficient_gems
                - payment_required
                - forbidden
                - content_blocked
                - request_finished
                - handle_taken
                - too_many_requests
                - generation_failed
                - preprocess_refused
                - internal_error
              description: A stable error code; treat an unknown code by its HTTP status.
            message:
              type: string
              description: What went wrong, for a person.
            request_id:
              description: >-
                The request the refusal belongs to, when one was recorded before
                the refusal.
              type: string
              format: uuid
            gems_required:
              description: The price of the refused generation, on `insufficient_gems`.
              type: number
            docs_url:
              description: Where to read the API reference, on `not_found`.
              type: string
              format: uri
            handle:
              description: The handle that is taken, on `handle_taken`.
              type: string
          required:
            - code
            - message
          additionalProperties: true
          description: Further fields depend on the code.
      required:
        - error
      additionalProperties: false
  responses:
    Unauthorized:
      description: The key is missing, malformed, unknown, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: The API key is invalid or has been revoked.
    PaymentRequired:
      description: >-
        The account has no successful payment yet: the API and the MCP server
        need one first (any Gem pack or plan). Signup bonus Gems work in the
        Mage app only.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: payment_required
              message: >-
                The Mage API and MCP server need a successful payment on this
                account first: buy any Gem pack or start a plan at
                https://www.mage.space/gems, then retry. Signup bonus Gems work
                in the Mage app only.
    InternalError:
      description: >-
        Something failed on Mage's side. Retry, and contact support if it
        persists.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: >-
                Something went wrong on our side. Retry, and contact support if
                it persists.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Create a key in [API → API
        Keys](https://www.mage.space/api?tab=api-keys): select **Create API
        key**, name it in the popup, then select **Create key**. Copy the
        one-time key and send it as `Authorization: Bearer mage_sk_…`. Keys are
        for server-side code only.

````

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