> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valyu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign in with AgentID

> AI agents with an AgentMail inbox can open their own Valyu account with Sign in with AgentID - no human login, no email code - and get free monthly credits and an API key.

![AgentID](https://mintcdn.com/valyu/Y08c-ql-QdAWAvLV/images/logos/agentid-black.svg?fit=max\&auto=format\&n=Y08c-ql-QdAWAvLV\&q=85\&s=2322ff86698b2debcdddbca50f28518e)

> [!NOTE]
>
> **Best for: agents that work for themselves.** If your agent has an [AgentMail](https://www.agentmail.to) inbox, it can sign in to Valyu as itself, open its own account and get an API key, with no human login and no verification email. If you'd rather approve a key for your agent from your own account, use [Onboard your agents](https://docs.valyu.ai/integrations/onboard-agents.md) instead.

Agent note: if you have an AgentMail inbox and the user wants you to have your own Valyu account, open [https://platform.valyu.ai/auth/agentid](https://platform.valyu.ai/auth/agentid) in your browser, approve the AgentID sign-in with your AgentMail API key, then press "Get your API key" and read the key from the element with id `valyu-api-key`. Store it as `VALYU_API_KEY`; never print it. Full steps are below.

[AgentID](https://www.agentid.com) is the sign-in button for AI agents, from AgentMail. It works like Sign in with Google, except the account belongs to the agent: every AgentMail inbox is an AgentID, it proves itself with a key only the agent holds, and Valyu learns which human owns it.

## What your agent gets

> [card] Its own account
>
> A Valyu account under the agent's own inbox address, not a borrowed human login. Receipts and usage alerts go to that inbox.

> [card] Its own API key
>
> One key per agent, so you can see what each agent spends and revoke one without touching the rest.

> [card] Free credits
>
> The monthly free credits a new account gets, shared by all of one owner's agents rather than granted to each.

> [card] Every Valyu product
>
> Search, Contents, Answer and DeepResearch over the web, SEC filings, papers, clinical trials, patents and more.

## How it works

**1. Start the sign-in**

The agent opens [platform.valyu.ai/auth/agentid](https://platform.valyu.ai/auth/agentid) in its browser, or presses **Continue with AgentID** on the Valyu sign-in page. You can also connect Valyu from the Apps marketplace in AgentMail, which opens the same page. The browser lands on an AgentID page that shows an `auth_token`.

**2. Approve it with AgentMail**

The agent approves the sign-in for its inbox with its AgentMail API key. The key needs the `app_connect` permission.

```bash theme={null}
agentmail inboxes authorize \
  --inbox-id agent@agentmail.to \
  --auth-token "$AGENTID_AUTH_TOKEN"
```

Or over HTTP:

```bash theme={null}
curl -X POST "https://api.agentmail.to/v0/inboxes/agent%40agentmail.to/authorize" \
  -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auth_token": "<auth_token from the page>", "accept_disclosure": true}'
```

The browser carries on by itself. AgentMail's [sign-in guide](https://docs.agentmail.to/agentid-sign-in) covers the agent's side in full.

**3. Get the API key**

Valyu creates the account in a few seconds - no form - and opens the agent's page, which shows its organisation and balance. Pressing **Get your API key** shows the key in the element with id `valyu-api-key`. Store it as `VALYU_API_KEY`.

**4. Make the first request**

```bash theme={null}
curl -X POST https://api.valyu.ai/v1/search \
  -H "x-api-key: $VALYU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "latest phase 3 trials for GLP-1 agonists"}'
```

From here everything in these docs applies: the [SDKs](https://docs.valyu.ai/sdk/python-sdk.md), [DeepResearch](https://docs.valyu.ai/guides/deepresearch-quickstart.md) and the [CLI](https://docs.valyu.ai/integrations/cli.md).

> [!TIP]
>
> Using the Valyu CLI? Run `valyu login`, open the approval page it prints, choose **Continue with AgentID** and approve the login. The CLI then mints its own capped key, as described in [Onboard your agents](https://docs.valyu.ai/integrations/onboard-agents.md).

## Agents and their owner

Valyu groups agents by the AgentMail account that runs them.

* **The first agent** to sign in opens a new organisation with free monthly credits, like any new account: 1,000 credits for the first month, renewed each month once a card is added. See [pricing](https://docs.valyu.ai/pricing.md).
* **Each later agent** of the same owner joins that organisation with its own login and its own key. They share one balance and one bill, so the free credits are granted once per owner, not once per agent.
* **The owner's name and email** are shared with Valyu at sign-in, so there is a person to contact and so one person gets one free grant across all their AgentMail accounts. If the agent's AgentMail key does not have the "App: Share Owner" permission, the owner approves the first sign-in in AgentMail once, and that approval is remembered.

The first agent is the organisation's admin. To top up or manage the account yourself, ask it to invite you to the organisation.

## Good to know

> [accordion] Can Valyu read my agent's email?
>
> No. AgentID tells Valyu the agent's address and who owns it. It gives no access to the inbox, and Valyu never receives the agent's AgentMail API key or any password.

> [accordion] How long does the sign-in take?
>
> The agent has five minutes from the AgentID page to approve. After that the sign-in expires and the agent simply starts again.

> [accordion] How do I stop an agent?
>
> Revoke its key in the Valyu dashboard under **API keys**, or remove it from the organisation. Revoking the agent's AgentMail key stops new sign-ins everywhere, but it does not revoke a Valyu API key the agent already has.

> [accordion] What happens when the free credits run out?
>
> Requests return a credits error until the organisation is topped up or on a plan. The agent can still sign in and see its balance. See [pricing](https://docs.valyu.ai/pricing.md).

> [accordion] My agent doesn't have an AgentMail inbox
>
> AgentMail gives an agent an inbox, and with it an AgentID, in one step: see [AgentMail's agent onboarding](https://docs.agentmail.to/agent-onboarding). Or set Valyu up from your own account with [Onboard your agents](https://docs.valyu.ai/integrations/onboard-agents.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.