tdx workspaces#

Manage workspaces, their policy and spend.

List, create, edit, pause, resume, archive and restore workspaces; set their guardrail, rules and budgets; preview key mints; read key provenance, availability, spend reports and key templates. The gateway authorizes every route. Pausing, archiving and other changes that reduce access need --acknowledge with the digest of the gateway's review for the same credential; each such command's help shows how to obtain it with the api command. IdP group bindings are session-only and unavailable to this bearer-only CLI.

Every command also takes the global flags and reads the environment variables that the command reference lists once.

Commands#

CommandDescriptionType
tdx workspaces listList workspaces.Read
tdx workspaces createCreate a workspace.Write
tdx workspaces showRead a workspace.Read
tdx workspaces editRename or retag a workspace.Write
tdx workspaces guardrailSet a workspace's guardrail and budgets.Group
tdx workspaces guardrail setReplace a workspace's guardrail and budgets.Write
tdx workspaces rulesSet a workspace's own rules.Group
tdx workspaces rules setReplace a workspace's rules.Write
tdx workspaces pausePause a workspace.Write
tdx workspaces resumeResume a paused workspace.Write
tdx workspaces archiveArchive an empty workspace.Write
tdx workspaces restoreRestore an archived workspace.Write
tdx workspaces idp-bindingsIdentity-provider group bindings (dashboard only).Group
tdx workspaces idp-bindings setReplace a workspace's IdP group bindings (dashboard only).Dashboard only
tdx workspaces key-previewPreview the API key a mint would create here.Read
tdx workspaces keysInspect a workspace's keys.Group
tdx workspaces keys provenanceShow who authorized a key and under which rules.Read
tdx workspaces availabilityShow what a workspace's keys can call.Read
tdx workspaces spend-reportReport spend for every workspace or one.Read
tdx workspaces templatesList key templates.Read

tdx workspaces list#

List workspaces.

Reads

Read the workspaces the gateway lets this credential see (workspaces.read), with this month's spend where it may read it. Only --status is sent. See Workspace reads.

Shell
# GET /control/v1/workspaces
tdx workspaces list [flags]

Optional flags

FlagTypeDefaultDescription
--statusstringStatus filter the gateway accepts, such as active, paused, archived or all; omitted lists every workspace that is not archived.

Output fields (inside data)

FieldTypeDescription
workspacespublic-workspace[]Id, slug, name, purpose, tags, status, counts, model access summary and this month's spend summary.

Examples

List every workspace, archived ones included:

Shell
tdx workspaces list --status all --json

tdx workspaces create#

Create a workspace.

Writes

Create a workspace (install-wide workspaces.manage). The gateway's reply also suggests a first inference-key mint call; that suggestion is withheld, so mint the first key with api-keys create --owner. See Workspace changes.

Shell
# POST /control/v1/workspaces
tdx workspaces create --name <string> [flags]

Required flags

FlagTypeDefaultDescription
--namestringDisplay name.

Optional flags

FlagTypeDefaultDescription
--slugstringURL slug; omitted derives one from the name; slugs are never reused.
--purposestringPurpose the gateway accepts, such as project or team.
--tagsjsonJSON array of tag strings.
--guardrailjsonGuardrail: JSON policy layer object (models, maxKeyLifetimeDays, keyRpmMax, keyBudgetMax), or null for none; the gateway validates it.
--rulesjsonWorkspace rules: JSON policy layer object (models, maxKeyLifetimeDays, keyRpmMax, keyBudgetMax), or null for none; the gateway validates it.
--budgetjsonWorkspace budget: JSON {"window", "limit"} with limit a USD decimal string, or null to remove it; the gateway validates it.
--key-budget-defaultjsonPer-key default budget for new keys: JSON {"window", "limit"}, or null to remove it; the gateway validates it.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview creating a workspace:

Shell
tdx workspaces create --name Research --purpose project --dry-run --json

tdx workspaces show#

Read a workspace.

Reads

Read one workspace with its guardrail, rules, budgets and this month's spend. See Workspace reads.

Shell
# GET /control/v1/workspaces/:workspaceId
tdx workspaces show --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceWorkspace view with guardrail, rules, budgets, IdP bindings where visible and this month's spend summary.

Examples

Read one workspace:

Shell
tdx workspaces show --id <workspace-id> --json=workspace

tdx workspaces edit#

Rename or retag a workspace.

Writes

Change a workspace's name, purpose or tags (install-wide workspaces.manage); an archived workspace must be restored first. A workspace keeps the slug it was created with. See Workspace changes.

Shell
# PATCH /control/v1/workspaces/:workspaceId
tdx workspaces edit --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--namestringDisplay name.
--purposestringPurpose the gateway accepts.
--tagsjsonJSON array of tag strings, replacing the current tags; [] clears them.

Constraints

  • --name is required unless --purpose or --tags

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Rename a workspace:

Shell
tdx workspaces edit --id <workspace-id> --name Research --json

tdx workspaces guardrail#

Set a workspace's guardrail and budgets.

Replace a workspace's guardrail layer and its budgets. A change that reduces access needs --acknowledge with the digest of the gateway's review for the same credential; see guardrail set --help.

tdx workspaces guardrail set#

Replace a workspace's guardrail and budgets.

Writes

Replace the guardrail layer and set the workspace or per-key default budget (install-wide workspaces.manage); omitted parts stay unchanged. A guardrail may only tighten the organisation's policy. A change the gateway's review finds reduces access (such as a new or lower budget, a lower key limit or keys losing models) needs --acknowledge with the digest of the gateway's review of exactly this change, obtained with this same credential; without it the gateway refuses with REVIEW_REQUIRED, and with a digest that no longer matches with REVIEW_STALE (both exit 6); it applies nothing and this CLI shows no review. This command's --dry-run cannot show that review. To obtain the review and its digest, send the identical request with tdx api PUT '/control/v1/workspaces/<workspace-id>/guardrail?dryRun=true' --input <file> (the JSON body this command would send, without acknowledge, under wire names such as keyBudgetDefault and remediation {"clampExpiryDays": <days>}) --json, then rerun this command with the same options and --acknowledge <digest>. Any other body, or a gateway change in between, makes the digest stale. If the digest in the api output prints as █, make the change in the gateway dashboard (a digest read there usually does not match this CLI's credential). Write budget limits with a decimal point, such as 5.00: a --dry-run preview masks text matching a whole-number limit such as 5. See Workspace changes.

Shell
# PUT /control/v1/workspaces/:workspaceId/guardrail
tdx workspaces guardrail set --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--guardrailjsonGuardrail: JSON policy layer object (models, maxKeyLifetimeDays, keyRpmMax, keyBudgetMax), or null for none; the gateway validates it.
--budgetjsonWorkspace budget: JSON {"window", "limit"} with limit a USD decimal string, or null to remove it; the gateway validates it.
--key-budget-defaultjsonPer-key default budget for new keys: JSON {"window", "limit"}, or null to remove it; the gateway validates it.
--clamp-expiry-daysintegerRemediation: shorten the lifetimes of keys the change leaves outside the new limit to this many days; the gateway validates the value.
--acknowledgestringDigest of the gateway's review of exactly this change, obtained with this same credential; the gateway validates it.

Constraints

  • --guardrail is required unless --budget or --key-budget-default

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
reviewpublic-review|nullKind, target, revision, whether acknowledgement was required, digest and change counts of the gateway's review; null when the gateway made no reviewed change.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview a workspace budget:

Shell
tdx workspaces guardrail set --id <workspace-id> --budget '{"window":"month","limit":"100.00"}' --dry-run --json

tdx workspaces rules#

Set a workspace's own rules.

Replace a workspace's own rules layer. A change that reduces access needs --acknowledge with the digest of the gateway's review for the same credential; see rules set --help.

tdx workspaces rules set#

Replace a workspace's rules.

Writes

Replace the workspace's own rules layer and per-key default budget (workspace_rules.manage in the workspace); omitted parts stay unchanged. Rules may only tighten the guardrail, and without install-wide workspaces.manage the per-key default may only be lowered. A change the gateway's review finds reduces access (such as a lower key limit or keys losing models) needs --acknowledge with the digest of the gateway's review of exactly this change, obtained with this same credential; without it the gateway refuses with REVIEW_REQUIRED, and with a digest that no longer matches with REVIEW_STALE (both exit 6); it applies nothing and this CLI shows no review. This command's --dry-run cannot show that review. To obtain the review and its digest, send the identical request with tdx api PUT '/control/v1/workspaces/<workspace-id>/rules?dryRun=true' --input <file> (the JSON body this command would send, without acknowledge, under wire names such as keyBudgetDefault and remediation {"clampExpiryDays": <days>}) --json, then rerun this command with the same options and --acknowledge <digest>. Any other body, or a gateway change in between, makes the digest stale. If the digest in the api output prints as █, make the change in the gateway dashboard (a digest read there usually does not match this CLI's credential). Write budget limits with a decimal point, such as 5.00: a --dry-run preview masks text matching a whole-number limit such as 5. See Workspace changes.

Shell
# PUT /control/v1/workspaces/:workspaceId/rules
tdx workspaces rules set --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--rulesjsonWorkspace rules: JSON policy layer object (models, maxKeyLifetimeDays, keyRpmMax, keyBudgetMax), or null for none; the gateway validates it.
--key-budget-defaultjsonPer-key default budget for new keys: JSON {"window", "limit"}, or null to remove it; the gateway validates it.
--clamp-expiry-daysintegerRemediation: shorten the lifetimes of keys the change leaves outside the new limit to this many days; the gateway validates the value.
--acknowledgestringDigest of the gateway's review of exactly this change, obtained with this same credential; the gateway validates it.

Constraints

  • --rules is required unless --key-budget-default

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
reviewpublic-review|nullKind, target, revision, whether acknowledgement was required, digest and change counts of the gateway's review; null when the gateway made no reviewed change.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview workspace rules:

Shell
tdx workspaces rules set --id <workspace-id> --rules '{"maxKeyLifetimeDays":30}' --dry-run --json

tdx workspaces pause#

Pause a workspace.

Writes

Pause a workspace, suspending its API keys until it is resumed (install-wide workspaces.manage). Pausing an active workspace always needs --acknowledge with the digest of the gateway's review of exactly this change, obtained with this same credential; without it the gateway refuses with REVIEW_REQUIRED, and with a digest that no longer matches with REVIEW_STALE (both exit 6); it applies nothing and this CLI shows no review. This command's --dry-run cannot show that review. To obtain the review and its digest, send the identical request with tdx api POST '/control/v1/workspaces/<workspace-id>/pause?dryRun=true' [--field reason=<reason>] --json, then rerun this command with the same options and --acknowledge <digest>. Any other body, or a gateway change in between, makes the digest stale. If the digest in the api output prints as █, make the change in the gateway dashboard (a digest read there usually does not match this CLI's credential). The api command's --field sends a bare number, true, false or null as a typed value, so for such a reason use --input <file> with the JSON body {"reason": "<reason>"}. Pausing a paused workspace changes nothing and returns review null. See Workspace changes.

Shell
# POST /control/v1/workspaces/:workspaceId/pause
tdx workspaces pause --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--reasonstringNon-secret reason shown with the paused status.
--acknowledgestringDigest of the gateway's review of exactly this change, obtained with this same credential; the gateway validates it.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
reviewpublic-review|nullKind, target, revision, whether acknowledgement was required, digest and change counts of the gateway's review; null when the gateway made no reviewed change.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview the pause request:

Shell
tdx workspaces pause --id <workspace-id> --dry-run --json

tdx workspaces resume#

Resume a paused workspace.

Writes

Resume a paused workspace (install-wide workspaces.manage); resuming an active one changes nothing. Resuming never reduces access, so it needs no --acknowledge; the route accepts one while the workspace is paused, and the gateway refuses a digest that does not match its review with REVIEW_STALE (exit 6). See Workspace changes.

Shell
# POST /control/v1/workspaces/:workspaceId/resume
tdx workspaces resume --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--acknowledgestringOptional review digest; resuming never needs one, and the gateway refuses one that does not match its review.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview the resume request:

Shell
tdx workspaces resume --id <workspace-id> --dry-run --json

tdx workspaces archive#

Archive an empty workspace.

Writes

Archive a workspace that holds no API keys (install-wide workspaces.manage): its roles, IdP bindings, admin keys and pending invites are removed. Archiving an open workspace always needs --acknowledge with the digest of the gateway's review of exactly this change, obtained with this same credential; without it the gateway refuses with REVIEW_REQUIRED, and with a digest that no longer matches with REVIEW_STALE (both exit 6); it applies nothing and this CLI shows no review. This command's --dry-run cannot show that review. To obtain the review and its digest, send the identical request with tdx api POST '/control/v1/workspaces/<workspace-id>/archive?dryRun=true' --json, then rerun this command with the same options and --acknowledge <digest>. Any other body, or a gateway change in between, makes the digest stale. If the digest in the api output prints as █, make the change in the gateway dashboard (a digest read there usually does not match this CLI's credential). Archiving an archived workspace changes nothing and returns review null. The Default workspace is never archived. See Workspace changes.

Shell
# POST /control/v1/workspaces/:workspaceId/archive
tdx workspaces archive --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--acknowledgestringDigest of the gateway's review of exactly this change, obtained with this same credential; the gateway validates it.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
reviewpublic-review|nullKind, target, revision, whether acknowledgement was required, digest and change counts of the gateway's review; null when the gateway made no reviewed change.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview the archive request:

Shell
tdx workspaces archive --id <workspace-id> --dry-run --json

tdx workspaces restore#

Restore an archived workspace.

Writes

Restore an archived workspace, empty, with no roles, bindings or pending invites (install-wide workspaces.manage); restoring an open one changes nothing. See Workspace changes.

Shell
# POST /control/v1/workspaces/:workspaceId/restore
tdx workspaces restore --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Output fields (inside data)

FieldTypeDescription
workspacepublic-workspaceId, slug, name, purpose, tags, status and its reason, counts, model access summary, guardrail, rules, budgets and, where the credential may see them, IdP bindings.
previewwrite-preview|nullRequested method, path and body, unchecked by the gateway; null after execution.

Examples

Preview the restore request:

Shell
tdx workspaces restore --id <workspace-id> --dry-run --json

tdx workspaces idp-bindings#

Identity-provider group bindings (dashboard only).

Binding identity-provider groups to workspace roles is session-only with step-up; this bearer-only CLI refuses it with SESSION_REQUIRED before any request or credential read, --dry-run included. Use the gateway dashboard.

tdx workspaces idp-bindings set#

Replace a workspace's IdP group bindings (dashboard only).

Dashboard only. The gateway serves this only to a signed-in dashboard session, so the CLI refuses it with SESSION_REQUIRED.

Unavailable to this bearer-only CLI: PUT /control/v1/workspaces/:workspaceId/idp-bindings is session-only: binding an identity-provider group hands a workspace role to everyone in it, so the gateway serves it only to an interactive dashboard sign-in holding idp_bindings.manage in the workspace, after a recent sign-in (step-up), never to a key. Use the gateway dashboard. --dry-run also refuses: there is no reachable change to preview. No request is sent and no credential, profile or file is read.

Shell
# PUT /control/v1/workspaces/:workspaceId/idp-bindings
tdx workspaces idp-bindings set --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

tdx workspaces key-preview#

Preview the API key a mint would create here.

Reads

Ask the gateway whether an inference-key mint here would be allowed, authorized as that mint (inference_keys.manage where the key would land), and what it would mint after policy adjustments. The gateway saves nothing, mints nothing and issues no credential. This is a read, not a dry-run: it sends the request, including with --dry-run, and any failure is reported as a failed read. A refusal by policy is a successful answer with allowed false and the refusal. With neither --owner nor a workspace-kind --template-id the gateway previews a personal key, which only a person holds: a person's session or their own admin key can preview one, but the master key or a service or unowned admin key needs --owner workspace or a workspace-kind --template-id. See Workspace reads.

Shell
# POST /control/v1/workspaces/:workspaceId/key-preview
tdx workspaces key-preview --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Optional flags

FlagTypeDefaultDescription
--template-idstringKey template id or slug from workspaces templates.
--ownerstringOwner kind the gateway accepts, such as personal or workspace; personal needs a signed-in person.
--allowed-modelstringModel id from tdx models list; repeat for several; omitted allows every model the workspace allows. Repeatable.
--expires-instringLifetime the gateway accepts, such as 30d or never; omitted uses the template's.
--rpmintegerRequests per minute; the gateway validates it.

Output fields (inside data)

FieldTypeDescription
allowedbooleanWhether the mint would be allowed.
refusalpublic-refusal|nullGateway refusal code, message and parameter when not allowed.
templatepublic-template|nullTemplate the preview applied.
draftpublic-key-draft|nullOwner, allowed models, expiry, rpm and template id the mint would use.
adjustmentspublic-adjustment[]Field, before, after and reason for each policy adjustment.
holderAccessEndsAtstring|nullWhen a personal key holder's access ends.

Examples

Check a workspace key mint:

Shell
tdx workspaces key-preview --id <workspace-id> --owner workspace --template-id <template-id> --json

tdx workspaces keys#

Inspect a workspace's keys.

Read the provenance of a key in a workspace.

tdx workspaces keys provenance#

Show who authorized a key and under which rules.

Reads

Read who minted a key in this workspace, its template and the rule revisions it was minted under, and whether the policy changed since. The gateway shows only a key this credential may read. The key id itself is withheld from output. See Workspace reads.

Shell
# GET /control/v1/workspaces/:workspaceId/keys/:keyId/provenance
tdx workspaces keys provenance --id <string> --key-id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.
--key-idstringPublic key id; never a credential.

Output fields (inside data)

FieldTypeDescription
provenancepublic-provenanceName, creation, creator, authority, template, rule revisions and whether policy changed since.

Examples

Read a key's provenance:

Shell
tdx workspaces keys provenance --id <workspace-id> --key-id <key-id> --json

tdx workspaces availability#

Show what a workspace's keys can call.

Reads

Read every model the gateway serves with whether this workspace's keys can call it and why not, prices of callable models where the gateway has them, and each provider's status there. See Workspace reads.

Shell
# GET /control/v1/workspaces/:workspaceId/availability
tdx workspaces availability --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic workspace id from workspaces list; never a credential.

Output fields (inside data)

FieldTypeDescription
workspaceIdstringWorkspace id.
workspaceStatusstringWorkspace status.
modelAccesspublic-model-accessMode, listed models and the layer that set them.
modelspublic-model-availability[]Each model's kind, providers, status, restriction, providers off and prices.
providerspublic-provider-availability[]Each provider's status and model counts.

Examples

List what a workspace can call:

Shell
tdx workspaces availability --id <workspace-id> --json=models

tdx workspaces spend-report#

Report spend for every workspace or one.

Reads

Read one month's spend report (spend.read): without --id, GET /control/v1/workspaces/spend-report across the workspaces this credential may read (grouped by workspace by default); with --id, that workspace's report (grouped by key by default; a developer sees only their own keys). JSON only: the gateway's CSV download (format=csv) is not supported, because this CLI reads JSON replies only. Rows withhold the reply's keyId and keyName fields; for key groupings the row's group and name are the key's id and name. A key row's keyKind prints the kind the gateway reports, a workspace (service) key's included. See Workspace reads.

Shell
# GET /control/v1/workspaces/spend-report
# GET /control/v1/workspaces/:workspaceId/spend-report
tdx workspaces spend-report [flags]

Optional flags

FlagTypeDefaultDescription
--idstringPublic workspace id; omitted reports every workspace the credential may read.
--periodstringMonth as YYYY-MM; omitted is the current month; the gateway validates the range.
--group-bystringGrouping the gateway accepts, such as workspace, key, person or model; workspace is not accepted with --id.
--key-idstringPublic key id; the gateway accepts it only with --group-by model.

Output fields (inside data)

FieldTypeDescription
periodstringReported month.
periodStartstringMonth start.
periodEndstringMonth end.
currentbooleanWhether the month is still running.
groupBystringGrouping used.
modelIdsstring|nullWhich model ids rows name, when grouped by model.
daysstring[]UTC days covered.
comparepublic-compare|nullComparison month and whether it is like for like.
rowspublic-spend-row[]One row per group with calls, token counts, cost, previous cost and daily cost.
totalpublic-spend-rowTotal row.
projectedCostUsdstring|nullProjected month cost.
coveragepublic-coverageCalls, priced, unpriced and estimated calls.

Examples

Report one workspace's spend by model:

Shell
tdx workspaces spend-report --id <workspace-id> --group-by model --json=rows,total

tdx workspaces templates#

List key templates.

Reads

Read the key templates the gateway offers, with how many unrevoked keys this credential may see use each. See Workspace reads.

Shell
# GET /control/v1/templates
tdx workspaces templates [flags]

Output fields (inside data)

FieldTypeDescription
templatespublic-template[]Id, slug, name, description, kind, lifetime, budget, rpm and use count.

Examples

List key templates:

Shell
tdx workspaces templates --json