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 runsHow it signs in
Your laptopSign in with your browser: thirdfy-agent login
CI, a server, Hermes or OpenClawAgent key from thirdfy.com/connect
A machine with no browser, or owner commandsEmail code or wallet signature

Sign in with your browser

# Read access
thirdfy-agent login

# Read and trade access
thirdfy-agent login --trade
  1. The CLI opens the Thirdfy sign-in page. Sign in the way you do on thirdfy.com (email, Google or wallet).
  2. Pick the agent the CLI acts for, or click + Create a new agent.
  3. 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 login again.
  • Read or trade. Without --trade, the CLI can read but not move funds. A write is refused with INSUFFICIENT_SCOPE and tells you to run thirdfy-agent login --trade.
  • Check it. thirdfy-agent whoami --json shows the agent, the access you granted and when the sign-in ends.
  • Browser doesn't open? --no-browser prints 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 logout revokes 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.

CredentialFlagEnvironment variableRole
Browser sign-inloginnoneOne agent, read or trade. Saved by thirdfy-agent login
Agent API key--agent-api-keyTHIRDFY_AGENT_API_KEYThe agent's identity for actions, preflight, preview and run. For CI and runtimes
Auth token--auth-tokenTHIRDFY_AUTH_TOKENOwner or account auth
Owner session--owner-session-tokenTHIRDFY_OWNER_SESSION_TOKENOwner 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.

  1. Create the agent's key at thirdfy.com/connect under Agent key. It is shown once.
  2. Set two environment variables from your secret store:
    • THIRDFY_AGENT_API_KEY, the agent API key
    • THIRDFY_AGENT_KEY, the agent's 0x address, 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 1: send the code
thirdfy-agent login email you@example.com --json

# Step 2: verify, accept terms, create the agent and its wallets
thirdfy-agent login email you@example.com --code "<otp>" --accept-terms --key-name "My Agent" --json

thirdfy-agent whoami --json
thirdfy-agent wallet list --json
thirdfy-agent help onboarding --json

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_wallet for 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.

thirdfy-agent agent auth challenge --agent-key "0xYOUR_AGENT_KEY" --json
# Sign challenge.message with the wallet, then verify:
thirdfy-agent agent auth verify --challenge-id "<challengeId>" --signature "0x..." --agent-key "0xYOUR_AGENT_KEY" --json

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:

thirdfy-agent login --auth-token "$THIRDFY_AUTH_TOKEN" --agent-api-key "$THIRDFY_AGENT_API_KEY" --json
thirdfy-agent whoami --json

login also takes these flags:

FlagUse
--owner-session-tokenSave an owner session
--owner-payout-addressWhere exits from a wallet under wallet control are paid
--allowed-actionsA comma-separated list of catalog actions for the agent's action template

Sign out

thirdfy-agent logout --json        # revoke a browser sign-in and clear the local config
thirdfy-agent logout --all --json  # also revoke the owner session on the server

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.