> ## 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.

# Monatsbudget einer Gruppe setzen

> Setze das Monatsbudget, das für jedes Mitglied einer Gruppe gilt

Lies Gruppen und setze ein Monatsbudget für jedes Mitglied einer Gruppe. Das Budget ist kein gemeinsamer Topf. Beträge sind US-Dollar.

Die Aufrufe laufen über den `BILLING_API` Scope des Workspace-API-Schlüssels. Schreibzugriffe laufen als der Service Account, dem der Schlüssel gehört. Diese API fügt keine Gruppenmitglieder hinzu und entfernt keine.

## Basis-URL

```
https://api.langdock.com/billing/v1/bring-your-own-keys/groups/{groupId}/monthly-budget
```

> [!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

## Monatsbudget setzen

`PUT /groups/{groupId}/monthly-budget` nimmt das Budget direkt entgegen.

```json theme={null}
{ "type": "limited", "amount": 200 }
```

`{ "type": "unlimited" }` entfernt die Zahlenobergrenze. Ein begrenzter Betrag darf null sein. `none` ist hier nicht erlaubt.

Für jedes Mitglied ist das enthaltene Monatsbudget der höhere Wert aus Planbudget und diesem Gruppenbudget. Ein unbegrenztes Gruppenbudget hebt das Workspace-Limit nicht auf. Unter [Billing-Nutzer](https://docs.langdock.com/de/developer/billing-api/get-user.md) steht, wie die effektive Quelle gewählt wird.

Die Antwort ist das Gruppenobjekt.

> [!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 PUT /billing/v1/bring-your-own-keys/groups/{groupId}/monthly-budget
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/groups/{groupId}/monthly-budget:
    parameters:
      - $ref: '#/components/parameters/GroupId'
    put:
      tags:
        - Groups
      summary: Set the group monthly budget
      description: >-
        Per-member default; this is not a pooled group budget. SCIM-managed
        groups accept changes without changing identity-provider-owned
        membership. The highest plan/group limit applies unless an included-mode
        user has an explicit cap. Workspace controls still apply.
      operationId: setByokBillingGroupLimit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Limit'
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ByokGroup'
        '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:
  parameters:
    GroupId:
      in: path
      name: groupId
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    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
    ByokGroup:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - scimManaged
        - memberCount
        - monthlyBudget
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        scimManaged:
          type: boolean
        memberCount:
          type: integer
          minimum: 0
        monthlyBudget:
          $ref: '#/components/schemas/Limit'
      description: >-
        USD per-member monthly budget; the highest plan/group value applies.
        Does not override the workspace cap.
    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.