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

# Get Rail config

> What your server needs to charge agents: network, asset, wallet and grace limits. Read it once, at startup, not per request.
Rail amounts are in the asset's atomic units. Use `assetDecimals` to convert: `"5000"` at six decimals is 0.005 USDC. Do not hardcode the number of decimals.
The `product` parameter is validated here, so a missing product surfaces at startup rather than as a 402 on every agent request.




## OpenAPI

````yaml /api-reference/openapi.en.json get /rail/config
openapi: 3.1.0
info:
  title: Infi API
  version: 0.0.1
  description: >
    The Infi REST API: catalog, customers, usage metering, subscriptions,

    invoices, payments and checkout.


    **Authentication.** Send your secret key as `Authorization: Bearer
    sk_test_…`

    (sandbox) or `sk_live_…` (production). The key prefix selects the
    environment.

    Checkout routes (`/pay/*`) and `/public/*` take no key: they run in the

    payer's browser.


    **Idempotency.** Every request that changes data requires an

    `Idempotency-Key` header. A retry with the same key returns the original

    response instead of running again.


    **Amounts.** Money and quantities travel as decimal strings (`"150.00"`,

    `"0.0001"`), never as floating-point numbers.


    **Errors.** The body carries `error_code` (stable, branch on it), `message`

    (for humans) and `tracer_id` (send it to support). Rate-limit and
    idempotency

    errors are nested under `error`, with `code` and `request_id`.
servers:
  - url: https://api-sandbox.beinfi.com
    description: Sandbox
  - url: https://api.beinfi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Catalog
  - name: Customers
  - name: Metering
  - name: Subscriptions
  - name: Invoices
  - name: Payments
  - name: Checkout
  - name: Coupons
  - name: Billing
  - name: Account
  - name: Webhooks
  - name: Test account
  - name: Rail
  - name: Storefronts
paths:
  /rail/config:
    get:
      tags:
        - Rail
      summary: Get Rail config
      description: >
        What your server needs to charge agents: network, asset, wallet and
        grace limits. Read it once, at startup, not per request.

        Rail amounts are in the asset's atomic units. Use `assetDecimals` to
        convert: `"5000"` at six decimals is 0.005 USDC. Do not hardcode the
        number of decimals.

        The `product` parameter is validated here, so a missing product surfaces
        at startup rather than as a 402 on every agent request.
      operationId: getRailConfig
      parameters:
        - name: product
          in: query
          required: true
          schema:
            type: string
          description: Key of the product whose meters carry the Rail prices.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RailConfig'
          description: Your account's Rail configuration.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationFailed'
components:
  schemas:
    RailConfig:
      type: object
      required:
        - network
        - asset
        - assetDecimals
        - payTo
      properties:
        network:
          $ref: '#/components/schemas/RailNetwork'
        asset:
          type: string
          description: Token contract address (EVM) or mint (Solana). Never the ticker.
        assetDecimals:
          type: integer
          description: >-
            The token's number of decimals. Every atomic amount is read against
            it.
        payTo:
          type: string
          description: Your wallet, where the money lands.
        grace:
          type: object
          properties:
            window:
              type: string
            maxPerAgent:
              $ref: '#/components/schemas/RailAtomicAmount'
            maxTotal:
              $ref: '#/components/schemas/RailAtomicAmount'
            queueLimit:
              type: integer
            clockSkewSeconds:
              type: integer
          description: >-
            How much your server may serve on its own, per process, while Infi
            is unreachable. It is the only case where delivery happens without
            settlement.
        facilitator:
          type: object
          properties:
            provider:
              type: string
            indexesForDiscovery:
              type: boolean
          description: >-
            Whether your routes are indexed for discovery by agents
            (`indexesForDiscovery`). If not, no agent will find them by
            searching.
        outputSchema:
          type: object
          additionalProperties: true
          description: Route description your server echoes in its own 402 response.
      description: What your server uses to charge agents on the Rail.
    RailNetwork:
      type: string
      example: eip155:8453
      description: >-
        Network in CAIP-2 format: `eip155:<chain id>` on EVM (e.g. Base),
        `solana:<genesis ref>` on Solana. Short names like `base` are not
        accepted.
    RailAtomicAmount:
      type: string
      example: '5000'
      description: >-
        An amount in the asset's atomic units, as a decimal string, never a JSON
        number. To display it, divide by 10^`assetDecimals`: `"5000"` at six
        decimals is 0.005, not 5000.
    Error:
      type: object
      required:
        - message
        - error_code
        - tracer_id
      properties:
        message:
          type: string
          description: Human-readable sentence.
        error_code:
          $ref: '#/components/schemas/ErrorCode'
          description: Stable error code. Branch on it.
        tracer_id:
          type: string
          description: Request id. Include it when contacting support.
      description: >-
        The standard error body. It is flat (no `error` wrapper) and the trace
        id is `tracer_id`.
    NotFoundError:
      type: object
      required:
        - message
        - error_code
        - tracer_id
        - resource
      properties:
        message:
          type: string
        error_code:
          $ref: '#/components/schemas/ErrorCode'
        tracer_id:
          type: string
        resource:
          type: string
    ValidationError:
      type: object
      required:
        - message
        - error_code
        - tracer_id
        - errors
      properties:
        message:
          type: string
        error_code:
          $ref: '#/components/schemas/ErrorCode'
        tracer_id:
          type: string
        errors:
          type: array
          items:
            type: object
            required:
              - field
              - value
              - constraint
              - description
            properties:
              field:
                type: string
              value:
                type: string
              constraint:
                type: string
              description:
                type: string
          description: >-
            Per-field detail (`field`, `description`). Always present on a
            `422`; may be empty.
      description: >-
        Body of a `422`. Same shape as `Error`, plus `errors[]` with per-field
        detail. That is where the sentence telling you what to fix lives (for
        example, "product has no published version").
    ErrorCode:
      type: string
      examples:
        - internal_error
        - validation_failed
        - bad_request
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - rate_limited
      description: >-
        Stable error code. The list is open: besides the generic codes, each
        area defines its own (`coupon_expired`, `insufficient_balance`,
        `version_not_draft`, `idempotency_key_reused`…). Handle a code you do
        not recognize by its HTTP status and show `message`; do not fail parsing
        the response.
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid API key.
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundError'
      description: Resource not found.
    ValidationFailed:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
      description: One or more fields are invalid. Per-field detail is in `errors[]`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your account's secret key: `Authorization: Bearer sk_test_…` or
        `sk_live_…`. Server-side only.

````