# Get Billing Credits

> GET /api/v1/organizations/billing/credits — request parameters and responses from the Menace Voice API schema.

`GET /api/v1/organizations/billing/credits`

{/* Generated by scripts/sync_docs_api.mjs. Edit the API schema source to change the contract. */}

See [authentication](/api-reference/authentication) for workspace API access. Public embed and artifact endpoints use their documented session or access tokens.

## API contract for documentation tools

Generated from the OpenAPI schema. Do not infer a different parameter type from an example. Authentication headers are alternatives as explained in the authentication guide.

### Parameters

| Name | Location | Type | Required | Description and constraints |
| --- | --- | --- | --- | --- |
| page | query | integer | no | default: 1; minimum: 1 |
| limit | query | integer | no | default: 50; minimum: 1; maximum: 100 |
| authorization | header | string or null | no |  |
| X-API-Key | header | string or null | no |  |

### Response 200

Successful Response

application/json: MPSBillingCreditsResponse (object).

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| total_credits_used | number | no | default: 0 |
| remaining_credits | number | no | default: 0 |
| total_quota | number | no | default: 0 |
| account | MPSBillingAccountResponse (object) or null | no |  |
| ledger_entries | array of MPSCreditLedgerEntryResponse (object) | no |  |
| total_count | integer | no | default: 0 |
| page | integer | no | default: 1 |
| limit | integer | no | default: 50 |
| total_pages | integer | no | default: 0 |

### Response 404

Not found

### Response 422

Validation Error

application/json: HTTPValidationError (object).

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| detail | array of ValidationError (object) | no |  |

## OpenAPI

````yaml api-reference/openapi.json get /api/v1/organizations/billing/credits
openapi: 3.1.0
info:
  title: Menace Voice API
  description: API for Menace Voice agents
  version: 1.0.0
servers:
  - url: https://voice.menaceui.com
    description: Production
  - url: http://localhost:8000
    description: Local development
paths:
  /api/v1/organizations/billing/credits:
    get:
      tags:
        - main
      summary: Get Billing Credits
      description: Return per-key MPS credits (OSS) or the org's paginated billing ledger.
      operationId: get_billing_credits_api_v1_organizations_billing_credits_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 50
            title: Limit
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: "null"
            title: Authorization
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: "null"
            title: X-Api-Key
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MPSBillingCreditsResponse"
        "404":
          description: Not found
        "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
    MPSBillingAccountResponse:
      properties:
        id:
          type: integer
          title: Id
        organization_id:
          type: integer
          title: Organization Id
        billing_mode:
          type: string
          title: Billing Mode
        cached_balance_credits:
          type: number
          title: Cached Balance Credits
        currency:
          type: string
          title: Currency
      type: object
      required:
        - id
        - organization_id
        - billing_mode
        - cached_balance_credits
        - currency
      title: MPSBillingAccountResponse
    MPSBillingCreditsResponse:
      properties:
        total_credits_used:
          type: number
          title: Total Credits Used
          default: 0
        remaining_credits:
          type: number
          title: Remaining Credits
          default: 0
        total_quota:
          type: number
          title: Total Quota
          default: 0
        account:
          anyOf:
            - $ref: "#/components/schemas/MPSBillingAccountResponse"
            - type: "null"
        ledger_entries:
          items:
            $ref: "#/components/schemas/MPSCreditLedgerEntryResponse"
          type: array
          title: Ledger Entries
        total_count:
          type: integer
          title: Total Count
          default: 0
        page:
          type: integer
          title: Page
          default: 1
        limit:
          type: integer
          title: Limit
          default: 50
        total_pages:
          type: integer
          title: Total Pages
          default: 0
      type: object
      title: MPSBillingCreditsResponse
    MPSCreditLedgerEntryResponse:
      properties:
        id:
          type: integer
          title: Id
        entry_type:
          type: string
          title: Entry Type
        origin:
          anyOf:
            - type: string
            - type: "null"
          title: Origin
        credits_delta:
          type: number
          title: Credits Delta
        balance_after:
          type: number
          title: Balance After
        amount_minor:
          anyOf:
            - type: integer
            - type: "null"
          title: Amount Minor
        amount_currency:
          anyOf:
            - type: string
            - type: "null"
          title: Amount Currency
        payment_order_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Payment Order Id
        metric_code:
          anyOf:
            - type: string
            - type: "null"
          title: Metric Code
        correlation_id:
          anyOf:
            - type: string
            - type: "null"
          title: Correlation Id
        aggregation_key:
          anyOf:
            - type: string
            - type: "null"
          title: Aggregation Key
        usage_event_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Usage Event Id
        workflow_run_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Workflow Run Id
        workflow_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Workflow Id
        billable_quantity:
          anyOf:
            - type: number
            - type: "null"
          title: Billable Quantity
        quantity_unit:
          anyOf:
            - type: string
            - type: "null"
          title: Quantity Unit
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          type: string
          title: Created At
      type: object
      required:
        - id
        - entry_type
        - credits_delta
        - balance_after
        - created_at
      title: MPSCreditLedgerEntryResponse
    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
````
