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

# Start an endpoint run

> Runs an endpoint. Send `provider`, `endpoint` and an `input` that follows the schema from `POST /v1/inspect`. A synchronous run returns the full run, with an HTTP status that matches the provider's status. A run blocked by a workspace budget or run cap returns 200 with status `BLOCKED`. A run that goes over its time budget returns 408. Asynchronous endpoints return 202, so poll `GET /v1/runs/{runId}` for the result.



## OpenAPI

````yaml https://monid.ai/openapi.json post /v1/run
openapi: 3.1.0
info:
  title: Monid API
  version: 0.1.0
  description: >-
    Agentic payment platform for data. Agents use it to discover and buy data on
    demand. Authenticated routes take a Monid API key as a Bearer token. Errors
    return `{ code, message }`. List endpoints use cursor pagination.
servers:
  - url: https://api.monid.ai
    description: Production
security: []
paths:
  /v1/run:
    post:
      tags:
        - Runs
      summary: Start an endpoint run
      description: >-
        Runs an endpoint. Send `provider`, `endpoint` and an `input` that
        follows the schema from `POST /v1/inspect`. A synchronous run returns
        the full run, with an HTTP status that matches the provider's status. A
        run blocked by a workspace budget or run cap returns 200 with status
        `BLOCKED`. A run that goes over its time budget returns 408.
        Asynchronous endpoints return 202, so poll `GET /v1/runs/{runId}` for
        the result.
      parameters:
        - schema:
            type: string
            pattern: ^[\x20-\x7E]{1,255}$
            description: >-
              Optional. Send the same key when you repeat this request to get
              the same run instead of a new run and a new charge. The repeat
              gets the response the first request got, whatever the run's
              outcome; a synchronous run that is still running is waited for. To
              try again after a run failed, send a new key. Keys are per
              workspace and last 7 days.
            example: wf_01JGXYZ:step-3
          required: false
          description: >-
            Optional. Send the same key when you repeat this request to get the
            same run instead of a new run and a new charge. The repeat gets the
            response the first request got, whatever the run's outcome; a
            synchronous run that is still running is waited for. To try again
            after a run failed, send a new key. Keys are per workspace and last
            7 days.
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
      responses:
        '200':
          description: >-
            The finished run. It is `COMPLETED` when the provider answered, or
            `BLOCKED` when a workspace control stopped it. When the provider
            answers with a non-2xx status, this API returns that same status
            with this same body. The one exception is a provider 402, which is
            returned as 502.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/RunCompleted'
                  - $ref: '#/components/schemas/RunBlocked'
        '202':
          description: >-
            The asynchronous run was accepted. Poll `GET /v1/runs/{runId}` for
            the result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunAccepted'
        '400':
          description: >-
            Bad request. The input failed validation and `message` says which
            field, or the run's estimated cost is above `maxCost`. In that case
            `errorCode` is `MAX_COST_EXCEEDED`, nothing was saved or charged,
            and `message` names the estimate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized. The API key is missing, invalid, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Payment required. The workspace wallet balance is too low for this
            run. A 402 from this API is always about your wallet. Top up with
            `POST /v1/wallet/topup/sessions`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden. The API key lacks the scope this operation needs, or has
            no workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Endpoint not found for provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '408':
          description: >-
            The run went over its time budget and ended as `TIMED_OUT`. It is
            not charged. The body is the full run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunCompleted'
        '409':
          description: >-
            The first request with this `Idempotency-Key` is still being started
            (`errorCode` `IDEMPOTENCY_KEY_IN_USE`). Repeat it shortly with the
            same key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            The `Idempotency-Key` was already used with a different request
            (`errorCode` `IDEMPOTENCY_KEY_REUSED`). Send a new key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited. Wait the number of seconds in the `Retry-After`
            header, then retry. The `RateLimit-Limit`, `RateLimit-Remaining` and
            `RateLimit-Reset` headers describe the limit that applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            The provider returned 402, which is a problem with its own account
            and not your wallet. The body is the full `COMPLETED` run with the
            provider's error in `providerResponse.error`. The run is not
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunCompleted'
      security:
        - Bearer:
            - runs:create
components:
  schemas:
    RunRequest:
      type: object
      properties:
        provider:
          type: string
          minLength: 1
          description: Provider slug.
          example: exa
        endpoint:
          type: string
          minLength: 1
          description: Endpoint path within the provider.
          example: search
        maxCost:
          type: number
          minimum: 0
          description: >-
            Maximum US dollars for this run's estimated cost. If the estimate is
            higher, the call fails with status 400 and errorCode
            MAX_COST_EXCEEDED. Metered and per-result endpoints are billed on
            actual usage and can end above it. At most 6 decimals. 0 allows only
            free runs.
          example: 0.05
        input:
          type: object
          properties:
            body:
              type: object
              additionalProperties: {}
              description: Request body fields.
            queryParams:
              type: object
              additionalProperties: {}
              description: URL query string parameters.
            pathParams:
              type: object
              additionalProperties: {}
              description: URL path placeholder substitutions (e.g. {id} in `/users/{id}`).
          additionalProperties: false
          description: >-
            Composite endpoint input — body + URL query + URL path. All
            sub-fields optional.
        tag:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[\x21-\x22\x24-\x7E](?:[\x20-\x22\x24-\x7E]*[\x21-\x22\x24-\x7E])?$
          description: >-
            Optional label for grouping and finding runs later with `GET
            /v1/runs?tag=` (exact, case-sensitive match), e.g. your customer or
            job ID. 1-128 printable ASCII characters, no '#', no leading or
            trailing space. Set at creation; never editable.
      required:
        - provider
        - endpoint
      additionalProperties: false
    RunCompleted:
      type: object
      properties:
        runId:
          type: string
        provider:
          type: string
        endpoint:
          type: string
        tag:
          type: string
          description: >-
            The caller-chosen tag the run was created with. Omitted when the run
            has no tag.
          example: customer-42
        status:
          type: string
          enum:
            - READY
            - RUNNING
            - STOPPING
            - COMPLETED
            - FAILED
            - BLOCKED
            - STOPPED
            - TIMED_OUT
          description: >-
            Run lifecycle status. Always one of the UPPERCASE enum values (e.g.
            COMPLETED, never completed) — compare case-sensitively. In progress:
            READY (created, not started), RUNNING, STOPPING (a stop is being
            finalized; ends COMPLETED or STOPPED). Terminal: COMPLETED (the
            provider responded, with any HTTP status — read
            providerResponse.httpStatus; a user stop the provider could not
            confirm in time also ends COMPLETED, billed by elapsed time, with a
            synthetic httpStatus 200 and output.billingBasis "ESTIMATED"),
            FAILED (an infrastructure failure), BLOCKED (a workspace control
            such as a budget, run cap or the wallet balance refused the run; see
            `reason`), STOPPED (stopped on request), TIMED_OUT (the run exceeded
            its time budget).
        output:
          description: >-
            Provider output data (terminal runs only; may be null). Endpoints
            that generate FILES (e.g. audio) surface each file INSIDE output as
            an artifact object under a stable key: { download_link (fresh signed
            URL, valid until link_expires_at — re-fetch the run for a new one),
            content_type, link_expires_at, file_expires_at? }. After the file's
            retention lapses the object becomes { expired: true,
            file_expired_at, message }.
        providerResponse:
          $ref: '#/components/schemas/ProviderResponse'
        price:
          $ref: '#/components/schemas/Price'
        billing:
          $ref: '#/components/schemas/RunBilling'
        resultCount:
          type: number
          minimum: 0
        billedUnits:
          type: number
          minimum: 0
        resources:
          type: array
          items:
            type: object
            properties:
              action:
                type: string
                enum:
                  - PROVISIONED
                  - PROVISION_FAILED
                  - RELEASED
                  - RELEASE_FAILED
              resourceId:
                type: string
                minLength: 1
              resourceType:
                type: string
                enum:
                  - web_monitor
                  - phone_number
                  - file_system
                  - asset_library
                  - machine
                  - email_account
                  - email_inbox
                  - email_domain
                  - browser_session
                  - browser_profile
                  - voice
                  - tracked_app
                  - agent_session
                  - video_channel
                  - video
                  - voice_agent
                  - voice_conversation
                  - human_task
              identifier:
                type: string
                minLength: 1
            required:
              - action
              - resourceId
              - resourceType
              - identifier
        stopRequestedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
      required:
        - runId
        - provider
        - endpoint
        - status
        - providerResponse
        - price
        - createdAt
    RunBlocked:
      type: object
      properties:
        runId:
          type: string
        status:
          type: string
          enum:
            - BLOCKED
          description: >-
            Always the literal BLOCKED (UPPERCASE, case-sensitive) — a workspace
            control gate rejected the run; see `reason`.
        provider:
          type: string
        endpoint:
          type: string
        tag:
          type: string
          description: >-
            The caller-chosen tag the run was created with. Omitted when the run
            has no tag.
          example: customer-42
        reason:
          type: string
          description: >-
            BLOCKED only: why the workspace control refused the run, written for
            the user (which limit and the amounts involved). A blocked run
            carries its cause here, not in an `error` field.
        price:
          $ref: '#/components/schemas/Price'
        controls:
          type: array
          items:
            type: object
            properties:
              controlId:
                type: string
              controlType:
                type: string
              requiredAmount:
                type: number
                description: The gate's pre-flight cost hold/estimate (dollars).
              snapshot:
                type: object
                additionalProperties: {}
                description: >-
                  Dollarized control state snapshot at gate time (same shape as
                  /v1/runs/{runId}/controls).
            required:
              - controlId
              - controlType
              - snapshot
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
      required:
        - runId
        - status
        - provider
        - endpoint
        - reason
        - price
        - controls
        - createdAt
        - completedAt
    RunAccepted:
      type: object
      properties:
        runId:
          type: string
        provider:
          type: string
        endpoint:
          type: string
        tag:
          type: string
          description: >-
            The caller-chosen tag the run was created with. Omitted when the run
            has no tag.
          example: customer-42
        status:
          type: string
          enum:
            - READY
            - RUNNING
            - STOPPING
            - COMPLETED
            - FAILED
            - BLOCKED
            - STOPPED
            - TIMED_OUT
          description: >-
            Run lifecycle status. Always one of the UPPERCASE enum values (e.g.
            COMPLETED, never completed) — compare case-sensitively. In progress:
            READY (created, not started), RUNNING, STOPPING (a stop is being
            finalized; ends COMPLETED or STOPPED). Terminal: COMPLETED (the
            provider responded, with any HTTP status — read
            providerResponse.httpStatus; a user stop the provider could not
            confirm in time also ends COMPLETED, billed by elapsed time, with a
            synthetic httpStatus 200 and output.billingBasis "ESTIMATED"),
            FAILED (an infrastructure failure), BLOCKED (a workspace control
            such as a budget, run cap or the wallet balance refused the run; see
            `reason`), STOPPED (stopped on request), TIMED_OUT (the run exceeded
            its time budget).
        price:
          $ref: '#/components/schemas/Price'
        createdAt:
          type: string
          format: date-time
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
      required:
        - runId
        - provider
        - endpoint
        - status
        - price
        - createdAt
    Error:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code, duplicated in the body.
          example: 400
        message:
          type: string
          description: Human-readable error description.
          example: Bad Request
        errorCode:
          type: string
          enum:
            - BAD_REQUEST
            - VALIDATION_FAILED
            - INVALID_JSON
            - INVALID_CURSOR
            - UNAUTHENTICATED
            - FORBIDDEN
            - NOT_FOUND
            - CONFLICT
            - GONE
            - PAYLOAD_TOO_LARGE
            - INTERNAL_ERROR
            - NOT_IMPLEMENTED
            - BAD_GATEWAY
            - SERVICE_UNAVAILABLE
            - WALLET_NOT_ACTIVE
            - WALLET_PROVISIONING
            - WALLET_FAILED
            - RATE_LIMITED
            - X402_WORKSPACE_RESOURCES
            - X402_WORKSPACE_ONLY
            - X402_ACCRUING_COST
            - X402_EXCEEDS_SETTLEMENT_WINDOW
            - X402_VALIDITY_WINDOW_TOO_SHORT
            - X402_UNBOUNDED_PRICE
            - X402_SETTLEMENT_FAILED
            - MPP_WORKSPACE_RESOURCES
            - MPP_WORKSPACE_ONLY
            - MPP_ACCRUING_COST
            - MPP_UNBOUNDED_PRICE
            - MPP_PAYMENT_FAILED
            - MPP_CREDENTIAL_REPLAYED
            - MPP_PROOF_REQUIRED
            - MPP_UNAVAILABLE
            - INSUFFICIENT_SCOPE
            - WALLET_INSUFFICIENT_FUNDS
            - MAX_COST_EXCEEDED
            - IDEMPOTENCY_KEY_REUSED
            - IDEMPOTENCY_KEY_IN_USE
            - IDENTITY_PROVIDER_UNKNOWN
            - IDENTITY_LINK_REQUIRES_SESSION
            - IDENTITY_LINK_STATE_INVALID
            - IDENTITY_VERIFICATION_FAILED
            - IDENTITY_ASSURANCE_INSUFFICIENT
            - IDENTITY_PROVIDER_UNAVAILABLE
            - IDENTITY_ALREADY_LINKED
            - IDENTITY_USER_ALREADY_LINKED
            - IDENTITY_LINK_RATE_LIMITED
            - IDENTITY_REQUIRED
            - PROMO_IDENTITY_REDEEMED
            - PROMO_REDEEM_REQUIRES_SESSION
            - PROMO_CODE_REDEEMED_BY_WORKSPACE
            - PROMO_CODE_REDEEMED_BY_USER
            - PROMO_CODE_EXHAUSTED
            - PROMO_NEW_ACCOUNTS_ONLY
            - WEBHOOK_REQUIRES_SESSION
            - WEBHOOK_URL_NOT_ALLOWED
            - WEBHOOK_ENDPOINT_LIMIT
            - WEBHOOK_ROTATION_LIMIT
          description: >-
            Machine-readable reason, present on every error. Either a specific
            code (for example `MAX_COST_EXCEEDED`) or the generic code of the
            HTTP status (for example `NOT_FOUND`). Treat an unknown value as the
            generic meaning of the status.
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
          description: >-
            Optional next actions, rendered for the calling client like
            run-response hints (e.g. the paid TinyFish version on a free-quota
            429 — spending permission required).
      required:
        - code
        - message
        - errorCode
    ProviderResponse:
      type: object
      properties:
        httpStatus:
          type: integer
          description: HTTP status from the provider (e.g. 200, 400, 404, 429, 500).
          example: 200
        error:
          description: Provider error body, passed through faithfully on failure.
    Price:
      type: object
      properties:
        type:
          type: string
        amount:
          type: object
          properties:
            value:
              type: number
            currency:
              type: string
              enum:
                - USD
          required:
            - value
            - currency
        flatFee:
          type: object
          properties:
            value:
              type: number
            currency:
              type: string
              enum:
                - USD
          required:
            - value
            - currency
        period:
          type: object
          properties:
            unit:
              type: string
              enum:
                - MINUTE
                - DAY
                - MONTH
            count:
              type: integer
              exclusiveMinimum: 0
          required:
            - unit
            - count
        per:
          anyOf:
            - type: object
              properties:
                unit:
                  type: string
                  enum:
                    - MINUTE
                    - DAY
                    - MONTH
                count:
                  type: integer
                  exclusiveMinimum: 0
              required:
                - unit
                - count
            - type: number
        unit:
          type: string
          enum:
            - token
            - character
            - second
            - image
            - credit
            - result
            - gb-month
            - step
            - byte
            - url
            - page
            - cent
        default:
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - PER_CALL
                amount:
                  type: object
                  properties:
                    value:
                      type: number
                    currency:
                      type: string
                      enum:
                        - USD
                  required:
                    - value
                    - currency
              required:
                - type
                - amount
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - PER_RESULT
                amount:
                  type: object
                  properties:
                    value:
                      type: number
                    currency:
                      type: string
                      enum:
                        - USD
                  required:
                    - value
                    - currency
                flatFee:
                  type: object
                  properties:
                    value:
                      type: number
                    currency:
                      type: string
                      enum:
                        - USD
                  required:
                    - value
                    - currency
              required:
                - type
                - amount
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - METERED
                amount:
                  type: object
                  properties:
                    value:
                      type: number
                    currency:
                      type: string
                      enum:
                        - USD
                  required:
                    - value
                    - currency
                per:
                  type: object
                  properties:
                    unit:
                      type: string
                      enum:
                        - MINUTE
                        - DAY
                        - MONTH
                    count:
                      type: integer
                      exclusiveMinimum: 0
                  required:
                    - unit
                    - count
              required:
                - type
                - amount
                - per
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - PER_UNIT
                amount:
                  type: object
                  properties:
                    value:
                      type: number
                    currency:
                      type: string
                      enum:
                        - USD
                  required:
                    - value
                    - currency
                per:
                  type: number
                unit:
                  type: string
                  enum:
                    - token
                    - character
                    - second
                    - image
                    - credit
                    - result
                    - gb-month
                    - step
                    - byte
                    - url
                    - page
                    - cent
              required:
                - type
                - amount
                - per
                - unit
        selectors:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              key:
                type: string
              in:
                type: string
                enum:
                  - body
                  - queryParam
                  - pathParam
                  - output
              offset:
                type: integer
                minimum: 0
            required:
              - label
              - key
              - in
        variants:
          type: array
          items:
            type: object
            properties:
              when:
                type: object
                additionalProperties:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
              price:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_CALL
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                    required:
                      - type
                      - amount
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_RESULT
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      flatFee:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                    required:
                      - type
                      - amount
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - METERED
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      per:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - MINUTE
                              - DAY
                              - MONTH
                          count:
                            type: integer
                            exclusiveMinimum: 0
                        required:
                          - unit
                          - count
                    required:
                      - type
                      - amount
                      - per
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_UNIT
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      per:
                        type: number
                      unit:
                        type: string
                        enum:
                          - token
                          - character
                          - second
                          - image
                          - credit
                          - result
                          - gb-month
                          - step
                          - byte
                          - url
                          - page
                          - cent
                    required:
                      - type
                      - amount
                      - per
                      - unit
              label:
                type: string
            required:
              - when
              - price
        tiers:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              when:
                type: object
                additionalProperties:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
              selector:
                type: object
                properties:
                  label:
                    type: string
                  key:
                    type: string
                  in:
                    type: string
                    enum:
                      - body
                      - queryParam
                      - pathParam
                      - output
                  offset:
                    type: integer
                    minimum: 0
                required:
                  - label
                  - key
                  - in
              price:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_CALL
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                    required:
                      - type
                      - amount
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_RESULT
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      flatFee:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                    required:
                      - type
                      - amount
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - METERED
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      per:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - MINUTE
                              - DAY
                              - MONTH
                          count:
                            type: integer
                            exclusiveMinimum: 0
                        required:
                          - unit
                          - count
                    required:
                      - type
                      - amount
                      - per
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_UNIT
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                          currency:
                            type: string
                            enum:
                              - USD
                        required:
                          - value
                          - currency
                      per:
                        type: number
                      unit:
                        type: string
                        enum:
                          - token
                          - character
                          - second
                          - image
                          - credit
                          - result
                          - gb-month
                          - step
                          - byte
                          - url
                          - page
                          - cent
                    required:
                      - type
                      - amount
                      - per
                      - unit
            required:
              - label
              - price
        notes:
          type: array
          items:
            type: string
      required:
        - type
        - amount
      description: 'Your price: markup and your workspace''s contract (if any) applied.'
    RunBilling:
      type: object
      properties:
        reportedCost:
          type: object
          properties:
            currency:
              type: string
              enum:
                - USD
            value:
              type: integer
              minimum: 0
            unit:
              type: string
              enum:
                - MICRO_DOLLAR
                - CENT
                - DOLLAR
          required:
            - currency
            - value
            - unit
          description: What the user pays for this run.
      required:
        - reportedCost
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      description: Monid API key
      x-aep-authentication-method: api-key

````

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