Pipavia Credits API

The credits API from Pipavia — 5 operation(s) for credits.

GitHub OpenAPI

Operations 5

GET /v1/credits/balance Your credit balance, the bundle shelf, and your auto-top-up settings #
GET /v1/credits/ledger Your credit ledger, newest first (query: limit, before); burns carry their… #
POST /v1/credits/checkout Buy a credit bundle via Stripe Checkout (the purchase binds to the… #
PUT /v1/credits/topup Set your auto-top-up policy (enabled, threshold, bundle, daily cap; trial keys… #
POST /v1/credits/webhook Stripe webhook receiver for credit purchases and top-ups… #

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/pipavia-com:pipavia-com-credits-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

pipavia-com-credits-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Conduit Router Credits API
  version: 1.5.0
  description: Policy-first BYOK model router. OpenAI-compatible surface plus a native signed-config API, an MCP server, receipts you can verify, and standing per-key policy (mandates). Provider keys are the caller's own, envelope-encrypted at rest, never logged.
  contact:
    name: Pipavia
    email: info@pipavia.com
    url: https://pipavia.com
  license:
    name: Proprietary (API terms at /llms.txt)
    url: https://router.pipavia.com/llms.txt
servers:
- url: https://router.pipavia.com
tags:
- name: Credits
paths:
  /v1/credits/balance:
    get:
      summary: Your credit balance, the bundle shelf, and your auto-top-up settings
      tags:
      - Credits
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK (SSE streams answer text/event-stream where noted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsBalanceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '401':
          description: Missing or unknown Conduit key
        '402':
          description: Budget or quota block (fail-closed, before any provider call)
        '429':
          description: Rate limited by the provider or the gateway
      operationId: getV1CreditsBalance
      x-operation-id-source: derived
  /v1/credits/ledger:
    get:
      summary: 'Your credit ledger, newest first (query: limit, before); burns carry their…'
      tags:
      - Credits
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK (SSE streams answer text/event-stream where noted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsLedgerResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '401':
          description: Missing or unknown Conduit key
        '402':
          description: Budget or quota block (fail-closed, before any provider call)
        '429':
          description: Rate limited by the provider or the gateway
      operationId: getV1CreditsLedger
      x-operation-id-source: derived
  /v1/credits/checkout:
    post:
      summary: Buy a credit bundle via Stripe Checkout (the purchase binds to the…
      tags:
      - Credits
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditsCheckoutRequest'
            example:
              bundle: starter
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK (SSE streams answer text/event-stream where noted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsCheckoutResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '401':
          description: Missing or unknown Conduit key
        '402':
          description: Budget or quota block (fail-closed, before any provider call)
        '429':
          description: Rate limited by the provider or the gateway
      operationId: postV1CreditsCheckout
      x-operation-id-source: derived
  /v1/credits/topup:
    put:
      summary: Set your auto-top-up policy (enabled, threshold, bundle, daily cap; trial keys…
      tags:
      - Credits
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditsTopupRequest'
            example:
              enabled: true
              threshold: 100
              bundle: starter
              daily_cap: 1
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK (SSE streams answer text/event-stream where noted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsTopupResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '401':
          description: Missing or unknown Conduit key
        '402':
          description: Budget or quota block (fail-closed, before any provider call)
        '429':
          description: Rate limited by the provider or the gateway
      operationId: putV1CreditsTopup
      x-operation-id-source: derived
  /v1/credits/webhook:
    post:
      summary: Stripe webhook receiver for credit purchases and top-ups…
      tags:
      - Credits
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeEvent'
      responses:
        '200':
          description: OK (SSE streams answer text/event-stream where noted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsWebhookResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '401':
          description: Missing or unknown Conduit key
        '402':
          description: Budget or quota block (fail-closed, before any provider call)
        '429':
          description: Rate limited by the provider or the gateway
      operationId: postV1CreditsWebhook
      x-operation-id-source: derived
components:
  schemas:
    CreditsTopupSettings:
      type: object
      properties:
        enabled:
          type: boolean
        threshold:
          type: integer
          description: Balance (credits) below which an auto-top-up fires.
        bundle:
          type:
          - string
          - 'null'
          enum:
          - starter
          - builder
          - fleet
          - null
        daily_cap:
          type: integer
          description: Max top-up charges (success or failure) per UTC day.
        has_payment_method:
          type: boolean
    CreditsLedgerResponse:
      type: object
      properties:
        ok:
          type: boolean
          const: true
        key_id:
          type: string
        entries:
          type: array
          items:
            $ref: '#/components/schemas/CreditLedgerEntry'
    GatewayError:
      type: object
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: object
          properties:
            status:
              type: integer
            code:
              type: string
            detail:
              type: string
          required:
          - status
          - code
          - detail
        _meta:
          $ref: '#/components/schemas/Meta'
    CreditsBalanceResponse:
      type: object
      properties:
        ok:
          type: boolean
          const: true
        key_id:
          type: string
        balance:
          type: integer
        metering_enabled:
          type: boolean
          description: True once the key has entered the credit lane (first grant).
        mode:
          type: string
          enum:
          - test
          - live
          description: The credit shelf's configured mode on this deployment.
        bundles:
          type: array
          items:
            $ref: '#/components/schemas/CreditsBundle'
        topup:
          $ref: '#/components/schemas/CreditsTopupSettings'
    CreditsCheckoutRequest:
      type: object
      required:
      - bundle
      properties:
        bundle:
          type: string
          enum:
          - starter
          - builder
          - fleet
    CreditsCheckoutResponse:
      type: object
      properties:
        ok:
          type: boolean
          const: true
        checkout_url:
          type: string
          description: Stripe Checkout Session URL to send the buyer to.
        session_id:
          type: string
    CreditsTopupResponse:
      type: object
      properties:
        ok:
          type: boolean
          const: true
        topup:
          $ref: '#/components/schemas/CreditsTopupSettings'
    CreditsTopupRequest:
      type: object
      required:
      - enabled
      properties:
        enabled:
          type: boolean
        threshold:
          type: integer
          minimum: 0
        bundle:
          type:
          - string
          - 'null'
          enum:
          - starter
          - builder
          - fleet
          - null
        daily_cap:
          type: integer
          minimum: 0
          maximum: 100
    StripeEvent:
      type: object
      description: A Stripe event object, as delivered to the webhook. The Stripe-Signature header is the authentication; the body's metadata is trusted only as Stripe signed it.
      required:
      - id
      - type
      properties:
        id:
          type: string
        type:
          type: string
        livemode:
          type: boolean
        data:
          type: object
          properties:
            object:
              type: object
    CreditsBundle:
      type: object
      description: One bundle on the credit shelf. Credits are sold only in bundles and burned internally (1 credit per routed router.call).
      required:
      - id
      - label
      - credits
      - priceUsd
      properties:
        id:
          type: string
          enum:
          - starter
          - builder
          - fleet
        label:
          type: string
        credits:
          type: integer
        priceUsd:
          type: integer
          description: Whole US dollars.
        price_configured:
          type: boolean
          description: True when this deployment has a Stripe price configured for the bundle and it can be sold.
    Meta:
      type: object
      description: Gateway provenance carried on every routed response.
      properties:
        request_id:
          type: string
        key_id:
          type:
          - string
          - 'null'
        provider:
          type:
          - string
          - 'null'
        model_requested:
          type:
          - string
          - 'null'
        model_served:
          type:
          - string
          - 'null'
        fallback_taken:
          type: boolean
        fallback_declared:
          type: boolean
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
        latency_ms:
          type: number
        receipt_id:
          type:
          - string
          - 'null'
          description: rcpt_<seq> — fetch it at GET /v1/receipts/{id}
        outcome:
          type:
          - string
          - 'null'
    CreditLedgerEntry:
      type: object
      description: One append-only credit ledger row. Amount is signed (burns negative); receipt_id is set on burns once the call's audit receipt exists.
      properties:
        id:
          type: integer
        key_id:
          type: string
        kind:
          type: string
          enum:
          - purchase
          - topup
          - burn
          - refund
          - adjustment
          - topup_attempt
        amount:
          type: integer
        balance_after:
          type: integer
        service_id:
          type: string
        unit:
          type: string
        units:
          type: number
        receipt_id:
          type:
          - string
          - 'null'
        stripe_ref:
          type:
          - string
          - 'null'
        idempotency_key:
          type: string
        created_at:
          type: string
    CreditsWebhookResponse:
      type: object
      properties:
        ok:
          type: boolean
          const: true
        processed:
          type: boolean
        action:
          type: string
          description: What the event did, e.g. granted, already_granted, duplicate_event, ignored.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Conduit key (trial_… self-serve, or a registered key). Admin routes take the admin secret instead.