Dock Docs
API reference

Keys

API keys, SSH keys, organization provider keys, and the ChatGPT connection.

All routes here need an API key or session unless stated. Secrets are never returned after creation, except by the reveal route. Shared rules are in Conventions.

API keys

API keys belong to you and act as you. See Authentication. Routes return an API key object:

FieldTypeDescription
iduuidKey id.
namestringLabel.
keyPrefixstringFirst characters of the raw key, to tell keys apart.
expiresAttimestamp, nullableWhen the key stops working; null means never.
revokedAttimestamp, nullableWhen the key was revoked.
lastUsedAttimestamp, nullableLast successful use.
createdAttimestampCreation time.

POST /v1/api-keys

Create an API key (201). The raw dock_... value is returned only in this response. Limited to 10 per hour and 20 active keys per user.

FieldTypeRequiredLimits / defaultDescription
namestringyes1 to 100Label.
expiresAtstringnoISO 8601, in the futureWhen the key stops working; no expiry when omitted.

Response: a key object plus apiKey, the raw value. Errors: validation_error, rate_limited, api_key_limit_reached.

GET /v1/api-keys

List your keys, newest first, including revoked ones. Raw values are never returned.

Response: an array of key objects.

DELETE /v1/api-keys/:id

Revoke a key.

Response: { "revoked": true }. Errors: api_key_not_found.

SSH keys

Public keys the SSH gateway accepts for you. Routes return an SSH key object:

FieldTypeDescription
iduuidKey id.
namestringLabel.
publicKeystringThe public key in OpenSSH format.
fingerprintstringSHA256: fingerprint.
lastUsedAttimestamp, nullableLast sign-in with the key.
createdAttimestampCreation time.

POST /v1/ssh-keys

Add an SSH key (201). Limited to 10 per hour and 20 keys per user.

FieldTypeRequiredLimits / defaultDescription
namestringyes1 to 100Label.
publicKeystringyes1 to 16384One OpenSSH public key line, such as the contents of ~/.ssh/id_ed25519.pub.

Response: an SSH key object. Errors: validation_error, rate_limited, ssh_key_exists, ssh_key_limit_reached.

GET /v1/ssh-keys

List your SSH keys, newest first.

Response: an array of SSH key objects.

DELETE /v1/ssh-keys/:id

Remove an SSH key.

Response: { "deleted": true }. Errors: ssh_key_not_found.

Provider keys

Provider keys are organization-wide model-provider keys, sealed at rest. The provider is one of anthropic, openai, openrouter, opencode. A provider key status is { "provider": "anthropic", "configured": true, "updatedAt": "..." }. All routes take the organization in organizationId.

GET /v1/agent-credentials

Show which providers have a key set. Role: member.

FieldTypeRequiredLimits / defaultDescription
organizationId (query)uuidyesOrganization.

Response: an array with one status per provider, configured: false and updatedAt: null for the ones without a key. Errors: validation_error, provider_keys_not_found (not a member).

PUT /v1/agent-credentials

Set or replace a provider key. Role: admin.

FieldTypeRequiredLimits / defaultDescription
organizationIduuidyesOrganization.
providerstringyesanthropic, openai, openrouter, opencodeProvider.
keystringyes1 to 512The key.

Response: the provider key status. Errors: validation_error, provider_keys_not_found (not a member).

GET /v1/agent-credentials/:provider/reveal

Return the stored key in plaintext. Role: admin.

FieldTypeRequiredLimits / defaultDescription
organizationId (query)uuidyesOrganization.

Response: { "provider": "anthropic", "key": "..." }. Errors: validation_error, provider_keys_not_found.

DELETE /v1/agent-credentials/:provider

Remove a provider key. Role: admin.

FieldTypeRequiredLimits / defaultDescription
organizationId (query)uuidyesOrganization.

Response: the provider key status, configured: false. Errors: validation_error, provider_keys_not_found.

ChatGPT connection

Your own ChatGPT subscription sign-in, never visible to other members. It is off unless the instance enables it (chatgptSignIn in GET /v1/config). A connection is:

FieldTypeDescription
connectedbooleanWhether a subscription is connected.
statusstring, nullableactive, or expired when you must sign in again.
emailstring, nullableThe ChatGPT account email.
planTypestring, nullableThe ChatGPT plan.
updatedAttimestamp, nullableLast change.

When nothing is connected, connected is false and the other fields are null.

GET /v1/chatgpt/connection

Read the connection status.

Response: the connection.

POST /v1/chatgpt/connection/device

Start the device sign-in flow. Limited to 10 per hour per user.

Response:

{ "userCode": "ABCD-1234", "verificationUrl": "https://...", "intervalSeconds": 5, "expiresAt": "..." }

Send the user to verificationUrl to enter userCode, then poll. Errors: chatgpt_signin_disabled, rate_limited, chatgpt_unavailable.

POST /v1/chatgpt/connection/device/poll

Poll the device flow. It stores the sign-in once the user approves.

Response: { "state": "pending" } while waiting, or { "state": "connected" } plus the connection fields once approved. Errors: chatgpt_signin_disabled, device_code_expired, chatgpt_unavailable.

DELETE /v1/chatgpt/connection

Disconnect.

Response: the connection with connected: false. Errors: chatgpt_not_connected.

On this page