Add or rotate one OpenCode provider API key
Requires ADMIN or SUPER_USER. A repository-scoped update creates an encrypted override without mutating the inherited organization credential.
/organizations/{organization_id}/opencode-connection/api-keys/{provider_id}Requires ADMIN or SUPER_USER. A repository-scoped update creates an encrypted override without mutating the inherited organization credential.
In: cookie
Path Parameters
1 <= length <= 128^[a-z0-9][a-z0-9._-]{0,127}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/organizations/string/opencode-connection/api-keys/string" \ -H "Content-Type: application/json" \ -d '{ "api_key": "string" }'{ "data": { "connection": { "auth": { "active_version": 1, "configured": true, "fingerprint": "string", "inherited": true, "mode": "CREDENTIALS", "provider_ids": [ "string" ], "source_scope": "ORGANIZATION" }, "catalog": { "catalog": { "providers": [ { "id": "string", "models": [ { "capabilities": { "attachment": true, "reasoning": true, "temperature": true, "tool_call": true }, "id": "string", "limits": { "context": 0, "output": 0 }, "name": "string", "variants": [ "string" ] } ], "name": "string" } ], "runtime_version": "1.18.11" }, "configuration_fingerprint": "string", "credential_fingerprint": "string", "error": "string", "finished_at": "string", "id": "string", "last_successful_at": "string", "organization_id": "string", "provider_version": "string", "repository_id": "string", "started_at": "string", "status": "QUEUED", "updated_at": "string", "workflow_run_id": "string" }, "configuration": { "active_version": 1, "configured": true, "fingerprint": "string", "inherited": true, "source_scope": "ORGANIZATION" }, "organization_id": "string", "ready": true, "repository_id": "string" }, "excluded_sections": [ "string" ] }}Import an existing OpenCode auth document and safe provider/model configuration PUT
Requires ADMIN or SUPER_USER. Plugins, commands, permissions, project instructions, and all other top-level sections are excluded. Imported plaintext is encrypted and never returned.
Replace safe OpenCode provider and model configuration PUT
Next Page