---
title: "Set/clear a workspace spend cap [org:write + admin]"
method: PATCH
path: "/preview/workspaces/{slug}"
tags: ["workspaces"]
---

# Set/clear a workspace spend cap \[org:write + admin\]

`PATCH /preview/workspaces/{slug}`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/workspaces/{slug}`
- Auth: HTTP bearer

Set (or clear) a workspace's monthly spend cap in USD (org admins only). The cap bounds everything the workspace's members run in it and is enforced live by the same engine that meters spend; omit cap_usd (or pass 0) to remove it. The org-wide cap is an operator conversation, not a tool. Your human sees every cap the org has - this one, the other workspaces', and the org's own - on /limits, which is where a cap refusal points them.

## Path parameters

- `slug` string, required: The workspace's slug (spec "Workspaces"; "default" is the org's default workspace).

## Query parameters

- `workspace` string

## Request body

- object
  - `cap_usd` number, double, nullable: Monthly spend cap in USD. Omit (or 0) to remove the cap.
  - `org` string, nullable: Organization (uuid or name); omitted = your active org.

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
