API keys
Create several named SEOFix API keys, rotate and revoke them, how a key is tied to one team, how keys are stored, and how to keep them safe.
An API key (sk_...) lets an agent, script or CI job use the SEOFix REST API and MCP server for one team. Create as many as you need in Settings → Agent & MCP → API keys, each with its own name, or let npx seofix connect create one for your AI agent. A key is shown once, stored only as a hash, and can be revoked at any time.
Two kinds of keys
| Kind | Created by | How many | Shown in the API keys list as |
|---|---|---|---|
| Settings key | Create API key in Settings → Agent & MCP | up to 25 per user | the name you gave it |
| CLI key | npx seofix connect, approved at /connect |
one per machine, set of agents and team | seofix connect on <hostname> · <agents> |
Both kinds work the same way on the API and MCP server. Creating or revoking one key never touches the others.
Create a key
In the app:
- Open Settings → Agent & MCP.
- Under API keys, type a name that says where the key will be used, for example "Claude Code" or "GitHub Actions". The name is optional; without one the key is called "API key". The text above the form shows which team new keys act for.
- Click Create API key. Your other keys keep working.
- Copy the key from the Your new API key dialog. It is shown once; afterwards you see only its prefix (the first 12 characters).
- Click I've saved it.
You can hold up to 25 Settings keys; revoke one you no longer use to make room. Names starting with "CLI" are reserved for npx seofix connect.
For an AI agent on your computer, npx seofix connect creates a key and writes it into the agent's config for you. See Connect your agent.
Team scope
A key acts for exactly one team:
- A Settings key is bound to the team you were viewing when you created it. The key list shows each key's team.
- A CLI key is bound to the team you picked on the approval page.
Everything the key does happens in that team: it sees that team's sites, audits, fix tasks and rechecks, and nothing else. Resources of other teams answer 404 not_found. Switching teams in the app does not change what an existing key acts for. To work in another team, create a key while viewing that team, or run npx seofix connect and pick it.
The holder must still be a member of the team. If you leave or are removed from the team, the key stops working and answers 403 team_access_revoked.
There are no finer scopes: a key can read and change everything its holder can in that team through the API, including starting audits that spend credits.
Which credits a key spends
- Audits of a plain URL (
POST /v1/crawlswithurl, MCPstart_audit) are charged to the key holder's own balance. - Audits of a registered site, scheduled audits and rechecks are charged to the team owner's balance, whoever starts them.
GET /v1/account shows both balances. See API reference.
Rotate a key
- Settings key: create a new key, put it into every agent and CI job that used the old one, then revoke the old key. Nothing breaks in between, because both keys work until you revoke.
- CLI key: run
npx seofix connectagain with the same agents and the same team. It replaces that machine's previous key and updates the agent config.
Agents read their MCP config when they start, so restart them after a rotation.
Revoke a key
- Open Settings → Agent & MCP → API keys. Every key you hold, Settings and CLI keys alike, is listed with its prefix, team, creation date and when it was last used.
- Click Revoke next to the key and confirm with Revoke key.
The key stops working immediately: requests with it answer 401 unauthenticated. You can only see and revoke your own keys.
How keys are stored
- A key is
sk_followed by 40 random characters. - SEOFix stores only a SHA-256 hash of the key and its first 12 characters (the prefix shown in Settings). The full key cannot be shown again or recovered. If you lose it, create a new one or reconnect, and revoke the lost one.
- The key's last use is recorded on every request.
npx seofix connectreceives the key in a single response and writes it only into the agent config files, with mode0600.
Best practice
- Treat a key like a password. It can start audits and spend credits.
- Keep keys out of repositories. Use environment variables or your CI's secret store, for example
SEOFIX_API_KEY. - In Cursor,
.cursor/mcp.jsonholds the key: keep it untracked.npx seofix connectadds it to.git/info/excludefor you. - Use a separate, named key for each machine, agent or pipeline, so you can revoke one without breaking the others.
npx seofix connectalready gives each machine its own key. - Revoke keys you no longer use. Check "last used" in the API keys list.
- If a key may have leaked, revoke it (or rotate it) at once, then reconnect your agents.
Related
More in REST API
Still stuck? Email hello@seofix.ai with your site and what you expected to see.