OpenCode Servers
Create an OpenCode Server
Creates a hosted OpenCode Server in the workspace with a random id. OpenCode's own settings (models, providers, agents) are managed in OpenCode itself; this resource holds the platform guardrails around it. With an Idempotency-Key, a retry of the same request returns the server it created; the same key on a different request answers 409.
Bearer token for the authenticated caller.
Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.
Required string length: 1 - 53
Example: "ws_j572abc123def4"
Optional caller-supplied idempotency key. Any non-empty key up to 64 characters is accepted. Endpoint-specific documentation describes how the key is used.
Required string length: 1 - 64
Example: "create-prod-2026-05-07"
Body
DNS label chosen for the server's browser UI; unique across the platform. Created from the name plus a short random suffix when not given. The UI is served at web_url until chosen hostnames are routed.
Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
Example: "acme-agents"
Free-form string labels: up to 32 keys of up to 63 characters.
Maximum object length: 32 entries
Web UI feature toggles. Everything else in OpenCode's UI stays on.
An existing Vault of this Workspace that you may use. The server does not own it. Left out, a new Vault is created for this server.
Response
OpenCode Server created
OpenCode Server id (oc_...).
Pattern: ^oc_[a-z0-9]{1,64}$
Example: "oc_j572abc123def456"
Required string length: 1 - 53
DNS label chosen for the server's browser UI; unique across the platform. Created from the name plus a short random suffix when not given. The UI is served at web_url until chosen hostnames are routed.
Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
Example: "acme-agents"
Free-form string labels: up to 32 keys of up to 63 characters.
Maximum object length: 32 entries
ACTIVE: serves OpenCode protocol traffic. SUSPENDED: the gateway refuses protocol traffic until it is resumed. DELETED: terminal; the id stays reserved. SUSPENDING, RESUMING and DELETING: a requested change is in progress; its Operation finishes when the server reached the new state. A deletion always finishes.
Available options: ACTIVE, SUSPENDING, SUSPENDED, RESUMING, DELETING, DELETED
True for the Workspace's default server, which exists as soon as the Workspace uses OpenCode and cannot be deleted.
Web UI feature toggles. Everything else in OpenCode's UI stays on.
The Vault of the server's third-party credentials: the one named at creation, or the Vault created for this server.
Where people open the server's web UI: https://oc-<key>.akua.run/, a browser origin of its own, derived from the server id. null when this deployment hosts no OpenCode Servers.
The long form of the server's address, https://<api host>/v1/opencodes/{id}/: OpenCode's protocol under api/, its web UI at the base. null when this deployment hosts no OpenCode Servers.
The short form, https://<site host>/{id}/: protocol requests only, always with an explicit token. null when this deployment has none.
Send as If-Match on PATCH.