Skip to Content
Self-hostProvider API keys

Provider API Keys

Genfeed does not generate content by itself. It calls model providers with keys that you supply. Self-hosting has no Genfeed credits: you create accounts with the providers you want, add their keys to your instance, and pay those providers directly under their own terms.

Set a real, non-placeholder OPENROUTER_API_KEY before starting the container. Since v0.2.15, an empty or placeholder value stops startup before services run. The installation wizard asks for the key; with the release bundle, set it in .env before docker compose up. Text generation and the agent use OpenRouter; other provider keys are optional.

Supported keys

ProviderEnvironment variableRequired?Used for
OpenRouterOPENROUTER_API_KEYYes, before startup and for text generationChat, agents, post drafts, prompt enhancement, newsletters, and workflow LLM steps
OpenAIOPENAI_API_KEYNoDirect access to openai/* models, where a path routes there
AnthropicANTHROPIC_API_KEYNoDirect access to anthropic/* models, where a path routes there
ReplicateREPLICATE_KEYFor mediaHosted image, video, and other media models
falFAL_API_KEYFor media, where a path selects falHosted media models
ElevenLabsELEVENLABS_API_KEYFor voiceVoice and audio

All provider keys are blank in the self-hosted .env.example. Set OPENROUTER_API_KEY to a real key before the first start. After later edits, recreate the stack. Startup checks the key’s format and rejects empty or placeholder values; it does not prove that your provider account has access to a model. Settings validates each key with the provider before saving it.

Can another provider replace OpenRouter?

Not for the default paths. The routing rules, checked against the code, are:

  • Model ids starting with openai/ go to OpenAI when OPENAI_API_KEY is set, and ids starting with anthropic/ go to Anthropic when ANTHROPIC_API_KEY is set.
  • Every other model id goes to OpenRouter. An openai/* or anthropic/* id with no direct key also falls back to OpenRouter.
  • Branded drafts (post drafts written in a brand’s voice) are OpenRouter-only, whatever other keys you have.
  • Replicate, fal, and ElevenLabs are media and voice providers. They never generate text.

An OpenAI or Anthropic key does not replace the OpenRouter startup requirement. If you want OpenAI or Anthropic models, you can reach them through OpenRouter with the same single key, and the direct keys are an optional addition.

Once the instance is running, an OpenRouter key saved for an organization can serve supported generation paths. It does not replace the deployment-wide OPENROUTER_API_KEY required at container startup. See Per organization.

Which key does a feature need?

FeatureKey
Chat and agentsOPENROUTER_API_KEY
Post and branded draftsOPENROUTER_API_KEY
Prompt enhancementOPENROUTER_API_KEY
Newsletters and workflow LLM stepsOPENROUTER_API_KEY
Image and video generationREPLICATE_KEY or FAL_API_KEY, depending on the model
Voice and audioELEVENLABS_API_KEY

Other providers in the model registry (such as xAI) are listed in Models and providers and are configured through Integrations.

How to get each key

Create an API key in each provider’s own dashboard. Provider sites change, so follow their current instructions.

Each provider bills you separately and may require a payment method, a funded balance, or account approval before a key can run a given model.

Add keys to your instance

Deployment-wide, in .env

  1. Open the .env next to your compose.yml.

  2. Set OPENROUTER_API_KEY before the first start, and add any optional keys after their variables:

    OPENROUTER_API_KEY=sk-or-... OPENAI_API_KEY="" ANTHROPIC_API_KEY="" REPLICATE_KEY="" FAL_API_KEY="" ELEVENLABS_API_KEY=""
  3. Recreate the stack so the container reads the new values. A plain docker compose restart does not re-read .env:

    docker compose --env-file .env -f compose.yml up -d

Use real keys only. If OPENROUTER_API_KEY is empty or still a template value, the container exits with OPENROUTER_API_KEY is required and must contain a non-placeholder OpenRouter key. Set it before starting. No services start.

Keys in .env are server-side only. Never commit .env and never put a key in a NEXT_PUBLIC_* variable.

Per organization, in the app

Provider keys can also be entered in the app under Organization settings → Integrations. When a generation path supports it, an organization’s own key takes precedence over the deployment-wide key in .env. See AI providers for every provider the app accepts.

Check that a key works

Run a small, non-sensitive generation with a model from that provider. If it fails, check the provider dashboard for account, billing, or model-access issues, and read the container logs:

docker compose --env-file .env -f compose.yml logs genfeed

Missing provider key error

If a generation fails with this message, the key it names is not set:

Missing provider key: OPENROUTER_API_KEY

The API answers with HTTP 503 and code: "missing_provider_key". Agent and draft flows show it as “AI provider not connected”. Add the key as described above and recreate the stack; no data is lost and no credit is charged for the failed attempt, so you can run the same generation again. See Troubleshooting.

Privacy and cost

  • Prompts and media sent to a provider are processed under that provider’s terms. Application records stay on your infrastructure.
  • Genfeed does not meter bring-your-own-key usage. Provider quotas and charges apply directly to your provider account.

Running models locally

The Community image does not start GPU or local-model services, so it does not run open-source models on its own. Generation runs through the model providers whose keys you configure above.

Next

Last updated on