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

> ## Agent Instructions
> Leap's API is at https://api.tryleap.ai. Send the key in the x-api-key header or as Authorization: Bearer; keys start with leap_.
> Take model IDs and input schemas from GET /v1/models/{creator}/{name}, or from https://api.tryleap.ai/v1/public/models without a key. Never guess an input field: unknown fields are a 400.
> Model inputs take uploaded file IDs (file_...), never URLs.
> To give a coding agent the whole API, install the Leap skill: curl -fsSL https://www.tryleap.ai/install.sh | sh
> The full OpenAPI 3.1 spec is at https://www.tryleap.ai/docs/openapi.json.

# Retrieve a model

> One model or preset with `input_schema`, the JSON Schema (2020-12) of the `input` it takes. Build your request from it: required fields, allowed values and defaults are all there, and unknown fields are refused.

Needs an API key with the `generations:read` scope.



## OpenAPI

````yaml /openapi.json get /v1/models/{creator}/{name}
openapi: 3.1.0
info:
  title: Leap API
  version: 1.0.0
  description: >-
    One API for the best image, video and audio models. Every request goes to
    `https://api.tryleap.ai` with your API key in the `x-api-key` header, or as
    `Authorization: Bearer leap_...`. Create a key at
    https://app.tryleap.ai/go/api.


    Guides, examples and the errors list are at https://www.tryleap.ai/docs.
servers:
  - url: https://api.tryleap.ai
security:
  - ApiKey: []
  - Bearer: []
tags:
  - name: Models
    description: >-
      Every model and preset you can run, with its price and the JSON Schema of
      the input it takes.
  - name: Quotes
    description: >-
      The exact price of a run before you start it, with its input checked and
      its defaults filled in.
  - name: Generations
    description: >-
      A generation is one run of a model or preset: queued, then running, then
      succeeded, failed or canceled. Only a succeeded run is charged.
  - name: Batches
    description: >-
      Up to 50 generations priced and held together in one request, each then
      run as its own generation.
  - name: Webhooks
    description: >-
      URLs your workspace's events are POSTed to, signed following Standard
      Webhooks, and the default secret for the `webhook` URL a request names.
  - name: Events
    description: >-
      What happened in your workspace, kept 30 days, with each delivery to your
      webhooks and a way to send one again.
  - name: Files
    description: >-
      Photos, videos and sounds that models take as input. Upload one, then pass
      its `file_...` ID in the input field the model's schema names.
  - name: Credits
    description: Your workspace's balance in US dollars.
externalDocs:
  url: https://www.tryleap.ai/docs
paths:
  /v1/models/{creator}/{name}:
    get:
      tags:
        - Models
      summary: Retrieve a model
      description: >-
        One model or preset with `input_schema`, the JSON Schema (2020-12) of
        the `input` it takes. Build your request from it: required fields,
        allowed values and defaults are all there, and unknown fields are
        refused.


        Needs an API key with the `generations:read` scope.
      operationId: retrieveModel
      parameters:
        - in: path
          name: creator
          schema:
            type: string
            description: >-
              The first part of the model ID, such as `black-forest-labs` or
              `leap`.
          required: true
          description: >-
            The first part of the model ID, such as `black-forest-labs` or
            `leap`.
        - in: path
          name: name
          schema:
            type: string
            description: >-
              The second part, such as `flux-2-pro`, or `restore-photo@1` for a
              preset.
          required: true
          description: >-
            The second part, such as `flux-2-pro`, or `restore-photo@1` for a
            preset.
      responses:
        '200':
          description: The model and its input schema.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Deprecation:
              schema:
                type: string
                description: >-
                  Present when the model or preset is deprecated: when it was,
                  as `@` and a Unix time (RFC 9745).
            Sunset:
              schema:
                type: string
                description: >-
                  Present when the model or preset is deprecated: the date it
                  stops running, as an HTTP date (RFC 8594).
            Link:
              schema:
                type: string
                description: >-
                  For a deprecated model with a replacement: `</v1/models/{id}>;
                  rel="successor-version"`.
          content:
            application/json:
              example:
                id: black-forest-labs/flux-2-pro
                object: model
                type: model
                name: FLUX.2 [pro]
                creator: Black Forest Labs
                modality: image
                tasks:
                  - text-to-image
                description: >-
                  Black Forest Labs' second generation: sharper detail and text
                  than FLUX1.1, at a lower price.
                revision: '2026-10-02'
                version: null
                latest: true
                status: stable
                deprecation: null
                pricing:
                  unit: image
                  usd: '0.033'
                  overrides: []
                  drivers:
                    - 'n'
                input_schema:
                  type: object
                  additionalProperties: false
                  required:
                    - prompt
                  properties:
                    prompt:
                      type: string
                      pattern: \S
                    aspect_ratio:
                      type: string
                      enum:
                        - '1:1'
                        - '3:2'
                        - '2:3'
                        - '4:3'
                        - '3:4'
                        - '16:9'
                        - '9:16'
                        - '21:9'
                        - '9:21'
                      default: '1:1'
                    'n':
                      type: integer
                      minimum: 1
                      maximum: 4
                      default: 1
                    seed:
                      type: integer
                      minimum: 0
                      maximum: 4294967295
              schema:
                $ref: '#/components/schemas/ModelWithSchema'
        '400':
          $ref: '#/components/responses/ConflictingCredentials'
        '401':
          $ref: '#/components/responses/AuthenticationRequired'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  headers:
    X-Request-Id:
      required: true
      description: >-
        This request's ID. Include it when you contact support; it's also
        `request_id` in an error.
      schema:
        type: string
        description: >-
          This request's ID. Include it when you contact support; it's also
          `request_id` in an error.
        example: req_01J9Z8Q4N2K7T5V3X6Y8B0C1D2
    RateLimit-Limit:
      required: true
      description: Requests allowed per window from your client.
      schema:
        type: integer
        minimum: 0
        maximum: 9007199254740991
        description: Requests allowed per window from your client.
        example: 300
    RateLimit-Remaining:
      required: true
      description: Requests left in the current window.
      schema:
        type: integer
        minimum: 0
        maximum: 9007199254740991
        description: Requests left in the current window.
        example: 299
    RateLimit-Reset:
      required: true
      description: Seconds until the window resets.
      schema:
        type: integer
        minimum: 0
        maximum: 9007199254740991
        description: Seconds until the window resets.
        example: 42
    Retry-After:
      required: true
      description: Seconds to wait before you retry.
      schema:
        type: integer
        minimum: 0
        maximum: 9007199254740991
        description: Seconds to wait before you retry.
        example: 42
  schemas:
    ModelWithSchema:
      type: object
      properties:
        id:
          type: string
          maxLength: 100
          pattern: ^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$
          description: >-
            The ID to run it by: `creator/name` for a model, `leap/name@N` for a
            preset.
        object:
          type: string
          const: model
        type:
          type: string
          enum:
            - model
            - preset
          description: >-
            `model` for a raw model, `preset` for a ready-made recipe built on
            one.
        name:
          type: string
          description: Its display name.
        creator:
          type: string
          description: Who made it.
        modality:
          type: string
          enum:
            - image
            - video
            - audio
            - 3d
            - text
          description: 'What it makes: `image`, `video`, `audio`, `3d` or `text`.'
        tasks:
          type: array
          items:
            type: string
            enum:
              - text-to-image
              - image-edit
              - outpaint
              - upscale-image
              - remove-background
              - try-on
              - text-to-video
              - image-to-video
              - video-to-video
              - upscale-video
              - lip-sync
              - talking-avatar
              - text-to-speech
              - voice-clone
              - text-to-music
              - sound-effects
              - image-to-3d
              - text-to-3d
              - video-to-audio
              - speech-to-speech
              - motion-transfer
              - speech-to-text
              - captions
          description: >-
            What it does, main task first, such as `text-to-image` or
            `image-to-video`.
        description:
          type: string
          description: What it's good at, in a sentence.
        revision:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: The date of its current schema and price.
        version:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: 'null'
          description: A preset's version, the `N` in `@N`; null for a model.
        latest:
          type: boolean
          description: >-
            Whether a preset ID without `@N` runs this version. Always true for
            a model.
        status:
          type: string
          enum:
            - preview
            - stable
            - deprecated
            - retired
          description: >-
            `preview` (may still change), `stable`, `deprecated` (runs until its
            sunset) or `retired` (doesn't run).
        deprecation:
          anyOf:
            - type: object
              properties:
                deprecated_on:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: When it was deprecated.
                sunset:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: The day it stops running.
                replaced_by:
                  description: The model or preset to move to, if any.
                  type:
                    - string
                    - 'null'
                reason:
                  type: string
                  enum:
                    - upstream_retired
                    - superseded
                    - discontinued
                  description: Why it's going away.
              required:
                - deprecated_on
                - sunset
                - replaced_by
                - reason
              additionalProperties: false
            - type: 'null'
          description: When and why it's going away; null unless it's deprecated.
        added:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        pricing:
          type: object
          properties:
            unit:
              type: string
              enum:
                - image
                - megapixel
                - second
                - character
                - output
                - minute
            usd:
              type: string
            overrides:
              default: []
              type: array
              items:
                type: object
                properties:
                  when:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type:
                        - string
                        - number
                        - boolean
                  usd:
                    type: string
                required:
                  - when
                  - usd
                additionalProperties: false
            drivers:
              type: array
              items:
                type: string
            length_of:
              type: array
              items:
                type: string
            length_step:
              type: number
              exclusiveMinimum: 0
          required:
            - unit
            - usd
            - overrides
            - drivers
          additionalProperties: false
        guide:
          type: object
          properties:
            hook:
              type: string
            steps:
              type: array
              prefixItems:
                - type: string
                - type: string
                - type: string
              items: false
              minItems: 3
              maxItems: 3
            next:
              type: array
              items:
                type: string
                maxLength: 100
                pattern: ^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$
                description: The model to call, as creator/name. GET /v1/models lists them.
            poster:
              type: object
              properties:
                at:
                  type: number
                  minimum: 0
                  maximum: 1
              required:
                - at
              additionalProperties: false
          required:
            - hook
            - steps
            - next
          additionalProperties: false
        cover:
          type: object
          properties:
            poster:
              type: string
              format: uri
            clip:
              type: object
              properties:
                mp4:
                  type: string
                  format: uri
                webm:
                  type: string
                  format: uri
                captions:
                  type: string
                  format: uri
              required:
                - mp4
              additionalProperties: false
            width:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            height:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            alt:
              type: string
            peak:
              type: number
              minimum: 0
            input:
              type: object
              properties:
                poster:
                  type: string
                  format: uri
                width:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                height:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                alt:
                  type: string
                kept:
                  type: string
                  const: product
              required:
                - poster
                - width
                - height
                - alt
              additionalProperties: false
          required:
            - poster
            - width
            - height
            - alt
          additionalProperties: false
        gallery:
          type: array
          items:
            type: object
            properties:
              poster:
                type: string
                format: uri
              clip:
                type: object
                properties:
                  mp4:
                    type: string
                    format: uri
                  webm:
                    type: string
                    format: uri
                  captions:
                    type: string
                    format: uri
                required:
                  - mp4
                additionalProperties: false
              width:
                type: integer
                exclusiveMinimum: 0
                maximum: 9007199254740991
              height:
                type: integer
                exclusiveMinimum: 0
                maximum: 9007199254740991
              alt:
                type: string
              peak:
                type: number
                minimum: 0
              input:
                type: object
                properties:
                  poster:
                    type: string
                    format: uri
                  width:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  height:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  alt:
                    type: string
                  kept:
                    type: string
                    const: product
                required:
                  - poster
                  - width
                  - height
                  - alt
                additionalProperties: false
            required:
              - poster
              - width
              - height
              - alt
            additionalProperties: false
        input_schema:
          type: object
          additionalProperties: true
          description: >-
            A JSON Schema (2020-12) of the `input` it takes: required fields,
            types, allowed values and defaults. Unknown fields are refused, and
            a field that takes a file has the pattern `^file_[0-9A-Za-z]{24}$`.
      required:
        - id
        - object
        - type
        - name
        - creator
        - modality
        - tasks
        - description
        - revision
        - version
        - latest
        - status
        - deprecation
        - pricing
        - input_schema
      additionalProperties: false
      description: A model or preset with the JSON Schema of its input.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - rate_limit_error
                - authentication_error
                - permission_error
                - conflict_error
                - billing_error
                - api_error
              description: >-
                The kind of error. Branch on `type` and `code`, never on
                `message`.
            code:
              type: string
              enum:
                - invalid_parameter
                - invalid_request
                - conflicting_credentials
                - placeholder_in_path
                - method_not_allowed
                - payload_too_large
                - unsupported_media_type
                - ip_rate_limit_exceeded
                - authentication_required
                - missing_api_key
                - invalid_api_key
                - permission_denied
                - not_found
                - resource_not_found
                - gone
                - conflict
                - rate_limit_exceeded
                - insufficient_credit
                - service_unavailable
                - internal_error
              description: >-
                A stable code for this error. Each one is explained at
                https://www.tryleap.ai/docs/errors.
            message:
              type: string
              description: >-
                What went wrong, written for a person. It can change; don't
                parse it.
            param:
              description: >-
                For a `400`, the field at fault, such as `input.prompt`;
                otherwise null.
              type:
                - string
                - 'null'
            doc_url:
              description: A page that explains this error, when there is one.
              type:
                - string
                - 'null'
            request_id:
              type: string
              description: >-
                This request's ID, as in the `X-Request-Id` header. Include it
                when you contact support.
          required:
            - type
            - code
            - message
            - param
            - doc_url
            - request_id
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  responses:
    ConflictingCredentials:
      description: '`conflicting_credentials`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            conflicting_credentials:
              value:
                error:
                  type: invalid_request_error
                  code: conflicting_credentials
                  message: Send one API key.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
    AuthenticationRequired:
      description: '`authentication_required`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            authentication_required:
              value:
                error:
                  type: authentication_error
                  code: authentication_required
                  message: Authentication is required.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
    PermissionDenied:
      description: '`permission_denied`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            permission_denied:
              value:
                error:
                  type: permission_error
                  code: permission_denied
                  message: Permission denied.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
    ResourceNotFound:
      description: '`resource_not_found`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            resource_not_found:
              value:
                error:
                  type: invalid_request_error
                  code: resource_not_found
                  message: That resource does not exist.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
    Gone:
      description: '`gone`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            gone:
              value:
                error:
                  type: invalid_request_error
                  code: gone
                  message: That resource was retired.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
    RateLimitExceeded:
      description: '`rate_limit_exceeded`'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limit_exceeded:
              value:
                error:
                  type: rate_limit_error
                  code: rate_limit_exceeded
                  message: Too Many Requests
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your workspace API key, `leap_...`. Create one at
        https://app.tryleap.ai/go/api, and keep it on your server.
    Bearer:
      type: http
      scheme: bearer
      description: >-
        The same API key as `Authorization: Bearer leap_...`, the way most HTTP
        clients and coding agents send one. Send one header or the other; two
        different keys are a `400`.

````

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