Documentation
Account and keys
View .mdOpenAPI

Register a workspace

POSThttps://weights.fyi/run/v1/workspacesscope: manage
text
POST https://weights.fyi/run/v1/workspaces
Authorization: Bearer <token>                    scope: manage
Content-Type: application/json
{"name": "<workspace>", "trace_preferences": {"log_inputs": false, "log_outputs": false}, "purge_trace_content": true, "models": ["<id>"], "issue_token": {"name": "<name>", "scopes": ["read", "submit"]}, "confidential": "shared" | "dedicated" | {"state": "revoked"}}
Available since
2026-10-20 workspace registration from code: included in this build; see What is live for deployment status.
Answer time
synchronous: the workspace, its switches and its endpoints are written and come back.

Finds or creates the workspace named name among the key's person's workspaces (case does not matter), sets its trace switches and, as asked, enrolls a trace storage key, binds a confidential mode, removes kept content, creates model endpoints and returns an API token once. Every field is optional; an empty body locks down the key's own workspace. A repeat finds the same workspace: 201 when created, 200 when found.

Both switches default off; kept content is then removed unless purge_trace_content is false. Fields are checked before any write; tokens are issued only after every model is found. Ambiguous names and workspaces the person merely belongs to are refused.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer and your token, with the manage scope.
namebodynoThe workspace to find or create; the key's own workspace when omitted.
trace_preferencesbodynolog_inputs and log_outputs, both booleans; both false when omitted.
purge_trace_contentbodynoRemove kept inputs and outputs; true when both switches end off.
modelsbodynoUp to 16 model ids; each gets an endpoint, as POST /v1/endpoints makes one.
issue_tokenbodynoname and scopes of a key of the workspace, shown once; the scopes must be within the calling key's.
cmkbodynoEnroll with tenant_id, client_id, vault, key_name, key_version; omit to keep the binding as it is. {"state": "revoked"} revokes it; null is refused. tenant_id and the dedicated storage identity's client_id are lowercase UUIDs; vault is 3–24 lowercase ASCII letters, digits or hyphens, starting with a letter, ending with a letter or digit, without consecutive hyphens; key_name is 1–127 ASCII letters, digits or hyphens; key_version is exactly 32 lowercase hex characters.
confidentialbodyno"shared" or "dedicated" binds a confidential mode; {"state": "revoked"} ends it; omit to keep it as it is; any other value is refused. It needs an active cmk binding (already bound, or enrolled in this call), both trace switches off and no trace destination. dedicated: sealed calls are served only by a pool your workspace owns, or a platform pool granted to it. shared: also by a pool another workspace shares with yours. Any other pool answers 403 encrypted_envelope_cross_workspace.
c2bodynoBind an existing workspace's Azure VMs with tenant_id, client_id (the compute identity, never the cmk one), subscription_id, resource_group and vms (1 to 32 distinct VM names); omit to keep the binding as it is, repeat it to keep its bound_at. {"state": "revoked"} revokes it; null is refused.

CMK enrollment proves wrap and unwrap access before writing anything.

New trace payloads are sealed with AES-256-GCM under fresh data keys that the fixed Key Vault version wraps; envelope bytes count toward retention limits. While the binding is revoked or Key Vault refuses, jobs still run but their content is not kept, and reads answer 403 cmk_key_refused; every read unwraps live. Repeating enrollment preserves bound_at and proves access again. This covers newly retained traces, not earlier plaintext, job execution storage or exported copies. Re-enrolling a usable key restores access to matching envelopes.

While a confidential mode is bound, chat and classify calls must carry encrypted_envelope: a plain one answers 400 encrypted_envelope_required, as every page batch does. Revoking it lifts that at once.

A c2 binding lets the service start and deallocate VMs already in your subscription, never create or delete one. The compute identity first reads every VM: each must be evictable (evictionPolicy Deallocate or Delete) and tagged weights.fyi-managed = c2 and weights.fyi-workspace = the workspace id. Each start or deallocation checks again.

Return value

200 OK or 201 Created: workspace as GET /v1/workspaces reads it, created, trace_preferences, trace_sinks_count, governed_tracing, purged (the copies removed, or null when no purge was asked), endpoints (one per model, as GET /v1/endpoints/{endpoint} shows them) and, when asked, token with its note.

Errors

StatusCodeWhen it happensWhat to do
400invalid_request, invalid_json, invalid_preferences, workspace_name_invalidA field is missing, unknown or of the wrong shape.Send the fields as described.
400invalid_requestconfidential is not one of its three values, or a mode is asked without an active cmk binding; field says confidential.Enroll cmk first, or in the same call.
400invalid_preferencesA confidential mode with a trace switch on or a trace destination present.Turn both switches off and remove the destinations first.
400model_not_availableA model in models is not one the workspace can run; the workspace and its switches are already written.Pick ids from available and send again.
401unauthorized, invalid_token, token_revoked, token_expiredNo token, or one that does not work.Use a valid token.
403scope_requiredThe token lacks manage, or issue_token asks a scope it does not hold.Use a token with manage; ask for scopes within it.
403workspace_role_requiredname is a workspace the person only belongs to.Use a workspace the person owns or administers.
400invalid_requestc2 names a workspace that does not exist yet, revokes a binding never made, or shares its client_id with cmk.Create the workspace and tag its VMs first; give each purpose its own identity.
403cmk_key_refusedThe workload identity cannot prove wrap and unwrap access to the exact version. No binding or token is created.Check federation, key permissions and the enabled version.
403c2_target_refusedThe compute identity could not read every VM, or one is not evictable or lacks the tags. Nothing is written.Check its federation, its read access to the VMs, their eviction policy and their tags.
409workspace_name_ambiguousTwo of the person's workspaces carry name.Rename one in the app, then send again.
409workspace_changedThe named workspace lost its name while its VMs were being read.Send again.

Examples

sh
curl -s -X POST https://weights.fyi/run/v1/workspaces \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{"name": "awow-io", "trace_preferences": {"log_inputs": false, "log_outputs": false}, "models": ["almanakje-gemma3-12b"]}'
json
{"workspace": {"id": 7, "name": "awow-io", "owner_id": 1, "created_at": "2026-10-20T12:00:00Z", "cmk": null, "c2": null, "confidential": null, "trace_preferences": {"log_inputs": false, "log_outputs": false}, "trace_sinks_count": 0, "governed_tracing": true, "domains": []}, "created": true, "trace_preferences": {"log_inputs": false, "log_outputs": false}, "trace_sinks_count": 0, "governed_tracing": true, "purged": 0, "endpoints": [{"id": "ep_1", "model": "almanakje-gemma3-12b"}]}

History

  • 2026-10-20 workspace registration from code: added.
  • 2026-10-20 Rung 1: CMK enrollment and revocation for retained trace content.
  • 2026-10-20 Mode C2: binding and revocation of a workspace's own Azure VMs.
  • 2026-11-16: confidential documented.

See also