Authentication
Sign in to thirdfy-agent with your Thirdfy account in the browser. Use an agent key in CI and agent runtimes, and an email code or wallet signature where there is no browser.
Sign in once and the CLI saves your session. On your own machine, sign in with your browser: it is the same Thirdfy sign-in Claude, ChatGPT and Cursor use. CI and agent runtimes skip sign-in and use an agent key.
| Where the CLI runs | How it signs in |
|---|---|
| Your laptop | Sign in with your browser: thirdfy-agent login |
| CI, a server, Hermes or OpenClaw | Agent key from thirdfy.com/connect |
| A machine with no browser, or owner commands | Email code or wallet signature |
Sign in with your browser
- The CLI opens the Thirdfy sign-in page. Sign in the way you do on thirdfy.com (email, Google or wallet).
- Pick the agent the CLI acts for, or click + Create a new agent.
- Approve. The browser hands the sign-in back to the CLI, which saves it in
~/.thirdfy/config.json.
No install needed to try it: npx @thirdfy/agent-cli login --trade.
- One agent. The sign-in acts for the agent you picked, like that agent's API key. To switch agents, run
loginagain. - Read or trade. Without
--trade, the CLI can read but not move funds. A write is refused withINSUFFICIENT_SCOPEand tells you to runthirdfy-agent login --trade. - Check it.
thirdfy-agent whoami --jsonshows the agent, the access you granted and when the sign-in ends. - Browser doesn't open?
--no-browserprints the link instead. Open it in a browser on the same machine, because the sign-in returns to a local listener (127.0.0.1). With no browser at all, use an agent key or an email code. - See or end it. The CLI is listed with your other apps at auth.thirdfy.com/connections.
thirdfy-agent logoutrevokes the sign-in and clears it locally.
A sign-in covers what an agent does: actions, preflight, preview, run, intent-status, credits balance, venue readiness and wallet profile. It can't run venue setup, venue fund, track-record or track actions/events; use an agent key for those. Commands that act as the owner (agent key rotation, delegation, wallet control) need an email code or an owner token. Most owner settings, such as the agent's policy and limits, are in the app at thirdfy.com/my-agents.
Needs CLI 0.5.0 or later.
What the CLI uses
You can pass each credential as a flag, set it as an environment variable, or let login save it in ~/.thirdfy/config.json. If you set more than one, a flag wins over the environment, and the environment wins over the saved config.
| Credential | Flag | Environment variable | Role |
|---|---|---|---|
| Browser sign-in | login | none | One agent, read or trade. Saved by thirdfy-agent login |
| Agent API key | --agent-api-key | THIRDFY_AGENT_API_KEY | The agent's identity for actions, preflight, preview and run. For CI and runtimes |
| Auth token | --auth-token | THIRDFY_AUTH_TOKEN | Owner or account auth |
| Owner session | --owner-session-token | THIRDFY_OWNER_SESSION_TOKEN | Owner session from an email code or a wallet signature |
An agent API key from --agent-api-key or THIRDFY_AGENT_API_KEY comes before the browser sign-in. The browser sign-in comes before an agent API key saved in the config.
Execution-only mode
Use this mode in CI or an agent runtime, where nobody signs in.
- Create the agent's key at thirdfy.com/connect under Agent key. It is shown once.
- Set two environment variables from your secret store:
THIRDFY_AGENT_API_KEY, the agent API keyTHIRDFY_AGENT_KEY, the agent's0xaddress, shown on the agent's page in Agents
With both set, you can run actions, preflight, preview, run and intent-status. If you set only the API key, commands fail with MISSING_USER_DID.
To set this up in a runtime, see Run a Hermes agent (the same setup works for OpenClaw).
Email code
Use this on a machine with no browser, for owner commands, or when an agent creates its own account. Thirdfy emails you a one-time code. You send it back to finish signing in.
Step 2 saves these in ~/.thirdfy/config.json:
- your owner session
- a new agent API key, when this is your first sign-in
- the agent's execution wallets (
executionWallets), with a base58 Solana address next to the EVM one - the default run mode
agent_walletfor a new profile
Before you run a write, fund the execution wallet for your target chain. Do not fund the email login wallet. It is for sign-in only.
To see your wallets, run thirdfy-agent wallet profile --json. It reads the live state from the API. wallet list shows only what is saved on your machine.
In scripts, put --not-interactive (or --ni) after login email. Then missing input fails instead of waiting for a prompt.
Wallet signature
Use this when you, the owner, want to sign in with your own wallet from the terminal.
verify returns an owner session. Pass it with --owner-session-token, for example to agent register --name "my-agent".
To save the session instead, run login with the same --challenge-id, --signature and --agent-key. To print the whole flow, run thirdfy-agent help onboarding --path wallet_sign --json.
Tokens you already have
If you already have an auth token, an owner session or an agent API key, save them once:
login also takes these flags:
| Flag | Use |
|---|---|
--owner-session-token | Save an owner session |
--owner-payout-address | Where exits from a wallet under wallet control are paid |
--allowed-actions | A comma-separated list of catalog actions for the agent's action template |
Sign out
Credits and gas
Your Thirdfy Credits decide whether a run is allowed. The free daily requests cover data reads only. Chat and writes are paid in Credits. Network gas is separate. Thirdfy sponsors it where the chain and action support it.
To check your credits, run thirdfy-agent credits balance --json, or open thirdfy.com/credits.
For the credentials each command needs, see CLI command reference: Authentication model.