Add a provider connection.
A model connection (ai: its harness, and optionally its default model; a launch always names its model) or the workspace's Boat account.
POST/api/v1/provider-connections
Scopeconfig
Its key goes to setConnectionSecret (a model connection) or setCloudApiKey (Boat) afterwards; it is never part of this body. OpenCode's own service (provider: "opencode", harness opencode) takes no key at all: method: "free" is its free models (workspace scope; once per workspace, so adding it again answers the one there), usable on any machine that runs OpenCode, cloud workers included; method: "machine_sign_in" is the OpenCode account a paired machine is signed in to (opencode auth login there), with scope: { kind: "machine", nodeId } and placement local: only the person who paired that machine may add it (403 not_allowed; never with an API key), it is theirs (owner), runs only there and only for crews they launch, never on a cloud worker (400 invalid_body), and once per machine and person. Their account check reads what machines report, never a paid turn. The timeline records the key ID, action and outcome.
Headers.
Idempotency-Keystring
Retry the same request with the same key. Retry rules.
Body.
providerenumrequired
Who serves the model, or boat for the workspace's Boat account. opencode-zen and opencode-go run on the OpenCode harness only. One of anthropic, morph, openai, custom, opencode-zen, opencode-go, opencode, boat.
methodenumrequired
How it signs in. Boat and OpenCode take api_key; boat_profile is for OpenAI through Codex. One of api_key, oauth_token, boat_profile, free, machine_sign_in.
namestringrequired
A name for the connection, shown in the dashboard. 1 to 80 characters.
scopeobjectrequired
Who may use it. A new model connection is workspace-wide (409 method_unavailable for a project or a machine); Boat is always workspace-wide.
ShowHide 3 fields
kindenumrequired
workspace for the whole workspace, project for one project, machine for one paired machine.
projectIdstring
The project, when kind is project. At least 5 characters. With kind project.
nodeIdstring
The machine, when kind is machine. At least 5 characters. With kind machine.
placementenumrequired
Where it may run: local on paired machines, cloud on cloud workers, both.
aiobject
The model settings, required for every provider but Boat, which takes none.
ShowHide 6 fields
harnessenumrequired
The coding agent program that runs the model. A machine runs it only when that harness is installed there. One of claude-code, pi, codex, opencode.
modelstring
The model agents use when a launch names none. Optional: a launch always names its model. 1 to 200 characters.
optionsobject
Options agents use when a launch names none. Default {}.
ShowHide 1 field
effortenum
How hard the model thinks, where the harness and model take it. One of low, medium, high, xhigh, max.
baseUrlstring
The provider's address, for a custom provider only. A URL.
meteringenumrequired
How you pay the provider for it: subscription or metered. Shown in forecasts; Koidog bills nothing.
maxConcurrent1–100required
The most agents that use it at once; the rest wait.
cloudSpendCapobject | null
The cloud spend cap offered at Boat connect: a monthly amount, or null to skip (asked before the first cloud spend).
ShowHide 2 fields
capUsdnumber
The most the workspace may spend on cloud VMs in a calendar month (UTC), in US dollars. A launch that would go over it is refused before a VM is created. > 0. ≤ 1000000. Default 10.
period"month"
How often the cap starts again. Only month today. Default month.
Response.
201 Created · JSON object
- 422 validation_failed
- Each schema error appears in
details.