Skip to main content

OpenAI Integration

This guide provides detailed instructions for integrating OpenAI with NudgeBee's LLM Server and RAG Server applications.

Overview​

OpenAI provides REST API access to powerful language models including GPT-5, GPT-4o, GPT-4, GPT-3.5-Turbo, and Embeddings models. These models are widely used for natural language understanding, generation, and embedding tasks. NudgeBee supports both native OpenAI API and OpenAI-compatible endpoints.

Prerequisites​

  • OpenAI account with API access
  • OpenAI API key with appropriate permissions
  • Billing configured for your OpenAI account (for paid models)

Setting up OpenAI Credentials​

  1. Create an OpenAI Account:

    • Visit OpenAI Platform
    • Sign up or log in to your account
    • Complete account verification if required
  2. Configure Billing (if using paid models):

  3. Generate API Key:

    • Navigate to API Keys
    • Click "Create new secret key"
    • Provide a descriptive name for the key
    • Copy the API key (it will only be shown once)
    • Store the key securely

Integrating with LLM Server​

  1. Configure OpenAI in LLM Server:

    Add the following configuration to your LLM Server settings:

LLM_PROVIDER=openai
LLM_MODEL_NAME=<Model name> # e.g., "gpt-5", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo"
LLM_PROVIDER_API_KEY=<Your OpenAI API key>
LLM_PROVIDER_API_ENDPOINT=<Custom endpoint URL> # Optional, for OpenAI-compatible endpoints
LLM_PROVIDER_API_TYPE=openai # Optional, defaults to "openai"

Available Models​

  • GPT-5 Series: gpt-5, gpt-5-turbo, gpt-5-preview
  • GPT-4o Series: gpt-4o, gpt-4o-mini, gpt-4o-2024-11-20, gpt-4o-2024-08-06
  • GPT-4 Turbo: gpt-4-turbo, gpt-4-turbo-2024-04-09, gpt-4-turbo-preview
  • GPT-4: gpt-4, gpt-4-32k, gpt-4-0613
  • GPT-3.5 Turbo: gpt-3.5-turbo, gpt-3.5-turbo-16k

Add it in NudgeBee (UI)​

In Admin → Integrations → LLM → Add LLM Provider, choose openai and enter the LLM Model Name and API Key. For OpenRouter, vLLM, Ollama and other OpenAI-compatible services, choose custom instead — see Add an LLM Provider.

Integrating with RAG Server​

  1. Configure OpenAI in RAG Server:

    Add the following configuration to your RAG Server settings:

EMBEDDINGS_PROVIDER=openai
EMBEDDINGS_MODEL_NAME=<Embedding model name> # e.g., "text-embedding-3-small"
EMBEDDINGS_PROVIDER_API_KEY=<Your OpenAI API key>
EMBEDDINGS_PROVIDER_API_VERSION=<API version> # required for the openai embeddings provider
EMBEDDINGS_PROVIDER_API_TYPE=openai # Optional
# Custom endpoints aren't supported for OpenAI embeddings

Available Embedding Models​

  • text-embedding-ada-002 - Legacy model (1,536 dimensions)
  • text-embedding-3-small - Smaller, faster model (1,536 dimensions)
  • text-embedding-3-large - Higher quality model (3,072 dimensions)

Rate Limits and Quotas​

OpenAI API has rate limits based on your account tier:

  • Free Tier: Limited requests per minute (RPM) and tokens per minute (TPM)
  • Tier 1-5: Progressively higher limits based on usage and payment history
  • Rate limits vary by model (GPT-4 typically has lower limits than GPT-3.5)

To view your current rate limits:

  • Go to Rate Limits
  • Check your tier and limits for each model
  • Usage is automatically tracked and displayed in your dashboard

For higher rate limits, increase your usage tier by:

  • Making consistent API usage
  • Maintaining payment history
  • Contacting OpenAI support for enterprise needs

Troubleshooting OpenAI Integration​

1. 429 RateLimitError / Insufficient Quota​

  • Symptom: NuBi chat returns 429 You exceeded your current quota, please check your plan and billing details.
  • Root Causes:
    • Prepaid credit balance exhausted in OpenAI Platform.
    • Tokens-per-minute (TPM) limit exceeded during bulk log analysis or large incident investigation.
  • Remediation:
    1. Open OpenAI Billing Overview and ensure account has positive prepaid balance.
    2. Switch to a higher throughput model variant (e.g. gpt-4o-mini) or request a Tier upgrade for higher TPM limits.

2. 401 Invalid Authentication / Key Revoked​

  • Symptom: Connection test returns 401 Incorrect API key provided.
  • Remediation: Verify the API key starts with sk-proj- or sk- and does not contain leading/trailing whitespace.

3. 404 Model Not Found​

  • Symptom: NuBi fails with The model 'gpt-5' does not exist or you do not have access to it.
  • Remediation: Ensure the model specified in LLM_MODEL_NAME is available in your OpenAI account tier (e.g. use gpt-4o or gpt-4-turbo).