Skip to content
Docs menu

Authentication: API keys and OAuth 2.1

FreshlyCited accepts two kinds of credentials. Use an API key for scripts, CI and MCP clients where you can set a header. Use OAuth for connectors like Claude.ai and ChatGPT, where you sign in instead of pasting a secret.

The story · 3 steps

Illustration with sample pages, not your data.

Get started10 bonus links with your first purchase, plus 100 free index checks every month while your account is paid.
API keyOAuth 2.1
Best forScripts, REST, Claude Code, Cursor, VS CodeClaude.ai, ChatGPT, Claude Desktop connectors, any MCP client that supports OAuth
Works onREST API and MCPMCP only (/mcp)
Acts asThe key (its workspace and role)You, in the workspace you pick on the consent screen
LifetimeUntil revokedAccess token 1 hour, refresh token 30 days (rotated)
RevokeAPI keys pageAPI keys › Connected apps (client viewers: Settings › Security), or /oauth/revoke

API keys

Open API keys (under Developers in the app's sidebar) and choose Create key; owners and admins can create keys. Under What the key can do, pick Admin (everything, including projects, people, credits and keys), Member (send pages and check Google) or Client viewer (read results only). The secret starts with fc_ and is shown once. Send it as a bearer token:

bash
curl https://freshlycited.com/api/v1/me -H "Authorization: Bearer fc_YOUR_KEY"

X-Api-Key: fc_… works too. Older keys start with ipk_ and keep working. A key belongs to one project (a workspace in the API: your account, or a project under it) and sees only that project and the projects under it. Its role decides what it can do: client_viewer keys are read-only. Each key can have its own rate limits and daily credit cap. Before your first purchase the REST API is read-only; any credit pack or Agency plan unlocks the rest.

Not sure which credential a client is using? Call whoami (or get_started): connection says apikey or oauth, and OAuth connections also show the app and its scope.

OAuth 2.1 for connectors

FreshlyCited implements the MCP authorization spec, so compliant clients discover everything from the server URL:

  1. The client calls https://freshlycited.com/mcp without a token and gets 401 with WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource/mcp", scope="mcp".
  2. It reads the protected resource metadata (RFC 9728), which names FreshlyCited as the authorization server.
  3. It reads the authorization server metadata (RFC 8414).
  4. It identifies itself with a Client ID Metadata Document (an https client_id URL) or registers through dynamic client registration at /oauth/register (RFC 7591).
  5. It sends you to /oauth/authorize with PKCE S256 and resource=https://freshlycited.com/mcp (RFC 8707).
  6. You sign in to FreshlyCited (Continue with Google or an email link) and see the consent screen, Connect an app to FreshlyCited: pick the Workspace and the Access level, then click Allow.
  7. The client exchanges the code at /oauth/token and calls the MCP server with Authorization: Bearer fca_….

Scopes

ScopeAccess
mcpFull access: send pages, check Google and manage what your role allows in the chosen workspace (spends credits)
mcp:readRead-only: see submissions, checks, credits and reports. Tools that change anything return 403

Tokens

  • Access tokens (fca_…) last 1 hour and only work on /mcp; they're bound to that resource and rejected by the REST API.
  • Refresh tokens (fcr_…) last 30 days and rotate on every use. If an old refresh token is used again, the whole connection is revoked for safety.
  • The authorization response includes iss (RFC 9207). Redirect URIs must match exactly, except loopback URIs (http://127.0.0.1 / localhost), where the port may differ.
  • Revoke with POST /oauth/revoke (RFC 7009), or disconnect the app under API keys › Connected apps (client viewers: Settings › Security). Removing you from the workspace also cuts the connection off.

Errors

StatusMeaning
401No credentials, an unknown or revoked key, or an expired access token. MCP responses include WWW-Authenticate so OAuth clients can sign in again.
403Your role (or a read-only connection) doesn't allow this, the feature isn't on your plan (plan_required, for example MCP below Agency Pro), or the account is waiting for approval
429Rate limit reached: wait for Retry-After seconds