Skip to content

Authentication

agent-data credentials connect your CLI, HTTP requests, or MCP client to an account. Account eligibility also depends on allowance, credits, and budgets.

  1. Install the CLI.
  2. Start browser approval with agent-data auth login.
  3. Open the printed approval URL.
  4. Approve access for your intended account.
  5. Check the credential with agent-data auth status.

For a terminal that cannot wait for approval, start a resumable login.

Terminal window
agent-data auth login --no-wait
  1. Save the returned loginId.
  2. Complete browser approval.
  3. Continue the saved attempt with this command.
Terminal window
agent-data auth login --resume <loginId>

<loginId> is the identifier of your saved login attempt. Use the same service URL and credential directory for both commands. This also applies to an interrupted registration.

This auth status excerpt comes from CLI 0.13.0 on November 14, 2026. It omits account details.

{
"status": "authenticated",
"credential": "oauth",
"explicitKeyOverride": false,
"keySource": null
}

credential: "oauth" identifies the selected browser login. If you expect OAuth but receive credential: "api_key", check the overrides below.

Create an API key in your dashboard. Supply AGENT_DATA_API_KEY through your shell or secret manager.

This Bash command reads the key without showing it or saving it in command history.

Terminal window
read -r -s -p 'agent-data API key: ' AGENT_DATA_API_KEY
export AGENT_DATA_API_KEY
agent-data auth status

CLI 0.13.0 selects the first available credential in this table.

PriorityCredential
1The command’s --api-key value.
2The AGENT_DATA_API_KEY environment variable.
3A saved OAuth login for the selected service.
4A saved API key in ~/.agent-data/config.json.

If the saved OAuth login is invalid, the CLI reports an error. It does not select the saved API key instead.

agent-data init --api-key "$AGENT_DATA_API_KEY" --codex saves the key and configures Codex. An environment variable alone does not save the key to a file.

~/.agent-data/
├── auth/ # Saved OAuth credentials
└── config.json # Saved API-key configuration

--auth-dir selects the OAuth directory. Omit it to use AGENT_DATA_AUTH_DIR, or ~/.agent-data/auth when that variable is absent.

--base-url selects the service URL. Omit it to use AGENT_DATA_BASE_URL, or https://agent-data.motie.dev when that variable is absent.

Keep credential files and values out of shared prompts, source control, and logs.

Clear the selected local OAuth login.

Terminal window
agent-data auth logout

API keys remain separate credentials. In Bash or zsh, run unset AGENT_DATA_API_KEY to remove the environment override. Revoke account API keys through the dashboard.

HTTP requests use Authorization: Bearer $AGENT_DATA_API_KEY. Use an account API key instead of copying tokens from private OAuth files.

MCP clients connect to https://agent-data.motie.dev/mcp. They use their own OAuth approval or supported bearer-token configuration. CLI authentication does not authenticate an MCP connection.

Command or optionEffect
auth loginStart browser approval.
auth login --no-waitReturn approval details immediately.
auth login --resume <loginId>Continue a saved approval or registration attempt.
auth statusCheck the selected credential against the service.
auth status --api-key <key>Check an explicit API key.
auth logoutClear the selected local OAuth login.
--base-url <url>Select the service.
Global --auth-dir <path>Select the directory for OAuth credentials.
What you seeWhat to do
The service returns 401.Check the selected service and credential. Repeat browser approval if needed.
The response identifies another account.Check credential precedence.
CLI whoami shows a key but requests fail.Run agent-data auth status because whoami only reads local configuration.

Repeat agent-data auth status after the correction.

Use account status when authentication succeeds but a data call fails because of allowance or spending controls.