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
- Go to the OpenAI Platform.
- Open the API keys page in your organization settings.
- Click Create new secret key.
- Copy the generated key.
- Example:
sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Step 2: Configure the Integration in Your App
- In Reflex Build, open the Integrations tab and select the OpenAI card.
- Click Add connection and paste your API key into OPENAI_API_KEY.
- 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.