continue icon indicating copy to clipboard operation
continue copied to clipboard

PLEASE, PLEASE actually DESCRIBE how to use environment variables to pass in an api key to, say, OpenAI tools

Open normancates opened this issue 11 months ago • 4 comments

Issue Category

Undocumented feature or missing documentation

Affected Documentation Page URL

https://docs.continue.dev/faqs#managing-local-secrets-and-environment-variables

Issue Description

This page anchor LITERALLY talks about environment variables. BUT you NEVER actually tell us HOW to access the environment variables.

eg. Ive added OPENAI_API_KEY to my shell environment. But Continue never sees it. It never accesses my API key.

I've wasted HOURS trying to figure this out. Please just put it in your documentation

Expected Content

I expect details on how to use environment variables with my API key in them, to be used by Continue

normancates avatar Dec 09 '25 11:12 normancates

Related issues:

  • #8158 - Cannot use Cloudflare model as environment variable (specific bug with @ character in env vars)
  • #1729 - Storing API keys in plain text (security concerns about config storage)
  • #8484 - Multiple local configs is not explained clearly (confusion about config file structure and secrets)
  • #8166 - docs: clarify secrets vs inputs syntax usage (PR that clarified ${{ secrets.X }} vs ${{ inputs.X }})
  • #8533 - Missing explanation and example for on premise proxy (related to secrets management)

The documentation does exist in the FAQs (https://docs.continue.dev/faqs#managing-local-secrets-and-environment-variables) but may need to be more prominently featured or cross-referenced in the model provider documentation.

continue avatar Dec 09 '25 11:12 continue

The documentation does NOT exist for how to use an environment variable of OPENAI_API_KEY in Continue.

All that faq page does is mention things about .env.

Which is NOT an environment variable. At least in terms of a value that can be returned using

In Windows

echo $env:OPENAI_API_KEY

normancates avatar Dec 09 '25 11:12 normancates

Hi @normancates,

  • for the CLI you can pass them in like a normal terminal experience e.g. macos export OPENAI_API_KEY=xxxx && cn. This will NOT work in vscode or jetbrains
  • for the extensions you can put them in .env files in the workspace root, or in .continue in the workspace or the global ~/.continue folder
  • You can also add them as secrets in the Continue hub if you are signed in

RomneyDa avatar Jan 23 '26 01:01 RomneyDa

References at https://docs.continue.dev/faqs#managing-local-secrets-and-environment-variables: Image Image

When interpolating the environment variables within an MCP server config: Image

From my experience there seems to be a discrepancy in the documentation. I am using a locally placed .env file at the project root level.

jimothy-tech avatar Feb 16 '26 20:02 jimothy-tech