Authentication

Exchange a Locus OAuth token for a scoped CLI credential

Exchanges a Locus MCP OAuth access token (mcp:read and mcp:execute) for one lcac_ execution credential bound to that OAuth connection. Refreshing the OAuth token keeps the same binding. The credential expires 7 days after its last use and never later than 30 days after issue. It stops working when the signed-in account loses execute access to the workspace. Generate registrationToken locally from exactly 24 random bytes encoded as unpadded base64url. Replaying the token renews the credential unchanged; a new token rotates it in place. A revoked credential is never renewed or rotated. tools behaves as on the Okibi route. hostname is optional and names the credential "Locus CLI (<hostname>)" in the dashboard.

post/credits/cli/credential

Request

  • Base URL
    https://api.paywithlocus.com/api
  • URL
    https://api.paywithlocus.com/api/credits/cli/credential
  • Auth
    OAuth 2
    Authorization code: https://api.paywithlocus.com/api/credits/mcp/oauth/authorize
    Token URL: https://api.paywithlocus.com/api/credits/mcp/oauth/token scopes: mcp:read, mcp:execute

Request body

registrationTokenstring required

Canonical base64url encoding of 24 bytes generated by a cryptographically secure random-number generator.

hostnamestring

Optional machine name shown in the dashboard. Control characters are removed.

Response

Existing credential renewed (same token) or rotated in place (new token); rotated tells which

successunknown required
createdboolean required

True when this bootstrap created the installation's credential (HTTP 201).

rotatedboolean required

True when a new registration token replaced the existing credential's secret in place (HTTP 200).

Changes

No recorded changes to this operation across all 1 revision of this API.