Skip to content

Getting an OpenAI API Key

Stuart Meeks edited this page Jun 21, 2026 · 1 revision

Getting an OpenAI API key

FICSIT Foreman can run the foreman on OpenAI instead of Anthropic. You'll need an OpenAI API key — this is separate from a ChatGPT subscription and is billed on its own, by usage (per token). Keep the key secret.

Create a key

  1. Go to the OpenAI platform and sign in, or create an account.
  2. Add credit under Settings → Billing (the API needs a payment method or a prepaid top-up — without it, calls return a quota error).
  3. Open API keys (profile menu → API keys, or the dashboard).
  4. Choose Create new secret key, give it a name (for example FICSIT Foreman), pick a project if prompted, and create it.
  5. Copy the key now — it is shown only once. It starts with sk- (often sk-proj-).

Use the key

Pick one of these:

  • In the web app (easiest). Open the foreman at http://localhost:8725, click Settings, then set:

    • LLM providerOpenAI-compatible
    • Modelgpt-4.1 (or another OpenAI model)
    • Base URL → leave blank (defaults to OpenAI)
    • LLM API key → paste your key

    The key is stored only in your browser and sent with each message — never saved on the server.

  • On the server (covers everyone). Set these before starting the stack:

    LLM_PROVIDER=openai
    LLM_API_KEY=sk-...
    LLM_MODEL=gpt-4.1

    See Configuration for the full list. With a server key set, the web app works without anyone entering their own.

The same OpenAI-compatible path works for OpenRouter, Azure OpenAI, and Google's Gemini OpenAI-compatible endpoint — set the Base URL to that provider's endpoint and use its key. See Getting an Anthropic API key for the native Claude path.

Cost and safety

  • You are billed per token of usage. The foreman uses a capable model for chat and a cheaper model for background session summaries, to keep costs down.
  • Tool-calling quality varies by model — the foreman leans on tools heavily, so a strong model gives the best results.
  • Treat the key like a password: don't commit it or share it. Revoke or rotate it any time from the API keys page.

Clone this wiki locally