OpenRelay Billing API

Prepaid balance, saved cards, deposits, and auto-recharge.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Payment Collection & Dunning BC-4250.40

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v1/orgs/{orgId}/billing/auto-recharge Read the auto-recharge policy · Read the org's auto-recharge policy #
Ask an LLM
“What auto-recharge amount and threshold does my org have?”
“Is auto-recharge turned on for my organization?”
Tell an agent
Show the auto-recharge policy for org {orgId}.
Get the auto-recharge amount and threshold of org {orgId}.
PUT /v1/orgs/{orgId}/billing/auto-recharge Set the auto-recharge policy · Set the org's auto-recharge policy #
Ask an LLM
“How do I top up my balance automatically when it drops below a threshold?”
“Can I change the auto-recharge amount and threshold?”
Tell an agent
Set auto-recharge on for org {orgId} at {amountCents} cents, threshold {thresholdCents}.
Turn off auto-recharge for org {orgId}.
GET /v1/orgs/{orgId}/billing/balance Check the org balance and recent transactions · Org balance + recent transactions #
Ask an LLM
“How much money is left in my org's prepaid balance?”
“What recent transactions have hit my org's balance?”
Tell an agent
Show the balance and recent transactions for org {orgId}.
Get the current balance of org {orgId}.
POST /v1/orgs/{orgId}/billing/deposit Charge the saved card to top up balance · Charge the saved card to top up prepaid balance #
Ask an LLM
“How do I add money to my org's prepaid balance?”
“Can I apply a promo code when topping up my balance?”
Tell an agent
Charge {amountCents} cents to the saved card in org {orgId}.
Top up org {orgId} by {amountCents} cents using promo code {promoCode}.
GET /v1/orgs/{orgId}/billing/payment-methods List saved cards · List saved cards (brand/last4/exp only) #
Ask an LLM
“Which cards are saved on my org's account?”
“What card brands and last four digits do we have on file?”
Tell an agent
List the saved cards for org {orgId}.
Show the payment methods on file for org {orgId}.
DELETE /v1/orgs/{orgId}/billing/payment-methods/{paymentMethodId} Remove a saved card · Remove a saved card #
Ask an LLM
“How do I remove a card from my org's saved payment methods?”
“Can I delete a saved card by its ID?”
Tell an agent destructive · confirm first
Remove payment method {paymentMethodId} from org {orgId}.
Delete saved card {paymentMethodId} on org {orgId}.
POST /v1/orgs/{orgId}/billing/setup-intent Start saving a card · Start saving a card (Stripe SetupIntent for inline Elements) #
Ask an LLM
“How do I add a new card to my org's account?”
“Can I collect a card on file for my organization?”
Tell an agent
Create a setup intent for org {orgId} to save a card.
Start saving a new card on org {orgId}.

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/openrelay:openrelay-billing-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

openrelay-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: The OpenRelay control-plane REST API. Deploy GPU VMs and inference clusters, manage organizations and billing, and automate your infrastructure. All requests are authenticated with an API key (`vl_…`) unless noted otherwise.
  title: OpenRelay Billing API
  version: 0.1.0
servers:
- description: Production
  url: https://api.openrelay.inc
- description: Beta
  url: https://api.beta.openrelay.inc
- description: Local development
  url: http://localhost:8083
tags:
- description: Prepaid balance, saved cards, deposits, and auto-recharge.
  name: Billing
paths:
  /v1/orgs/{orgId}/billing/auto-recharge:
    get:
      operationId: getAutoRecharge
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoRechargeSettings'
          description: Current settings (defaults when never set)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
      - apiKey: []
      summary: Read the org's auto-recharge policy
      tags:
      - Billing
    put:
      operationId: updateAutoRecharge
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoRechargeSettings'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoRechargeSettings'
          description: Saved settings
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
      - apiKey: []
      summary: Set the org's auto-recharge policy
      tags:
      - Billing
  /v1/orgs/{orgId}/billing/balance:
    get:
      operationId: getBalance
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              example:
                accruedUsageCents: 2120
                availableCents: 10430
                balanceCents: 12550
                monthlySpendLimitCents: null
                transactions:
                - amountCents: 10000
                  createdAt: '2026-06-28T14:03:22Z'
                  description: Card deposit
                  id: txn_01hzy3
                  source: stripe
                  type: stripe_deposit
              schema:
                $ref: '#/components/schemas/Balance'
          description: Balance
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
      - apiKey: []
      summary: Org balance + recent transactions
      tags:
      - Billing
      x-openrelay-mcp:
        default: true
  /v1/orgs/{orgId}/billing/deposit:
    post:
      description: Charges the org's default saved card off-session. The balance credit is applied by the payment_intent.succeeded webhook (the authoritative money signal), not this response — poll the balance after success.
      operationId: createBillingDeposit
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            example:
              amountCents: 5000
              idempotencyKey: dep-2026-07-02-a1b2c3
            schema:
              $ref: '#/components/schemas/DepositRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositResult'
          description: Charge outcome (status drives the dashboard's next step)
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
      - apiKey: []
      summary: Charge the saved card to top up prepaid balance
      tags:
      - Billing
  /v1/orgs/{orgId}/billing/payment-methods:
    get:
      operationId: listBillingPaymentMethods
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethods'
          description: Saved cards
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
      - apiKey: []
      summary: List saved cards (brand/last4/exp only)
      tags:
      - Billing
  /v1/orgs/{orgId}/billing/payment-methods/{paymentMethodId}:
    delete:
      operationId: deleteBillingPaymentMethod
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      - in: path
        name: paymentMethodId
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Removed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
      - apiKey: []
      summary: Remove a saved card
      tags:
      - Billing
      x-openrelay-mcp:
        destructiveHint: true
  /v1/orgs/{orgId}/billing/setup-intent:
    post:
      operationId: createBillingSetupIntent
      parameters:
      - in: path
        name: orgId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupIntent'
          description: SetupIntent client secret + publishable key
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
      - apiKey: []
      summary: Start saving a card (Stripe SetupIntent for inline Elements)
      tags:
      - Billing
components:
  schemas:
    Transaction:
      properties:
        amountCents:
          type: integer
        createdAt:
          type: string
        description:
          type: string
        id:
          type: string
        inferenceDetails:
          $ref: '#/components/schemas/InferenceTransactionDetails'
        source:
          type: string
        type:
          type: string
      required:
      - id
      - type
      - source
      - amountCents
      - createdAt
      type: object
    DepositRequest:
      properties:
        amountCents:
          description: Amount to charge the saved card, in cents (bounds $10–$500).
          type: integer
        idempotencyKey:
          description: Client-generated id for this logical deposit; reused verbatim on retry so a network/client retry can't double-charge. Optional — the server generates one if absent (then retries won't dedupe).
          type: string
        promoCode:
          description: Optional first-deposit promo code. When valid on the org's first deposit, amountCents is the deposit the customer wants credited and the saved card is charged the DISCOUNTED amount; the discount is credited as free (usage-only) credit by the webhook. Invalid / already-used codes are rejected (400) before any charge.
          type: string
      required:
      - amountCents
      type: object
    SetupIntent:
      properties:
        clientSecret:
          type: string
        publishableKey:
          type: string
      required:
      - clientSecret
      - publishableKey
      type: object
    Error:
      properties:
        code:
          type: string
        error:
          type: string
      required:
      - error
      type: object
    InferenceTransactionDetails:
      properties:
        carriedNanoUSD:
          description: Customer charge represented by these metered requests that remains as sub-cent accrual for a later debit.
          pattern: ^[0-9]+$
          type: string
        models:
          items:
            $ref: '#/components/schemas/InferenceModelUsage'
          type: array
        partial:
          description: True when some of the debit is not itemized in this row, including legacy usage or sub-cent cost carried from a prior row.
          type: boolean
      required:
      - models
      - partial
      - carriedNanoUSD
      type: object
    InferenceModelUsage:
      properties:
        batch:
          type: boolean
        dimensions:
          additionalProperties:
            pattern: ^[0-9]+$
            type: string
          description: Exact decimal token quantities. Current keys are input, cached_input, cache_write, and output; the map shape reserves room for future metered units.
          type: object
        model:
          type: string
        requestCount:
          description: Exact decimal count; encoded as a string so browser clients do not lose int64 precision.
          pattern: ^[0-9]+$
          type: string
      required:
      - model
      - requestCount
      - batch
      - dimensions
      type: object
    DepositResult:
      properties:
        clientSecret:
          description: Set only when status is requires_action (on-session SCA).
          type: string
        paymentIntentId:
          type: string
        status:
          description: Stripe PaymentIntent status. "succeeded" → credit lands via webhook; "requires_action" → complete SCA on-session with clientSecret; "requires_payment_method" → the card was declined.
          type: string
      required:
      - paymentIntentId
      - status
      type: object
    Balance:
      properties:
        accruedUsageCents:
          description: Current-month usage cost not yet settled into a transaction.
          type: integer
        availableCents:
          description: Spendable balance = balanceCents − accruedUsageCents. This is what the deploy gate checks; it can be below balanceCents while usage is running, and slightly negative between auto-recharge ticks.
          type: integer
        balanceCents:
          description: Raw ledger balance (deposits + credits − settled debits).
          type: integer
        monthlySpendLimitCents:
          description: The org's monthly spend cap, or null if no limit is set. Drives the "used of limit" budget gauge in the dashboard.
          nullable: true
          type: integer
        transactions:
          items:
            $ref: '#/components/schemas/Transaction'
          type: array
      required:
      - balanceCents
      - availableCents
      - accruedUsageCents
      - transactions
      type: object
    AutoRechargeSettings:
      properties:
        amountCents:
          description: Amount charged per auto-recharge (within deposit bounds $10–$500).
          type: integer
        enabled:
          description: When on, the balance is topped up automatically below the threshold.
          type: boolean
        thresholdCents:
          description: Recharge fires when available balance drops below this.
          type: integer
      required:
      - enabled
      - thresholdCents
      - amountCents
      type: object
    PaymentMethodCard:
      properties:
        brand:
          type: string
        expMonth:
          type: integer
        expYear:
          type: integer
        id:
          type: string
        last4:
          type: string
      required:
      - id
      - brand
      - last4
      - expMonth
      - expYear
      type: object
    PaymentMethods:
      properties:
        defaultPaymentMethodId:
          type: string
        paymentMethods:
          items:
            $ref: '#/components/schemas/PaymentMethodCard'
          type: array
      required:
      - paymentMethods
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: The request is invalid
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid API key
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: API key lacks the required scope
    Unavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: A required integration (e.g. payments) is not configured
  securitySchemes:
    apiKey:
      description: 'OpenRelay API key. Send it as `Authorization: Bearer vl_…`.'
      scheme: bearer
      type: http