Authentication
agent-data credentials connect your CLI, HTTP requests, or MCP client to an account. Account eligibility also depends on allowance, credits, and budgets.
Browser sign-in
Section titled “Browser sign-in”- Install the CLI.
- Start browser approval with
agent-data auth login. - Open the printed approval URL.
- Approve access for your intended account.
- Check the credential with
agent-data auth status.
For a terminal that cannot wait for approval, start a resumable login.
agent-data auth login --no-wait- Save the returned
loginId. - Complete browser approval.
- Continue the saved attempt with this command.
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.
API keys and credential precedence
Section titled “API keys and credential precedence”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.
read -r -s -p 'agent-data API key: ' AGENT_DATA_API_KEYexport AGENT_DATA_API_KEYagent-data auth statusCLI 0.13.0 selects the first available credential in this table.
| Priority | Credential |
|---|---|
| 1 | The command’s --api-key value. |
| 2 | The AGENT_DATA_API_KEY environment variable. |
| 3 | A saved OAuth login for the selected service. |
| 4 | A 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.
Credential files
Section titled “Credential files”~/.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 a saved login
Section titled “Clear a saved login”Clear the selected local OAuth login.
agent-data auth logoutAPI 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 and MCP
Section titled “HTTP and MCP”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.
Authentication reference
Section titled “Authentication reference”| Command or option | Effect |
|---|---|
auth login | Start browser approval. |
auth login --no-wait | Return approval details immediately. |
auth login --resume <loginId> | Continue a saved approval or registration attempt. |
auth status | Check the selected credential against the service. |
auth status --api-key <key> | Check an explicit API key. |
auth logout | Clear the selected local OAuth login. |
--base-url <url> | Select the service. |
Global --auth-dir <path> | Select the directory for OAuth credentials. |
Connection problems
Section titled “Connection problems”| What you see | What 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.
When to read account status
Section titled “When to read account status”Use account status when authentication succeeds but a data call fails because of allowance or spending controls.