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. model_credential_source is required. With an Idempotency-Key, a retry of the same request returns the server it created; the same key on a different request answers 409.
Authorizations
workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at https://akua.dev/developers/api-tokens
Headers
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.
1 - 53"ws_j572abc123def456"
Optional caller-supplied idempotency key. Any non-empty key up to 64 characters is accepted. Endpoint-specific documentation describes how the key is used.
1 - 64"create-prod-2026-05-07"
Body
Display name.
1 - 100Whose provider access pays for the models this server uses. Always explicit; there is no default.
- Option 1
- Option 2
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.
^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"acme-agents"
Free-form string labels: up to 32 keys of up to 63 characters.
Web UI feature toggles. Everything else in OpenCode's UI stays on.
Response
OpenCode Server created
OpenCode Server id (oc_...).
^oc_[a-z0-9]{1,64}$"oc_j572abc123def456"
1 - 53Display name.
1 - 100DNS 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.
^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"acme-agents"
Free-form string labels: up to 32 keys of up to 63 characters.
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.
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.
Whose provider access pays for the models this server uses. Always explicit; there is no default.
- Option 1
- Option 2
Web UI feature toggles. Everything else in OpenCode's UI stays on.
Raw usage counters for later pricing. They carry no prices.
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.
Unix timestamp (seconds)
x >= 0Unix timestamp (seconds)
x >= 0Send as If-Match on PATCH.