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

# Quote a Call in Subscription Credits

> Credits one call to a catalog endpoint costs with your Nevermined Subscription: the endpoint's current rate on Nevermined's rate card, whatever the merchant charges at the moment of the call. Rates change without notice; the rate in force when the call is made applies.

Answers from the rate card alone — the merchant is not contacted, nothing is reserved and nothing is charged. It refuses what `POST /router/subscription/route` would refuse before contacting the merchant (an ineligible or untariffed endpoint, no spendable subscription), but it does NOT check your credits left, the merchant's live price or Nevermined's treasury; the route checks those when the call is made. A `url` is refused (`BCK.SUBSCRIPTION_ROUTER.0005`).

Personal API keys only: the Nevermined Subscription belongs to a personal account, so call with a key that carries no organization tag and without `X-Current-Org-Id`. An OAuth-minted credential is refused (`BCK.OAUTH.0030`). Where the subscription is not available — on this deployment or to this account — it answers 404 `BCK.SUBSCRIPTION_ACCESS.0001`.



## OpenAPI

````yaml POST /router/subscription/quote
openapi: 3.1.0
info:
  title: Nevermined API
  description: >-
    API for managing AI agents, payment plans, and x402 payments in the
    Nevermined ecosystem.


    ## Prerequisites


    You need a Nevermined API Key to authenticate. Get one at
    [nevermined.app](https://nevermined.app) under **Settings > API Keys**.


    See the [5-Minute Setup Guide](/docs/integrate/quickstart/5-minute-setup)
    for detailed instructions.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sandbox.nevermined.app/api/v1
    description: Sandbox (Testing) - Base Sepolia
  - url: https://api.live.nevermined.app/api/v1
    description: Live (Production) - Base Mainnet
security:
  - bearerAuth: []
tags:
  - name: Protocol - Agents
    description: Endpoints for registering and managing AI agents
  - name: Protocol - Plans
    description: Endpoints for creating and managing payment plans
  - name: Protocol - Credits
    description: Endpoints for minting and redeeming credits
  - name: Protocol - Access
    description: Endpoints for access tokens and request validation
  - name: X402 - Permissions
    description: Endpoints for x402 delegated permissions
paths:
  /router/subscription/quote:
    post:
      tags:
        - Router
      summary: Quote a call in subscription credits
      description: >-
        Credits one call to a catalog endpoint costs with your Nevermined
        Subscription: the endpoint's current rate on Nevermined's rate card,
        whatever the merchant charges at the moment of the call. Rates change
        without notice; the rate in force when the call is made applies.


        Answers from the rate card alone — the merchant is not contacted,
        nothing is reserved and nothing is charged. It refuses what `POST
        /router/subscription/route` would refuse before contacting the merchant
        (an ineligible or untariffed endpoint, no spendable subscription), but
        it does NOT check your credits left, the merchant's live price or
        Nevermined's treasury; the route checks those when the call is made. A
        `url` is refused (`BCK.SUBSCRIPTION_ROUTER.0005`).


        Personal API keys only: the Nevermined Subscription belongs to a
        personal account, so call with a key that carries no organization tag
        and without `X-Current-Org-Id`. An OAuth-minted credential is refused
        (`BCK.OAUTH.0030`). Where the subscription is not available — on this
        deployment or to this account — it answers 404
        `BCK.SUBSCRIPTION_ACCESS.0001`.
      operationId: quoteSubscriptionCall
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionQuoteRequestDto'
            examples:
              price-an-endpoint:
                summary: Price one call to a catalog endpoint
                value:
                  slug: webscrape-pro
                  path: scrape
                  method: POST
      responses:
        '201':
          description: >-
            The credits one call to this endpoint costs, and the tariff version
            that sets it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionQuoteResultDto'
        '400':
          description: >-
            Invalid request, or a field a subscription call does not accept
            (BCK.SUBSCRIPTION_ROUTER.0005, `params.field`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '401':
          description: Missing/invalid Nevermined API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '402':
          description: >-
            No subscription that can spend right now — none bought, ended, past
            due, or suspended by a card dispute — or a call made in an
            organization you are an active member of (`X-Current-Org-Id`, or
            that organization's API key), which never falls back to your
            personal subscription (BCK.SUBSCRIPTION_ROUTER.0002).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '403':
          description: >-
            This endpoint cannot be paid with subscription credits
            (BCK.SUBSCRIPTION_ROUTER.0001; `params.reason` names the failed
            check); or an OAuth-minted credential (BCK.OAUTH.0030).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '404':
          description: >-
            Not available to the caller (BCK.SUBSCRIPTION_ACCESS.0001), or no
            listed catalog service has that `slug` (BCK.CATALOG.0001).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '429':
          description: Per-slug throttle.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '500':
          description: >-
            Nevermined-side data error: the subscription does not resolve to its
            credits (BCK.SUBSCRIPTION_ROUTER.0011). Nothing was charged. (An
            unusable rate surfaces only on the route, as
            BCK.SUBSCRIPTION_ROUTER.0013.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
        '503':
          description: >-
            The subscription could not be looked up
            (BCK.SUBSCRIPTION_ROUTER.0012, retryable), or this deployment cannot
            run subscription calls (BCK.SUBSCRIPTION_ROUTER.0010).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterErrorResponseDto'
components:
  schemas:
    SubscriptionQuoteRequestDto:
      type: object
      properties:
        slug:
          type: string
          description: >-
            Catalog slug of the service to call. Subscription credits pay
            catalog services only, addressed by slug; the Router resolves it to
            the merchant server-side.
          example: webscrape-pro
          pattern: ^[A-Za-z0-9._~-]+$
        path:
          type: string
          maxLength: 2048
          description: >-
            Subpath of the endpoint to price, as on the route (path segments
            only).
          example: scrape
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          default: GET
          description: HTTP method of the call to price.
      required:
        - slug
    SubscriptionQuoteResultDto:
      type: object
      properties:
        slug:
          type: string
          description: The catalog slug priced.
          example: webscrape-pro
        credits:
          type: integer
          description: >-
            Credits one call to this endpoint costs: its current rate on
            Nevermined's rate card, whatever the merchant charges at the moment
            of the call.
          example: 3
        tariffVersion:
          type: integer
          description: The tariff version that sets `credits`.
          example: 2
      required:
        - slug
        - credits
        - tariffVersion
    RouterErrorResponseDto:
      type: object
      properties:
        code:
          type: string
          description: >-
            Router error code. `BCK.ROUTER.0001` invalid request / no fundable
            option / bad 402 (400); `BCK.ROUTER.0002` requestId already used —
            idempotency conflict (409); `BCK.ROUTER.0003` delegation budget
            exceeded, expired, or inactive (402); `BCK.ROUTER.0004` payment
            record not found (404); `BCK.ROUTER.0005` payment not in a
            settleable state (409). Framework-level `BCK.HTTP.*` codes (e.g.
            `BCK.HTTP.400` request validation, `BCK.HTTP.429` throttling) may
            also appear — see the base `code` field.
          example: BCK.ROUTER.0003
        httpStatus:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message for Router operations.
          example: delegation budget exceeded, expired, or inactive
          examples:
            - >-
              delegationId is required — create one via POST
              /api/v1/delegation/create
            - 'no fundable option; offered: [...]'
            - >-
              upstream pay-to address is not in this delegation's allowed
              recipients
            - delegation budget exceeded, expired, or inactive
            - payment already settled with a different txHash
        details:
          type: string
          description: >-
            Throw-site detail string supplementing the canonical message. Only
            set when the call site supplied an opts.message; absent otherwise.
          example: Hash JWT is not signed by the node account
        error:
          type: string
          description: >-
            RFC 6749 §5.2 / RFC 8628 §3.5 top-level OAuth error string. Present
            only on the OAuth device-polling responses from `POST /oauth/token`
            (`authorization_pending`, `slow_down`, `expired_token`,
            `access_denied`), so a standards-compliant OAuth/device client can
            branch on it directly instead of on the Nevermined `code`. Absent on
            every other error.
          example: authorization_pending
        hint:
          type: string
          description: >-
            Actionable remediation hint, sourced from the catalogue or supplied
            at the throw site. Tells the caller what to fix or where to look.
          example: >-
            Verify the wallet has sufficient balance and that the plan is
            active.
        docsUrl:
          type: string
          description: Permalink to the docs page describing this error code.
          example: >-
            https://nevermined.ai/docs/development-guide/api-errors/codes#bck-x402-0008
        category:
          type: string
          description: >-
            Coarse classification of the failure, useful for client-side
            branching without parsing the message.
          enum:
            - validation
            - auth
            - business
            - integration
            - internal
          example: integration
        retryable:
          type: boolean
          description: >-
            Whether the failure is transient and the same call can be retried
            with identical inputs. Absent when the catalogue does not assert
            either way.
          example: true
        correlationId:
          type: string
          description: >-
            Request-scoped correlation id stamped by the global filter. Echoed
            in the x-correlation-id response header. Quote this when reporting
            issues.
          example: a3f6b1c4-7d2e-4a9b-8e0c-12f4d8e6c5b9
        uuid:
          type: string
          description: >-
            Per-error UUID generated at construction. Useful for log
            correlation.
          example: e-550e8400-e29b-41d4-a716-446655440000
        date:
          type: string
          description: ISO timestamp at which the error was constructed.
          example: '2026-05-09T12:34:56.789Z'
          format: date-time
        params:
          type: string
          description: >-
            JSON-stringified contextual parameters supplied at the throw site
            (e.g. IDs, state). Always a string in the wire format — parse with
            JSON.parse if needed.
          example: '{"planId":"43298432984329","reason":"Invalid configuration"}'
      required:
        - code
        - httpStatus
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Nevermined API Key (starts with 'nvm:'). Get one at
        [nevermined.app](https://nevermined.app) under **Settings > API Keys**.

````

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