> ## 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 (OpenAI format)

> Get the credits you can still spend through the API in the current period. Same as [Get credits](/api-reference/openai/get-credits).

This endpoint is not part of the OpenAI API, so OpenAI client libraries have no method for it. Call it with any HTTP client using the same API key.


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

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

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

```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/openai/v1/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/openai/v1/credits:
    get:
      tags:
        - openai-v1
      summary: Get Credits
      description: >-
        Get the credits you can still spend through the API in the current
        period. Same as `GET /api/beta/amberai/credits`.
      operationId: get_credits_api_beta_openai_v1_credits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
        '401':
          description: >-
            Missing, invalid or expired credentials (returned in the `{"detail":
            ...}` format).
        '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.