Skip to content

Rename CHATGPT_API_KEY to OPENAI_API_KEY#156

Open
senthilkumaranT wants to merge 1 commit intoVectifyAI:mainfrom
senthilkumaranT:refactor/rename-openai-api-key
Open

Rename CHATGPT_API_KEY to OPENAI_API_KEY#156
senthilkumaranT wants to merge 1 commit intoVectifyAI:mainfrom
senthilkumaranT:refactor/rename-openai-api-key

Conversation

@senthilkumaranT
Copy link

@senthilkumaranT senthilkumaranT commented Mar 9, 2026

Refactor: OpenAI API Key Naming Standard. "CHATGPT_API_KEY" (Issue #152)

Overview

This update standardizes the API key naming convention within the PageIndex framework. To align with industry standards and the official OpenAI environment variable naming, all instances of CHATGPT_API_KEY have been migrated to OPENAI_API_KEY.

🛠️ Changes

1. Source Code (pageindex/utils.py)

  • Variable Rename: Updated the global configuration constant from CHATGPT_API_KEY to OPENAI_API_KEY.
  • Environment Retrieval: Now fetches the key using os.getenv("OPENAI_API_KEY").
  • Function Defaults: Updated signature defaults for:
    • ChatGPT_API_with_finish_reason(...)
    • ChatGPT_API(...)
    • ChatGPT_API_async(...)

2. Documentation (README.md)

  • Setup Instructions: Updated the .env configuration example to guide users to use OPENAI_API_KEY for local setup.

How to Update

If you previously had a .env file, please update your variable name:

Old:

CHATGPT_API_KEY=sk-...

This PR renames the environment variable and internal constant CHATGPT_API_KEY to OPENAI_API_KEY across the codebase. This change aligns the project with standard OpenAI naming conventions and improves consistency in API key management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant