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

# Update Workspace Settings

> Change the workspace usage limit, plan budgets, usage requests, and agent limit behavior

Read and update the workspace limits and plan budgets for mode `bring-your-own-keys`. Amounts are US dollars.

The call uses the workspace API key's `BILLING_API` scope. Writes run as the key's service account owner.

## Base URL

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

> [!WARNING]
>
> **Dedicated deployments**
>
> Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.

## Prerequisites

* **API key** with the `BILLING_API` scope
* The key owner is a service account that has not been deleted and has an active Admin membership

## Update settings

`PATCH` accepts `usageRequestsEnabled`, `workspaceUsageLimit`, `monthlyBudgetPerPlan`, `sessionLimitsEnabled`, and `agentLimitBehavior`. Send at least one of them. A plan you omit from `monthlyBudgetPerPlan` keeps its budget. Nested fields you omit from `agentLimitBehavior` stay as they are.

```bash theme={null}
curl -X PATCH https://api.langdock.com/billing/v1/bring-your-own-keys/settings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"monthlyBudgetPerPlan":{"power_user":{"type":"limited","amount":120}}}'
```

The response matches `GET`, with `usagePeriodSpend` set to `null`. Read the settings again to get spend.

A limited `workspaceUsageLimit` must be greater than zero. A limited plan budget may be zero.

> [!NOTE]
>
> Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](https://docs.langdock.com/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


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