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

# Credit usage

## Retrieve credit usage

Get the credits used in the current period, how many are included in your plan, and when usage resets. Paid plans reset with the billing cycle; the free plan uses a rolling 30-day window that starts with your first request.

**Cost:** 0 credits


## OpenAPI

````yaml GET /v1/credits
openapi: 3.1.0
info:
  title: OpenRegister API
  version: 2.5.0
  description: >
    API for accessing comprehensive company data from official registers.

    This API provides access to company information, shareholder data, financial
    reports, and contact details.
servers:
  - url: https://api.openregister.de
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/credits:
    get:
      tags:
        - v1
      summary: Retrieve public API credit usage
      operationId: getCreditsUsage
      responses:
        '200':
          description: Successful credit usage lookup
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsUsage'
        '401':
          description: Unauthorized - Authentication required
        '500':
          description: >-
            Internal Server Error - An error occurred while processing the
            request
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Openregister from 'openregister';

            const client = new Openregister({
              apiKey: process.env['OPENREGISTER_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.usage.getCreditsV1();

            console.log(response.paid);
        - lang: Python
          source: |-
            import os
            from openregister import Openregister

            client = Openregister(
                api_key=os.environ.get("OPENREGISTER_API_KEY"),  # This is the default and can be omitted
            )
            response = client.usage.get_credits_v1()
            print(response.paid)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/oregister/openregister-go\"\n\t\"github.com/oregister/openregister-go/option\"\n)\n\nfunc main() {\n\tclient := openregister.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Usage.GetCreditsV1(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Paid)\n}\n"
        - lang: CLI
          source: |-
            openregister usage get-credits-v1 \
              --api-key 'My API Key'
components:
  schemas:
    CreditsUsage:
      type: object
      properties:
        used_credits:
          type: integer
          x-go-type: int64
        included_credits:
          type: integer
          x-go-type: int64
        remaining_credits:
          type: integer
          x-go-type: int64
          description: Never negative; zero once usage exceeds included credits.
        overage_credits:
          type: integer
          x-go-type: int64
          description: Credits above the included allowance.
        paid:
          type: boolean
        period:
          $ref: '#/components/schemas/CreditsUsagePeriod'
      required:
        - used_credits
        - included_credits
        - remaining_credits
        - overage_credits
        - paid
        - period
    CreditsUsagePeriod:
      type: object
      properties:
        type:
          type: string
          description: >-
            billing_cycle for paid plans; rolling_30_days for the free plan,
            where the window starts with the first request.
          enum:
            - billing_cycle
            - rolling_30_days
        reset_at:
          type: string
          format: date-time
      required:
        - type
        - reset_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        API Key Authentication

        Provide your API key as a Bearer token in the Authorization header.


        Rejected keys return a JSON body `{"message": "..."}` naming the reason:

        - 401 `API key is missing`, `API key is invalid`, `API key is disabled`
        or `API key has expired`

        - 429 `API key rate limit exceeded` or `API key usage limit exceeded`

````

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