> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mountthor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get credits

> Returns your unexpired promotional credit, itemized per grant, soonest-expiring first.

Requires the `billing:GetBillingCredits` permission.



## OpenAPI

````yaml /api-reference/openapi/billing.json get /billing/v1/credits
openapi: 3.0.3
info:
  title: Mount Thor Billing API
  version: 15089fd70390
  description: >-
    Read your billing account, funds, credits, prices, usage, costs and
    invoices. Amounts are exact: `units` whole currency units plus `nanos`
    billionths, never floating point.
servers:
  - url: https://customer-api.mountthor.com
security:
  - bearerAuth: []
paths:
  /billing/v1/credits:
    get:
      summary: Get credits
      description: >-
        Returns your unexpired promotional credit, itemized per grant,
        soonest-expiring first.


        Requires the `billing:GetBillingCredits` permission.
      operationId: CustomerBillingService_GetBillingCredits
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBillingCreditsResponse'
        '400':
          description: The request is invalid, for example an unknown query parameter.
          headers:
            mt-error-slug:
              description: A stable, machine-readable error identifier, when one applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            The credential is missing, invalid or expired. The response has no
            body.
          headers:
            mt-error-slug:
              description: A stable, machine-readable error identifier, when one applies.
              schema:
                type: string
        '403':
          description: >-
            The credential does not allow this operation. When a permission is
            missing, `requiredAction` names it; otherwise the body may be empty.
          headers:
            mt-error-slug:
              description: A stable, machine-readable error identifier, when one applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GetBillingCreditsResponse:
      type: object
      properties:
        available:
          allOf:
            - $ref: '#/components/schemas/Money'
          description: >-
            Unexpired promotional credit available to spend, summed over grants.
            Zero when the customer has none.
        expiring:
          allOf:
            - $ref: '#/components/schemas/Money'
          description: The portion of `available` that expires within 30 days.
        grants:
          type: array
          items:
            $ref: '#/components/schemas/PromotionalCredit'
          description: >-
            The unexpired grants, soonest-expiring first. An empty list with a
            zero `available` means the customer has no promotional credit; a
            non-empty list with a zero `available` means it has all been spent.
      description: >-
        Your promotional credit. It is spent before your prepaid balance and
        forfeited at expiry.
    Error:
      type: object
      properties:
        code:
          type: integer
          description: A numeric status code.
        message:
          type: string
          description: A human-readable explanation.
        reason:
          type: string
          description: On a 403 from a missing permission, `permission_denied`.
        requiredAction:
          type: string
          description: >-
            On a 403 from a missing permission, the permission the request
            needs.
    Money:
      type: object
      properties:
        currency_code:
          type: string
          description: ISO-4217 currency code, e.g. "USD".
        units:
          type: string
          description: Whole units of the amount. May be negative.
        nanos:
          type: integer
          description: >-
            Fractional units in nanos (10^-9). For a positive amount, nanos is
            in [0, 999999999]; units and nanos must share sign.
          format: int32
      description: >-
        Money — an exact monetary amount. Never use floating point for money;
        this mirrors the google.type.Money shape (units + nanos + ISO-4217
        currency).
    PromotionalCredit:
      type: object
      properties:
        grant_id:
          type: string
        remaining:
          allOf:
            - $ref: '#/components/schemas/Money'
          description: The unspent portion of this grant.
        expires_at:
          type: string
          description: When the unspent portion is forfeited.
          format: date-time
        applicable_skus:
          type: array
          items:
            type: string
          description: >-
            The machine classes this credit can pay for. Empty means every
            class.
      description: One unexpired promotional grant, as the customer sees it.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <credential>` to
        https://customer-api.mountthor.com. People use the session that `mthr
        login` stores (a token starting `mt_session_`, valid for up to 12
        hours). Automation uses a service-account credential (starting
        `mt_sa_v1_`, valid for 90 days) from Create credential. Each operation
        names the permission it needs. Service accounts hold permissions through
        custom roles, and some operations refuse them; those operations say so.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.