For AI agents: the complete documentation index is at llms.txt. Remove the trailing slash from a page URL and append .md to read its Markdown version. For the docs home, use index.md.

OpenAI Integration

The OpenAI Integration allows your app to use OpenAI APIs for features such as text generation, embeddings, and other AI-powered functionality.

Step 1: Obtain an OpenAI API Key

  1. Go to the OpenAI Platform.
  2. Open the API keys page in your organization settings.
  3. Click Create new secret key.
  4. Copy the generated key.
    • Example: sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Step 2: Configure the Integration in Your App

  1. In Reflex Build, open the Integrations tab and select the OpenAI card.
  2. Click Add connection and paste your API key into OPENAI_API_KEY.
  3. Click Connect to save the connection.

Leave OPENAI_BASE_URL at its default (https://api.openai.com/v1) unless you send requests through a proxy or gateway.

Step 3: Notes

  • Keep your OpenAI key secure; do not hardcode it in public code repositories.
  • Use environment-specific secrets if you have separate development, staging, and production environments.
  • The key allows your app to interact with OpenAI endpoints securely and efficiently.