import { createFileRoute } from "@tanstack/react-router"; const OPENROUTER_KEYS_URL = "https://openrouter.ai/settings/keys"; export const Route = createFileRoute("/_app/help/openrouter-api-key")({ component: OpenrouterApiKeyHelpPage, }); function OpenrouterApiKeyHelpPage() { return (

Set up your OpenRouter API key

OpenSEO needs the OPENROUTER_API_KEY secret before AI features like SAM, the in-app SEO agent, can run. It is optional — everything else in OpenSEO works without it.

Steps

  1. Create an account at{" "} openrouter.ai {" "} and add credits (pay-as-you-go, like DataForSEO).
  2. Go to{" "} OpenRouter API Keys {" "} and click "Create API Key".
  3. Save the key as the OPENROUTER_API_KEY secret in your environment:
    • Docker self-hosting: .env
    • Cloudflare: set it in the Workers UI (see below)
    • Local development: .env.local
  4. Restart OpenSEO.

Cloudflare Workers (Dashboard UI)

  1. In Cloudflare, go to Compute ->{" "} Workers & Pages and open your OpenSEO Worker.
  2. Open Settings.
  3. Go to Variables & Secrets and add a new secret named OPENROUTER_API_KEY.
  4. Paste your OpenRouter API key and save.

Or set the same secret from your terminal with:

              npx wrangler secret put OPENROUTER_API_KEY
            

Paste your OpenRouter API key when prompted.

); }