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

# Quote Runs

> Get the amount Glasser would reserve for each request before you run it. This free request creates no Run and reserves no balance.

* **Request:** send 1 to 20 entries in `requests`. Each has the `provider`, `endpoint`, `input` and `endpoint_version` you would send to [Create a Run](https://glasser.ai/docs/api-reference/runs/create.md).
* **Response:** `data` has one entry per request, in the same order. An entry with `hold_usd` is a quote. An entry with `error` was refused, and Create a Run would refuse it for the same reason.

`hold_usd` is the reservation at the current Price, not a guaranteed ceiling. The final charge can be higher when the Provider returns more than the input asked for, or when the Price changes before the Run.


## OpenAPI

````yaml /openapi.json post /v1/runs/quote
openapi: 3.1.0
info:
  title: Glasser
  version: 0.0.1
  description: >-
    One key, no contract, pay per call, across paid APIs bought wholesale. Every
    response carries x-request-id; every error body carries the same envelope.
servers:
  - url: https://api.glasser.ai
security: []
tags:
  - name: Solutions
  - name: Endpoints
  - name: Runs
  - name: Feedback
  - name: Balance
paths:
  /v1/runs/quote:
    post:
      tags:
        - Runs
      summary: Quote Runs
      description: >-
        Get the amount Glasser would reserve for each request before you run it.
        Send 1 to 20 requests, each with the provider, endpoint, input and
        endpoint_version you would send to Run an Endpoint. This free request
        creates no Run, reserves no balance and calls no Provider.


        Each entry in data matches the request at the same position. An entry
        with hold_usd is a quote, computed with the same checks as Run an
        Endpoint. An entry with error was refused, and Run an Endpoint would
        refuse it for the same reason: validation_failed, not_found,
        endpoint_not_permitted or endpoint_version_mismatch.


        hold_usd is the reservation at the current Price, not a guaranteed
        ceiling. The final charge is usually at or below it. It can be higher
        when the Provider returns more than the input asked for, or when the
        Price changes before the Run. A quote does not lock the Price and does
        not check your balance.
      operationId: runs-quote
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    type: object
                    properties:
                      provider:
                        type: string
                        pattern: ^[a-z0-9][a-z0-9-]*$
                      endpoint:
                        type: string
                        pattern: ^\/.+$
                      input:
                        anyOf:
                          - type: object
                          - type: array
                            items:
                              type: object
                        description: >-
                          Provider-native input. Build it from the input_schema
                          returned by Inspect.
                      endpoint_version:
                        anyOf:
                          - type: integer
                            exclusiveMinimum: 0
                            description: >-
                              Select a supported version, or omit for the
                              default. Compatible updates keep the version;
                              unavailable or retired versions return 409. A
                              version does not lock Price: new Runs use the
                              Price at admission, and accepted Runs keep it
                              through settlement.
                          - type: 'null'
                    required:
                      - provider
                      - endpoint
                    additionalProperties: false
                  minItems: 1
                  maxItems: 20
                  description: >-
                    1 to 20 requests. Each has the provider, endpoint, input and
                    endpoint_version you would send to Run an Endpoint.
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            provider:
                              type: string
                              pattern: ^[a-z0-9][a-z0-9-]*$
                            endpoint:
                              type: string
                              pattern: ^\/.+$
                            endpoint_version:
                              type: integer
                              description: The Endpoint version this quote resolved to.
                            hold_usd:
                              type: string
                              pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                              description: >-
                                The amount Glasser would reserve for this input
                                at the current Price. Not a guaranteed ceiling
                                for the final charge.
                            price:
                              type: object
                              properties:
                                rule:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - flat
                                        amount_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                      required:
                                        - type
                                        - amount_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - per_result
                                        per_result_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        cap_usd:
                                          anyOf:
                                            - type: string
                                              pattern: >-
                                                ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                              description: >-
                                                Exact USD decimal string (min 2, max 6
                                                decimals, one canonical spelling). Sum
                                                with decimal arithmetic or scale by 10^6
                                                — never floats.
                                            - type: 'null'
                                        partial_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                      required:
                                        - type
                                        - per_result_usd
                                        - cap_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - per_token
                                        per_million_input_tokens_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        cap_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                      required:
                                        - type
                                        - per_million_input_tokens_usd
                                        - cap_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - base_plus_per_result
                                        base_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        included_results:
                                          type: integer
                                          minimum: 0
                                        per_extra_result_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        cap_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        unit:
                                          type: string
                                      required:
                                        - type
                                        - base_usd
                                        - included_results
                                        - per_extra_result_usd
                                        - cap_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - metered
                                        base_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        cap_usd:
                                          anyOf:
                                            - type: string
                                              pattern: >-
                                                ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                              description: >-
                                                Exact USD decimal string (min 2, max 6
                                                decimals, one canonical spelling). Sum
                                                with decimal arithmetic or scale by 10^6
                                                — never floats.
                                            - type: 'null'
                                        base_kind:
                                          type: string
                                          enum:
                                            - starting
                                      required:
                                        - type
                                        - base_usd
                                        - cap_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - per_event
                                        events:
                                          type: object
                                          additionalProperties:
                                            type: object
                                            properties:
                                              usd:
                                                type: string
                                                pattern: >-
                                                  ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                                description: >-
                                                  Exact USD decimal string (min 2, max 6
                                                  decimals, one canonical spelling). Sum
                                                  with decimal arithmetic or scale by 10^6
                                                  — never floats.
                                              title:
                                                type: string
                                            required:
                                              - usd
                                              - title
                                            additionalProperties: false
                                        base_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                        cap_usd:
                                          type: string
                                          pattern: >-
                                            ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                          description: >-
                                            Exact USD decimal string (min 2, max 6
                                            decimals, one canonical spelling). Sum
                                            with decimal arithmetic or scale by 10^6
                                            — never floats.
                                      required:
                                        - type
                                        - events
                                        - base_usd
                                        - cap_usd
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                      required:
                                        - type
                                      allOf:
                                        - type: object
                                          additionalProperties: {}
                                display:
                                  type: object
                                  properties:
                                    amount_usd:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                    unit:
                                      type: string
                                    cap_usd:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                  required:
                                    - amount_usd
                                    - unit
                                  additionalProperties: false
                                charges:
                                  type: object
                                  properties:
                                    NO_RESULT:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                    PROVIDER_ERROR:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                    TIMED_OUT:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                    INTERNAL:
                                      type: string
                                      pattern: >-
                                        ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
                                      description: >-
                                        Exact USD decimal string (min 2, max 6
                                        decimals, one canonical spelling). Sum
                                        with decimal arithmetic or scale by 10^6
                                        — never floats.
                                  required:
                                    - NO_RESULT
                                    - PROVIDER_ERROR
                                    - TIMED_OUT
                                    - INTERNAL
                                  additionalProperties: false
                              required:
                                - rule
                                - display
                                - charges
                              additionalProperties: false
                              description: The Price this quote used.
                          required:
                            - provider
                            - endpoint
                            - endpoint_version
                            - hold_usd
                            - price
                          additionalProperties: false
                        - type: object
                          properties:
                            provider:
                              type: string
                            endpoint:
                              type: string
                            error:
                              type: object
                              properties:
                                code:
                                  type: string
                                  enum:
                                    - validation_failed
                                    - not_found
                                    - endpoint_not_permitted
                                    - endpoint_version_mismatch
                                message:
                                  type: string
                                control:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                details:
                                  anyOf:
                                    - type: object
                                    - type: 'null'
                              required:
                                - code
                                - message
                              additionalProperties: false
                          required:
                            - provider
                            - endpoint
                            - error
                          additionalProperties: false
                    description: >-
                      One entry per request, in the same order. An entry with
                      hold_usd is a quote; an entry with error was refused and
                      would be refused by Run an Endpoint for the same reason.
                required:
                  - data
                additionalProperties: false
        '400':
          description: ValidationFailed
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ValidationFailedEncoded'
                  - $ref: '#/components/schemas/ValidationFailedEncoded'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedEncoded'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenEncoded'
        '429':
          description: RateLimited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedEncoded'
      security:
        - bearer: []
components:
  schemas:
    ValidationFailedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    UnauthorizedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    ForbiddenEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
    RateLimitedEncoded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - rate_limited
            message:
              type: string
            reason:
              anyOf:
                - type: string
                - type: 'null'
            control:
              anyOf:
                - type: string
                - type: 'null'
            retry_after_ms:
              anyOf:
                - anyOf:
                    - type: integer
                    - type: 'null'
                - type: 'null'
            details:
              anyOf:
                - type: object
                - type: 'null'
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - error
        - request_id
      additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: Bearer

````

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