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

# Get credits

> Get the credits you can still spend through the API in the current period.

`remaining` is the lower of your company's remaining API credits and what is left of your personal monthly limit. Once it reaches `0`, chat completions return `429` (`insufficient_quota`). Every chat completion reports the credits it cost in `usage.credits`.


```bash cURL theme={null}
curl "https://customerDomain.ambersearch.de/api/beta/amberai/credits" \
-H "Authorization: Bearer ambrs-exampletoken"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://customerDomain.ambersearch.de/api/beta/amberai/credits",
    headers = {
        "Authorization": "Bearer ambrs-exampletoken"
    }
)
print(response.json())
```

```javascript Javascript theme={null}
const axios = require("axios");

axios
    .get("https://customerDomain.ambersearch.de/api/beta/amberai/credits", {
        headers: {
            Authorization: "Bearer ambrs-exampletoken",
        },
    })
    .then((res) => console.log(res.data));
```

```json Response theme={null}
{
    "object": "credits",
    "remaining": 42.5,
    "used": 7.5,
    "personal_limit": 50.0,
    "api_access": true,
    "period_start": "2026-11-01T00:00:00Z",
    "period_end": "2026-12-01T00:00:00Z"
}
```


## OpenAPI

````yaml get /api/beta/amberai/credits
openapi: 3.1.0
info:
  title: amber
  version: v0.1.46
servers:
  - url: https://{customerDomain}.ambersearch.de
    variables:
      customerDomain:
        default: customerDomain
security: []
paths:
  /api/beta/amberai/credits:
    get:
      tags:
        - openai
      summary: Get Credits
      description: >-
        Get the credits you can still spend through the API in the current
        period.
      operationId: get_credits_api_beta_amberai_credits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
        '401':
          description: >-
            Missing, invalid or expired credentials. Only API keys and OAuth 2.0
            access tokens are accepted.
        '403':
          description: >-
            API access is not available, e.g. because the tenant is on a free
            trial or its license plan has expired.
      security:
        - Bearer: []
components:
  schemas:
    CreditsResponse:
      type: object
      properties:
        object:
          type: string
          title: Object
          default: credits
        remaining:
          type: number
          title: Remaining
          description: >-
            Credits you can still spend through the API in the current period:
            the lower of your company's remaining API credits and what is left
            of your personal monthly limit.
        used:
          type: number
          title: Used
          description: >-
            Credits you used this calendar month (API and premium models in
            amber).
        personal_limit:
          anyOf:
            - type: number
            - type: 'null'
          title: Personal Limit
          description: >-
            Your monthly credits limit set by your admin, or `null` if you have
            none.
        api_access:
          type: boolean
          title: Api Access
          description: >-
            Whether your company allows API usage. If `false`, `remaining` is
            `0`.
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start of the current credits period (UTC), or `null` if your company
            has no credits.
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End of the current credits period (UTC), or `null` if your company
            has no credits.
      required:
        - object
        - remaining
        - used
        - personal_limit
        - api_access
        - period_start
        - period_end
      title: CreditsResponse
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````

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