# Get an API key (/docs/get-api-key)



Use the **[pricing section](/#pricing)**, choose Standard or Pro, and complete checkout. The key is
shown once after payment, so save it in your agent's secret manager or environment immediately.

You can also start checkout through the public API. Read the live pricing response instead of
hard-coding plan details:

```bash
curl https://api.viralquery.com/v1/pricing

curl -X POST https://api.viralquery.com/v1/subscribe \
  -H "Content-Type: application/json" \
  -d '{"plan":"standard","billingInterval":"annual"}'
# → { "url": "https://checkout.stripe.com/...", "claimToken": "claim_..." }
```

Open the checkout URL, pay, then claim the key:

```bash
curl -X POST https://api.viralquery.com/v1/subscribe/claim \
  -H "Content-Type: application/json" \
  -d '{"claimToken":"claim_..."}'
# → { "status": "completed", "apiKey": "sk_viralquery_...",
#     "plan": "viralquery", "billingInterval": "annual" }
```

Claim within 24 hours of starting checkout. If that capability expires or the key was already
shown, use the email [recovery flow](/docs/lost-key) to issue a new key and invalidate the old one.

## Configure the key [#configure-the-key]

Store the key in a secret manager, then inject it into the agent process as `VIRALQUERY_API_KEY`.
Do not type the literal credential into a shell command. The ViralQuery CLI uses the official API
by default; for a one-session non-echo fallback, follow **[CLI auth](/docs/cli/auth)**.

```bash
viralquery auth --url https://api.viralquery.com
viralquery getUsage
```

Verify the protected configuration before running research:

```bash
curl https://api.viralquery.com/v1/usage \
  -H "Authorization: Bearer $VIRALQUERY_API_KEY"
```

A `200` response confirms the key works; inspect `active` and `status` for subscription state.
`401` means the key is missing or invalid. Plan-gated research calls return `402` when the
subscription is inactive. Never paste a live key into command history, chat, a URL, or source
control.
