---
title: "Create-or-get a workspace ({workspace} in body; cap_usd applies on create) [org admin or manager token]"
method: PUT
path: "/preview/org/workspaces"
tags: ["org"]
---

# Create-or-get a workspace ({workspace} in body; cap_usd applies on create) \[org admin or manager token\]

`PUT /preview/org/workspaces`

## Request

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

Create a workspace (or get it if the slug already exists - create-or-get, safe to retry). A workspace is the compute boundary inside your org: nodes and jobs belong to one, names are unique per workspace, and its spend cap bounds everything in it. Pass cap_usd to set a monthly budget at creation (recommended when scripting per-tenant or per-experiment workspaces); without it the org cap is the only wall. Org admins, or a manager service token.

## Query parameters

- `workspace` string

## Request body

- object
  - `cap_usd` number, double, nullable: Monthly spend cap in USD, applied only when this call CREATES the workspace (an existing workspace's cap is set_workspace_cap's job). Omitted = uncapped at this layer; the org cap is the outer wall.
  - `org` string, nullable: Organization (uuid or name); omitted = your active org.
  - `workspace` string, required: The workspace slug: 1-40 chars of lowercase letters, digits, and hyphens. Create-or-get: an existing slug is returned, not an error.

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