Lev

Lev Billing API

The Billing API from Lev — 2 operation(s) for billing.

OpenAPI Specification

lev-billing-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Lev Account & Team Billing API
  version: 2026-03
  description: Build on Lev with AI-friendly API docs, agent guides, and production integration recipes.
servers:
- url: https://api.lev.com
  description: Production API
tags:
- name: Billing
paths:
  /api/external/v2/billing/summary:
    get:
      operationId: getBillingSummary
      summary: Get subscription metadata and credit balance for the active account
      description: 'Get subscription metadata and credit balance for the active account


        Docs page: https://www.lev.com/docs/build/billing'
      tags:
      - Billing
      parameters: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  data:
                    $ref: '#/components/schemas/BillingSummary'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
        '403':
          description: 'Missing required scope: billing:read'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
      security:
      - bearerAuth: []
      x-lev-docs-page: https://www.lev.com/docs/build/billing
      x-lev-headers:
      - 'Authorization: Bearer <token>'
      - 'X-Origin-App: <client-name>'
  /api/external/v2/billing/credits/balance:
    get:
      operationId: getBillingCreditsBalance
      summary: Get the credit balance for the active account
      description: 'Get the credit balance for the active account


        Docs page: https://www.lev.com/docs/build/billing'
      tags:
      - Billing
      parameters: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  data:
                    $ref: '#/components/schemas/Credits'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
        '403':
          description: 'Missing required scope: billing:read'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
      security:
      - bearerAuth: []
      x-lev-docs-page: https://www.lev.com/docs/build/billing
      x-lev-headers:
      - 'Authorization: Bearer <token>'
      - 'X-Origin-App: <client-name>'
components:
  schemas:
    Subscription:
      type: object
      properties:
        type:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        billing_cycle:
          type: string
          nullable: true
        end_date:
          type: string
          nullable: true
    Credits:
      type: object
      properties:
        enabled:
          type: boolean
        balance:
          type: integer
          nullable: true
        unit:
          type: string
    BillingSummary:
      type: object
      properties:
        subscription:
          $ref: '#/components/schemas/Subscription'
        credits:
          $ref: '#/components/schemas/Credits'
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          $ref: '#/components/schemas/ApiError'
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or JWT