Skip to content

API keys

Choose the permissions and token cap for each account integration.

Availability

The integration source is available for review. Account API access still needs deployment, migration and a verified account connection before use. These examples describe the source contract; they do not establish a live service.

Create and save a key

After account integration is activated, open Personal API keys. Give the key a recognizable name, select its permissions and set its monthly token cap. The full secret is shown once: save it privately before hiding it. The settings list shows a display prefix and metadata, not the full secret. Revoke a key from the same page when it is no longer needed.

Choose permissions

read retrieves stored readings and stored Designer moves. evidence:write appends evidence without running a reading. reading:run permits a confirmed re-read, subject to the wallet and budget. Read access alone does not permit writes or spending. Use only the permissions required by the integration.

Set a monthly cap

The key's monthly token cap resets on the first day of each month at 00:00 UTC. A zero cap blocks paid readings while allowing permitted cached retrievals. A positive cap does not replace explicit confirmation of a reading's cost, and does not add tokens to the account wallet.

Keep the secret private

Provision MOATDEFENDER_API_KEY in the process environment through your secret store. Never put the literal key in source, configuration files, command arguments, URLs, screenshots or logs. Account requests require Authorization: Bearer followed by the secret; cookies, email headers and a display prefix cannot replace it. Public MCP guidance needs no key. If a key is exposed, revoke it and create a replacement.

Permission errors

The response below means the key lacks the requested scope. Select an appropriately scoped key rather than retrying with an email address or a session cookie. Missing, invalid and revoked keys return 401 unauthorized.

json
{
  "ok": false,
  "code": "insufficient_scope",
  "error": "API key scope does not permit this action."
}

Search documentation

Search across all documentation

    ↑↓ Navigate ↵ OpenEsc Close