UsageRail API

UsageRail API as documented publicly: 16 operations. Contract generated from the documentation by API Evangelist (2026-11-02); not the provider's own document.

Operations 16

GET /healthz Health check endpoint #
GET /v1/check GET /v1/check #
POST /v1/check POST /v1/check #
POST /v1/consumers POST /v1/consumers #
GET /v1/consumers/{id} Get a customer #
POST /v1/consumers/{id}/checkout Checkout #
POST /v1/consumers/{id}/claim Claim an email or external ID #
POST /v1/consumers/{id}/credits/adjust Adjust a balance #
POST /v1/consumers/{id}/keys Create a key #
POST /v1/consumers/{id}/plan Plans #
POST /v1/consumers/{id}/portal-link Portal sign-in links #
GET /v1/consumers/{id}/usage Usage #
POST /v1/generate Generate endpoint #
GET /v1/hello GET /v1/hello #
GET /v1/items/{id} Retrieve an item by ID #
DELETE /v1/keys/{keyId} Revoke a key #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/usagerail:usagerail-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

usagerail-openapi-generated.yml Raw ↑
openapi: 3.1.0
info:
  title: UsageRail API
  version: '2026-11-02'
  description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-11-02: 16 operation(s) read from 10 public documentation page(s) (each
    operation names its page in x-source). This is not the provider''s published contract; UsageRail has published no machine-readable contract
    that the pipeline could find. Engine: local.'
  x-evidence-tiers:
    code-example: 4
    documentation: 12
    pages-with-code: 3
    pages-read: 10
  x-generated-from: documentation
  x-provenance: generated
  x-authored-by: API Evangelist
  x-generated: '2026-11-02'
  x-generator: generate-contract-from-docs.py
  x-engine: local
  x-sources:
  - https://usagerail.com/docs/server-api
  - https://usagerail.com/docs/portal
  - https://usagerail.com/docs/express
  - https://usagerail.com/api-analytics
  - https://usagerail.com/docs/api-keys
  - https://usagerail.com/docs/http-check
  - https://usagerail.com/docs/quickstart
  - https://usagerail.com/docs/usage-widget
  - https://usagerail.com/docs/plans-and-checkout
  - https://usagerail.com/docs/prepaid-credits
servers:
- url: https://api.usagerail.com
paths:
  /healthz:
    get:
      operationId: get_healthz
      tags:
      - Healthz
      summary: Health check endpoint
      description: 'Returns 200 with {"ok": true} to indicate the service is healthy.'
      x-source: https://usagerail.com/docs/http-check
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetHealthzResponse'
      x-evidence:
        kind: documentation
  /v1/check:
    get:
      operationId: get_v1_check
      tags:
      - Check
      summary: GET /v1/check
      x-source: https://usagerail.com/docs/http-check
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: 'curl = curl_init ( getenv ( ''USAGERAIL_CHECK_URL'' ) ?: ''https://api.usagerail.com/v1/check'' ); '
    post:
      operationId: post_v1_check
      tags:
      - Check
      summary: POST /v1/check
      x-source: https://usagerail.com/docs/http-check
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1CheckRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.usagerail.com/v1/check  -H \"Authorization: Bearer $USAGERAIL_APP_KEY \"  -H \"Content-Type: application/json\"\
          \  -d '{\"key\": \"acme_live_...\", \"method\": \"GET\", \"route\": \"/v1/items/{id}\"}' \n json Copy { \"allowed\" : true , \"code\"\
          \ : \"ok\" , \"limit\" : 1000 , \"remaining\" : 412 , \"retry_after\" : null } \n Choose HTTP check as the integration when you create\
          \ the app in the console. You can't sw"
  /v1/consumers:
    post:
      operationId: post_v1_consumers
      tags:
      - Consumers
      summary: POST /v1/consumers
      x-source: https://usagerail.com/docs/server-api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersRequest'
      responses:
        '201':
          description: Success (shape read from the example response on the page)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersResponse'
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl https://api.usagerail.com/v1/consumers  -H \"Authorization: Bearer $USAGERAIL_MANAGEMENT_KEY \"  -H \"Idempotency-Key:\
          \ signup-8f14e45f\"  -H \"Content-Type: application/json\"  -d '{\"external_id\": \"user_1042\", \"email\": \"ada@example.com\"}' \n\
          \ Authentication \n Every call needs the app's server API key, which starts with urm_ . Create it on the app's page in the console,\
          \ under Server API key. It's sepa"
  /v1/consumers/{id}:
    get:
      operationId: get_v1_consumers_id
      tags:
      - Consumers
      summary: Get a customer
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV1ConsumersIdResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/checkout:
    post:
      operationId: post_v1_consumers_id_checkout
      tags:
      - Consumers
      summary: Checkout
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdCheckoutRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdCheckoutResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/claim:
    post:
      operationId: post_v1_consumers_id_claim
      tags:
      - Consumers
      summary: Claim an email or external ID
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdClaimRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdClaimResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/credits/adjust:
    post:
      operationId: post_v1_consumers_id_credits_adjust
      tags:
      - Consumers
      summary: Adjust a balance
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdCreditsAdjustRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdCreditsAdjustResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/keys:
    post:
      operationId: post_v1_consumers_id_keys
      tags:
      - Consumers
      summary: Create a key
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdKeysRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdKeysResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/plan:
    post:
      operationId: post_v1_consumers_id_plan
      tags:
      - Consumers
      summary: Plans
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdPlanRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdPlanResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/portal-link:
    post:
      operationId: post_v1_consumers_id_portal_link
      tags:
      - Consumers
      summary: Portal sign-in links
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1ConsumersIdPortalLinkRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1ConsumersIdPortalLinkResponse'
      x-evidence:
        kind: documentation
  /v1/consumers/{id}/usage:
    get:
      operationId: get_v1_consumers_id_usage
      tags:
      - Consumers
      summary: Usage
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: days
        in: query
        required: false
        schema:
          type: integer
        description: Number of days (1‑30, default 7)
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV1ConsumersIdUsageResponse'
      x-evidence:
        kind: documentation
  /v1/generate:
    post:
      operationId: post_v1_generate
      tags:
      - Generate
      summary: Generate endpoint
      description: 'Returns 200 with {"ok": true} after successful generation.'
      x-source: https://usagerail.com/docs/http-check
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV1GenerateRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1GenerateResponse'
      x-evidence:
        kind: documentation
  /v1/hello:
    get:
      operationId: get_v1_hello
      tags:
      - Hello
      summary: GET /v1/hello
      x-source: https://usagerail.com/docs/quickstart
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl -i http://localhost:3000/v1/hello  -H \"Authorization: Bearer acme_test_...\" \n You get your handler's 200 response. A\
          \ key created a moment ago works right away: if the SDK hasn't synced it yet, it asks UsageRail about that key directly. \n Now leave\
          \ the key out: \n bash Copy curl -i http://localhost:3000/v1/hello \n The middleware answers before your handler runs: \n http Copy\
          \ HTTP / 1.1 401 Unaut"
  /v1/items/{id}:
    get:
      operationId: get_v1_items_id
      tags:
      - Items
      summary: Retrieve an item by ID
      description: Returns 200 with a JSON object containing the requested item ID.
      x-source: https://usagerail.com/docs/http-check
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV1ItemsIdResponse'
      x-evidence:
        kind: documentation
  /v1/keys/{keyId}:
    delete:
      operationId: delete_v1_keys_keyId
      tags:
      - Keys
      summary: Revoke a key
      x-source: https://usagerail.com/docs/server-api
      parameters:
      - name: keyId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteV1KeysKeyidResponse'
      x-evidence:
        kind: documentation
components:
  schemas:
    GetHealthzResponse:
      type: object
      properties:
        ok:
          type: boolean
          description: Health status
    PostV1CheckRequest:
      type: object
      properties:
        key:
          type: string
        method:
          type: string
        route:
          type: string
    PostV1ConsumersRequest:
      type: object
      properties:
        external_id:
          type: string
        email:
          type: string
    PostV1ConsumersResponse:
      type: object
      properties:
        consumer:
          type: object
          properties:
            id:
              type: string
            email:
              type: string
            external_id:
              type: string
            status:
              type: string
            email_verified:
              type: boolean
            created_at:
              type: string
              format: date-time
            plan:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
                version:
                  type: integer
            quota:
              type: object
              properties:
                behavior:
                  type: string
                limit:
                  type: string
            rate_limits:
              type: object
              properties:
                per_second:
                  type: integer
                per_minute:
                  type:
                  - string
                  - 'null'
            current_period:
              type: object
              properties:
                period_start:
                  type: string
                  format: date-time
                period_end:
                  type: string
                  format: date-time
                billable_requests:
                  type: string
                billable_units:
                  type: string
            balance:
              type:
              - string
              - 'null'
            active_keys:
              type: integer
            subscription:
              type:
              - string
              - 'null'
    GetV1ConsumersIdResponse:
      type: object
      properties:
        consumer:
          type: object
          description: Customer object
    PostV1ConsumersIdCheckoutRequest:
      type: object
      properties:
        plan_id:
          type: string
          description: Paid plan identifier
        interval:
          type: string
          description: '"month" (default) or "year"'
        success_url:
          type: string
          description: HTTPS URL for success
        cancel_url:
          type: string
          description: HTTPS URL for cancellation
        credit_pack_id:
          type: string
          description: ID of a credit pack to sell instead of a plan
      required:
      - plan_id
      - success_url
      - cancel_url
    PostV1ConsumersIdCheckoutResponse:
      type: object
      properties:
        url:
          type: string
          description: Stripe Checkout page URL
    PostV1ConsumersIdClaimRequest:
      type: object
      properties:
        email:
          type: string
          description: Email to attach
        external_id:
          type: string
          description: External ID to attach
    PostV1ConsumersIdClaimResponse:
      type: object
      properties:
        consumer:
          type: object
          description: Customer object after claim
    PostV1ConsumersIdCreditsAdjustRequest:
      type: object
      properties:
        units:
          type: integer
          description: Number of credit units to add (positive) or remove (negative)
        reason:
          type: string
          description: Reason for audit log
      required:
      - units
      - reason
    PostV1ConsumersIdCreditsAdjustResponse:
      type: object
      properties:
        consumer:
          type: object
          description: Customer object after adjustment
    PostV1ConsumersIdKeysRequest:
      type: object
      properties:
        name:
          type: string
          description: Optional name of up to 100 characters
    PostV1ConsumersIdKeysResponse:
      type: object
      properties:
        key_id:
          type: string
          description: Key identifier
        consumer_id:
          type: string
          description: Customer ID
        name:
          type: string
          description: Key name
        key:
          type: string
          description: The secret key value (appears only in this response)
    PostV1ConsumersIdPlanRequest:
      type: object
      properties:
        plan_id:
          type: string
          description: Target plan identifier
        interval:
          type: string
          description: '"month" or "year"'
        keep:
          type: boolean
          description: Set to true to drop a pending change
      required:
      - plan_id
    PostV1ConsumersIdPlanResponse:
      type: object
      properties:
        consumer:
          type: object
          description: Customer object with updated subscription
        change:
          type: object
          description: Change status object
    PostV1ConsumersIdPortalLinkRequest:
      type: object
      properties:
        next:
          type: string
          description: Optional path to open after sign‑in, e.g. /keys
    PostV1ConsumersIdPortalLinkResponse:
      type: object
      properties:
        url:
          type: string
          description: Portal sign‑in link
        expires_at:
          type: string
          description: Expiration timestamp
    GetV1ConsumersIdUsageResponse:
      type: object
      properties:
        days:
          type: integer
          description: Days returned
        retention_days:
          type: integer
          description: Retention period
        timezone:
          type: string
          description: Timezone
        unit_mode:
          type: string
          description: Requests or units
        daily:
          type: array
          description: Array of daily usage objects
        endpoints:
          type: array
          description: Array of busiest endpoint usage objects
    PostV1GenerateRequest:
      type: object
      properties:
        units:
          type: string
          description: Optional number of units to charge for the request
    PostV1GenerateResponse:
      type: object
      properties:
        ok:
          type: boolean
          description: Indicates successful generation
    GetV1ItemsIdResponse:
      type: object
      properties:
        id:
          type: string
          description: The requested item identifier
    DeleteV1KeysKeyidResponse:
      type: object
      properties:
        key_id:
          type: string
          description: Key identifier
        status:
          type: string
          description: revoked
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
security:
- bearer: []
tags:
- name: Check
- name: Consumers
- name: Generate
- name: Healthz
- name: Hello
- name: Items
- name: Keys