ReasonBlocks Billing API

The Billing API from ReasonBlocks — 1 operation(s) for billing.

OpenAPI Specification

reasonblocks-billing-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ReasonBlocks Billing API
  description: 'ReasonBlocks REST API. Public routes are versioned under `/v1/`.


    **Auth:** every route requires `Authorization: Bearer <api_key>`. Issue keys from the dashboard (per-org), or set `REASONBLOCKS_KEYS` for static dev keys. See `docs/rest-api-setup.md` and `docs/custom-harness-quickstart.md` in the repo for end-to-end setup.


    **Back-compat:** unversioned aliases (e.g. `POST /traces/retrieve`) remain mounted for already-deployed SDK clients but are intentionally hidden from this schema. New integrations should target `/v1/...`.'
  version: 0.1.0
tags:
- name: Billing
paths:
  /v1/billing/meter:
    get:
      tags:
      - Billing
      summary: Get Meter
      description: "Return ``{plan, used, cap, over_cap, org_id}`` for an org.\n\nAuthorization:\n  * Static (admin) keys may query any org.\n  * Per-customer keys may only query their own org -- the principal's\n    ``org_id`` is the source of truth; a mismatch with the query\n    param is rejected.\n  * JWT (dashboard) callers must have ``org_id`` in their\n    ``allowed_orgs``."
      operationId: get_meter_v1_billing_meter_get
      security:
      - HTTPBearer: []
      parameters:
      - name: org_id
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 256
          title: Org Id
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 365
          minimum: 0
          description: If >0, include per-day timeseries for the trailing N days.
          default: 0
          title: Days
        description: If >0, include per-day timeseries for the trailing N days.
      - name: token
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: API key (EventSource fallback)
          title: Token
        description: API key (EventSource fallback)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Get Meter V1 Billing Meter Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer