> ## 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.

# Create a batch

> Starts up to 50 generations in one request. They're priced and held together, so either all start or none do, and each then runs as its own generation with this batch's `batch_id`. Read each one with `GET /v1/generations/{id}`.

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



## OpenAPI

````yaml /openapi.json post /v1/batches
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/batches:
    post:
      tags:
        - Batches
      summary: Create a batch
      description: >-
        Starts up to 50 generations in one request. They're priced and held
        together, so either all start or none do, and each then runs as its own
        generation with this batch's `batch_id`. Read each one with `GET
        /v1/generations/{id}`.


        Needs an API key with the `generations:write` scope.
      operationId: createBatch
      parameters:
        - in: header
          name: Idempotency-Key
          schema:
            description: >-
              A key you generate for this request, such as a UUID, so a retry
              never starts a second run. A retry with the same key and body
              returns the same generation as it is now, marked
              `Idempotent-Replayed: true`. The same key with a different body is
              a `409`. A key belongs to your workspace and doesn't expire, so
              use a new one for each new request.
            example: 7f1c2a9e-3b4d-4e8a-9c21-5d0f6a7b8c90
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[\x21-\x7e]+$
          description: >-
            A key you generate for this request, such as a UUID, so a retry
            never starts a second run. A retry with the same key and body
            returns the same generation as it is now, marked
            `Idempotent-Replayed: true`. The same key with a different body is a
            `409`. A key belongs to your workspace and doesn't expire, so use a
            new one for each new request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      model:
                        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.
                      input:
                        default: {}
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      webhook:
                        description: >-
                          An https URL to POST the generation.succeeded,
                          generation.failed or generation.canceled event to when
                          the run ends, signed with your workspace's default
                          secret (GET /v1/webhooks/default/secret).
                        type: string
                        maxLength: 2048
                        format: uri
                    required:
                      - model
                    additionalProperties: false
                  description: >-
                    Up to 50 generations, each a model and its input. All are
                    priced and held together.
              required:
                - requests
              additionalProperties: false
      responses:
        '201':
          description: The batch, with each generation queued.
          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'
            Idempotent-Replayed:
              schema:
                type: string
                const: 'true'
                description: >-
                  Present when this answer replays the first request sent with
                  the same `Idempotency-Key`.
          content:
            application/json:
              example:
                id: bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp
                object: batch
                data:
                  - id: gen_2Pk7Wd4Qx9Lm1Tn6Vb3Rc8Hy
                    object: generation
                    model: black-forest-labs/flux-2-pro
                    modality: image
                    status: queued
                    provider: null
                    revision: '2026-10-02'
                    input:
                      prompt: A fox in the snow, watercolor
                      aspect_ratio: '1:1'
                      'n': 1
                    output: []
                    error: null
                    usage:
                      cost_usd: null
                    source: api
                    batch_id: bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp
                    created_at: '2026-10-04T18:22:41.512Z'
                    started_at: null
                    completed_at: null
                  - id: gen_9Rb3Hy6Tc1Vn8Lm4Qx7Wd2Pk
                    object: generation
                    model: black-forest-labs/flux-2-pro
                    modality: image
                    status: queued
                    provider: null
                    revision: '2026-10-02'
                    input:
                      prompt: A fox in the snow, linocut print
                      aspect_ratio: '1:1'
                      'n': 1
                    output: []
                    error: null
                    usage:
                      cost_usd: null
                    source: api
                    batch_id: bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp
                    created_at: '2026-10-04T18:22:41.512Z'
                    started_at: null
                    completed_at: null
              schema:
                $ref: '#/components/schemas/Batch'
        '400':
          $ref: '#/components/responses/InvalidParameterOrConflictingCredentials'
        '401':
          $ref: '#/components/responses/AuthenticationRequired'
        '402':
          $ref: '#/components/responses/InsufficientCredit'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '409':
          $ref: '#/components/responses/Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
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:
    Batch:
      type: object
      properties:
        id:
          type: string
          description: The batch's ID, `bat_...`.
        object:
          type: string
          const: batch
        data:
          type: array
          items:
            $ref: '#/components/schemas/Generation'
          description: Its generations, in the order you sent them.
      required:
        - id
        - object
        - data
      additionalProperties: false
      description: Up to 50 generations priced and held together, each run on its own.
    Generation:
      type: object
      properties:
        id:
          type: string
          description: The generation's ID, `gen_` and 24 letters and digits.
        object:
          type: string
          const: generation
        model:
          type: string
          description: The model or preset it runs, with a preset's version.
        modality:
          type: string
          enum:
            - image
            - video
            - audio
            - 3d
            - text
          description: 'What it makes: `image`, `video`, `audio`, `3d` or `text`.'
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - canceled
          description: >-
            `queued`, then `running`, then one of `succeeded`, `failed` or
            `canceled`. Only `succeeded` is charged.
        provider:
          description: >-
            Which upstream ran it, once one did. Informational: the model ID and
            input stay the same whichever runs it.
          type:
            - string
            - 'null'
        revision:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: The model's schema and price revision the run used.
        input:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            anyOf:
              - type:
                  - string
                  - number
                  - boolean
              - type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type:
                    - string
                    - number
                    - boolean
              - type: array
                items:
                  type: string
          description: The input as it runs, with the defaults filled in.
        output:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - image
                  - video
                  - audio
                  - 3d
                  - text
                description: 'What the file is: `image`, `video`, `audio`, `3d` or `text`.'
              url:
                type: string
                format: uri
                description: >-
                  A signed link to the file. Download what you keep: links
                  expire after 24 hours, and reading the generation again signs
                  fresh ones.
              expires_at:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                description: When `url` stops working, 24 hours after it was signed.
              content_type:
                type: string
                description: The file's media type, such as `image/jpeg` or `video/mp4`.
              width:
                anyOf:
                  - type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  - type: 'null'
                description: Width in pixels; null for a sound.
              height:
                anyOf:
                  - type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  - type: 'null'
                description: Height in pixels; null for a sound.
              poster:
                description: >-
                  For a video: a JPEG of a frame from its middle, about 720
                  pixels on the long side. Absent when none was made.
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: >-
                      A signed link to the poster, which expires with the
                      video's link.
                  expires_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  width:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  height:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                required:
                  - url
                  - expires_at
                  - width
                  - height
                additionalProperties: false
            required:
              - type
              - url
              - expires_at
              - content_type
              - width
              - height
            additionalProperties: false
        preview:
          description: >-
            While a preset that makes a still first is running: that still, once
            it exists, before the video it becomes. Absent for every other run,
            and for a run whose video also reads words or a photo you sent, such
            as a line to say or a photo the clip starts from: that still comes
            with the video.
          type: object
          properties:
            url:
              type: string
              format: uri
              description: >-
                A signed link to the still, which expires after 24 hours like an
                output's.
            expires_at:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            width:
              anyOf:
                - type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                - type: 'null'
            height:
              anyOf:
                - type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                - type: 'null'
          required:
            - url
            - expires_at
            - width
            - height
          additionalProperties: false
        error:
          anyOf:
            - type: object
              properties:
                message:
                  type: string
              required:
                - message
              additionalProperties: false
            - type: 'null'
          description: >-
            Why a `failed` run failed, such as a refused prompt or a provider
            error; null otherwise. A failed run isn't charged.
        usage:
          type: object
          properties:
            cost_usd:
              description: >-
                What the run cost, as an exact decimal string in US dollars;
                null until it's charged.
              type:
                - string
                - 'null'
          required:
            - cost_usd
          additionalProperties: false
          description: What the run cost your workspace.
        source:
          anyOf:
            - type: string
              enum:
                - studio
                - api
                - mcp
            - type: 'null'
          description: 'Where it was started: `api`, `mcp` or `studio`.'
        batch_id:
          description: The batch it belongs to, `bat_...`; null if none.
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
          description: When it was created.
        started_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            - type: 'null'
          description: When it started running; null while queued.
        completed_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            - type: 'null'
          description: When it reached a final status; null before.
      required:
        - id
        - object
        - model
        - modality
        - status
        - provider
        - revision
        - input
        - output
        - error
        - usage
        - source
        - batch_id
        - created_at
        - started_at
        - completed_at
      additionalProperties: false
      description: >-
        One run of a model or preset, with its status, its outputs and what it
        cost.
    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:
    InvalidParameterOrConflictingCredentials:
      description: '`invalid_parameter`, `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:
            invalid_parameter:
              value:
                error:
                  type: invalid_request_error
                  code: invalid_parameter
                  message: Invalid request parameters.
                  param: null
                  doc_url: null
                  request_id: req_8kQ2vX9mR4tL6nB1cW3yZ5aD
            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
    InsufficientCredit:
      description: '`insufficient_credit`'
      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:
            insufficient_credit:
              value:
                error:
                  type: billing_error
                  code: insufficient_credit
                  message: Not enough credit. Add credits to keep generating.
                  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
    Conflict:
      description: '`conflict`'
      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:
            conflict:
              value:
                error:
                  type: conflict_error
                  code: conflict
                  message: The request conflicts with the current state.
                  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
    ServiceUnavailable:
      description: '`service_unavailable`'
      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:
            service_unavailable:
              value:
                error:
                  type: api_error
                  code: service_unavailable
                  message: Service unavailable.
                  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.