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

# Workspace-Einstellungen abrufen

> Lies Workspace-Limits, Planbudgets, Nutzungslimit-Anfragen und das Verhalten von Agenten nach Limits

Lies und ändere die Workspace-Limits und Planbudgets für den Modus `bring-your-own-keys`. Beträge sind US-Dollar.

Der Aufruf läuft über den `BILLING_API` Scope des Workspace-API-Schlüssels. Schreibzugriffe laufen als der Service Account, dem der Schlüssel gehört.

## Basis-URL

```
https://api.langdock.com/billing/v1/bring-your-own-keys/settings
```

> [!WARNING]
>
> **Dedicated Deployments**
>
> Ersetze `api.langdock.com` durch `<your-deployment-url>/api/public` in allen Anfragen.

## Voraussetzungen

* **API-Schlüssel** mit dem Scope `BILLING_API`
* Der Besitzer ist ein Service Account, der nicht gelöscht ist und eine aktive Admin-Mitgliedschaft hat

## Einstellungen lesen

`GET /billing/v1/bring-your-own-keys/settings` liefert die aktuellen Einstellungen.

```json theme={null}
{
  "currency": "USD",
  "usageRequestsEnabled": true,
  "workspaceUsageLimit": { "type": "unlimited" },
  "monthlyBudgetPerPlan": {
    "standard": { "type": "limited", "amount": 36 },
    "power_user": { "type": "limited", "amount": 120 }
  },
  "weeklyBudgetPerPlan": {
    "standard": { "type": "limited", "amount": 9 },
    "power_user": { "type": "limited", "amount": 30 }
  },
  "sessionBudgetPerPlan": {
    "standard": { "type": "limited", "amount": 3 },
    "power_user": { "type": "limited", "amount": 10 }
  },
  "sessionLimitsEnabled": true,
  "agentLimitBehavior": {
    "forced": "switch_model",
    "fallbackModelId": "44444444-4444-4444-8444-444444444444"
  },
  "usagePeriod": {
    "start": "2026-09-01T00:00:00.000Z",
    "end": "2026-10-01T00:00:00.000Z"
  },
  "usagePeriodSpend": 1290.1
}
```

`workspaceUsageLimit` deckelt enthaltene und Extra-Nutzung von Chat und Agenten in `usagePeriod`. Persönliche API-Nutzung zählt auf dieses Limit, ebenso Agent-API-Aufrufe mit einem Workspace-Schlüssel, wenn das Agent-Budget `always` mit einem begrenzten Betrag ist. Andere Workspace-API-Nutzung, Workflow-Ausführungen und die Nutzung des Backbone-Modells zählen nicht mit. `usagePeriodSpend` ist die Nutzung, die auf dieses Limit angerechnet wird.

`monthlyBudgetPerPlan` ist das enthaltene Kontingent für **Standard** (`standard`) und **Power User** (`power_user`). Wochen- und Session-Budgets werden abgeleitet. Du kannst sie nicht schreiben. Die Woche ist das Monatsbudget geteilt durch 4. Die Session ist das Wochenbudget geteilt durch 3. Ein unbegrenztes Monatsbudget bleibt in diesen Fenstern unbegrenzt. `sessionBudgetPerPlan` ist `null`, wenn Session-Limits aus sind.

Das Monatsbudget setzt diese Fenster. Extra Usage kann starten, sobald das enthaltene Wochen- oder Session-Kontingent aufgebraucht ist. Es ist keine Zusage, dass Extra Usage erst nach einem Kalendermonat beginnt.

`usageRequestsEnabled` erlaubt Mitgliedern, einen Admin um mehr Nutzung zu bitten.

`agentLimitBehavior.forced` legt fest, was nach einem Nutzer- oder Agent-Limit passiert:

* `null` überlässt die Wahl dem Agent-Besitzer (**Agent-Besitzer entscheidet**).
* `switch_model` wechselt auf das Fallback-Modell (**Modell wechseln**). Dafür brauchst du ein gültiges Fallback.
* `block_usage` stoppt den Agenten (**Nutzung blockieren**).

`fallbackModelId` ist das konfigurierte Fallback. `null` nutzt das Backbone-Modell des Workspace. `switch_model` braucht auch dann ein gültiges Modell.

> [!NOTE]
>
> Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu [Best Practices für API-Schlüssel](https://docs.langdock.com/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


## OpenAPI

````yaml GET /billing/v1/bring-your-own-keys/settings
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /billing/v1/bring-your-own-keys/settings:
    get:
      tags:
        - Settings
      summary: Read USD workspace settings
      operationId: getByokBillingSettings
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ByokSettings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/ModeMismatch'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    ByokSettings:
      type: object
      additionalProperties: false
      required:
        - currency
        - usageRequestsEnabled
        - workspaceUsageLimit
        - monthlyBudgetPerPlan
        - sessionLimitsEnabled
        - agentLimitBehavior
        - weeklyBudgetPerPlan
        - sessionBudgetPerPlan
        - usagePeriod
        - usagePeriodSpend
      properties:
        currency:
          type: string
          enum:
            - USD
        usageRequestsEnabled:
          type: boolean
        workspaceUsageLimit:
          $ref: '#/components/schemas/WorkspaceLimit'
        monthlyBudgetPerPlan:
          $ref: '#/components/schemas/ByokPlanLimits'
        sessionLimitsEnabled:
          type: boolean
        agentLimitBehavior:
          $ref: '#/components/schemas/AgentLimitBehavior'
        weeklyBudgetPerPlan:
          $ref: '#/components/schemas/ByokPlanLimits'
        sessionBudgetPerPlan:
          type: object
          additionalProperties: false
          required:
            - standard
            - power_user
          properties:
            standard:
              $ref: '#/components/schemas/Limit'
            power_user:
              $ref: '#/components/schemas/Limit'
          nullable: true
        usagePeriod:
          $ref: '#/components/schemas/Period'
        usagePeriodSpend:
          type: number
          minimum: 0
          nullable: true
      description: >-
        USD included and extra chat/agent usage; excludes workflow, API, and
        backbone-model usage. Weekly budgets are monthly / 4; session budgets
        are weekly / 3 and null when disabled. PATCH returns null spending; GET
        retrieves spending.
    WorkspaceLimit:
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - type
            - amount
          properties:
            type:
              type: string
              enum:
                - limited
            amount:
              type: number
              minimum: 0
              exclusiveMinimum: true
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - unlimited
    ByokPlanLimits:
      type: object
      additionalProperties: false
      required:
        - standard
        - power_user
      properties:
        standard:
          $ref: '#/components/schemas/Limit'
        power_user:
          $ref: '#/components/schemas/Limit'
    AgentLimitBehavior:
      type: object
      additionalProperties: false
      required:
        - forced
        - fallbackModelId
      properties:
        forced:
          type: string
          enum:
            - switch_model
            - block_usage
            - null
          nullable: true
        fallbackModelId:
          type: string
          format: uuid
          nullable: true
      description: >-
        Forcing switch_model requires a valid fallback model. null forced uses
        each agent setting. fallbackModelId is the configured override; null
        uses the workspace backbone fallback.
    Limit:
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - type
            - amount
          properties:
            type:
              type: string
              enum:
                - limited
            amount:
              type: number
              minimum: 0
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - unlimited
    Period:
      type: object
      additionalProperties: false
      required:
        - start
        - end
      properties:
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
    Error:
      type: object
      additionalProperties: false
      required:
        - message
        - code
      properties:
        message:
          type: string
        code:
          type: string
        details:
          type: object
          additionalProperties: true
          description: >-
            Optional structured details specific to the error code, such as
            userIds for invalid bulk members.
    ModeMismatchError:
      type: object
      additionalProperties: false
      required:
        - message
        - code
        - details
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - BILLING_MODE_MISMATCH
        details:
          type: object
          additionalProperties: false
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - ai-models-included
                - bring-your-own-keys
  responses:
    BadRequest:
      description: >-
        Invalid body/query, unknown fields, empty PATCH, invalid limit, invalid
        bulk member IDs, or a cursor outside this workspace (INVALID_CURSOR).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Missing Billing scope, personal key, unavailable feature, missing active
        service-account Admin authority, or email filter without the
        USER_MANAGEMENT_API scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: >-
        Resource not in this workspace, inactive/non-human user, privacy-hidden
        agent, usage request not found for that member, or endpoint unavailable
        in this mode.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MethodNotAllowed:
      description: Unsupported HTTP method.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ModeMismatch:
      description: >-
        Workspace mode differs from the requested mode. details.mode identifies
        the workspace mode.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModeMismatchError'
    TooManyRequests:
      description: API rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````

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