Use Custom OpenAI API Key
What a Custom OpenAI API Key Is
- A secret token issued by OpenAI that identifies your account to the OpenAI API.
- Used in the
Authorization: Bearer YOUR_API_KEY HTTP header for every API request.
- Controls which models you can access and where usage is billed.
When to Use Your Own Key
- Building your own tools, scripts, or integrations around ChatGPT.
- Connecting external apps (e.g., TheBrain, local scripts) directly to OpenAI.
- When you want clear, account‑level tracking of token usage and cost.
Security Guidelines
- Treat the key like a password – never share it publicly or check it into Git.
- Store it in a password manager, environment variable, or secure config file.
- Rotate/regenerate the key if you suspect it has been exposed.
- Use server‑side code (not in-browser JavaScript) when possible so the key is not shipped to end users.
App‑Specific Notes
- Use this thought to record how your specific tools or scripts expect the key to be configured.
- Example fields to document:
- Where to paste the key in the app
- Which model(s) are allowed
- Any rate‑limit or budget rules you want to enforce