OpenAI Chat

Managed auth required

Direct GPT-4o and GPT-4 access

BotChap connects your website chat widget to OpenAI Chat Completions via the BotChap server-side proxy. Your OpenAI API key is stored encrypted on the server — it is never exposed to the browser or to website visitors.

This integration requires Managed auth mode. Your OpenAI API key is stored on the BotChap server and is never sent to the browser.
Message history is maintained per browser session. Set Message History Depth in the editor to control how many turns the model sees.

Why use this integration

Use this integration when you want direct OpenAI model access with a branded chat widget. Ideal for FAQ bots, support assistants, and any use case where OpenAI Chat Completions is already your chosen backend.

How it works

  1. 1
    Visitor sends a message in the BotChap widget
  2. 2
    BotChap widget sends the message to the BotChap server proxy
  3. 3
    The server calls OpenAI /v1/chat/completions with your stored API key
  4. 4
    OpenAI returns the assistant reply
  5. 5
    BotChap displays the reply in the chat window

Required fields

OpenAI API Key
Stored encrypted on the BotChap server. Never sent to the browser.
Model
Any OpenAI chat model (gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, etc.).
System Prompt
Instructions for the assistant — defines its persona, scope, and behavior.
Temperature (optional)
Controls response randomness. Default is 0.7.
Max Tokens (optional)
Maximum length of each assistant reply.
Message History Depth (optional)
How many previous turns to include for context (1–20). Default is 10.

What BotChap sends

BotChap's server proxy builds this Chat Completions request:

{
  "model": "<your configured model>",
  "messages": [
    { "role": "system",    "content": "<your system prompt>" },
    { "role": "user",      "content": "<previous turn>" },
    { "role": "assistant", "content": "<previous reply>" },
    { "role": "user",      "content": "<current visitor message>" }
  ],
  "temperature": <your setting>,
  "max_tokens":  <your setting>
}

Sample request

POST https://api.openai.com/v1/chat/completions
Authorization: Bearer <your-key-on-server>

{
  "model": "gpt-4o",
  "messages": [
    { "role": "system", "content": "You are a helpful support agent." },
    { "role": "user",   "content": "What integrations do you support?" }
  ],
  "temperature": 0.7
}

Sample response

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "We support n8n, Flowise, Dify, LangChain, Voiceflow, and more."
    }
  }]
}

Best use cases

  • FAQ and knowledge base assistants
  • Lead qualification with GPT-4o
  • Customer support bots
  • Onboarding and intake flows
  • Product guidance and comparison

Frequently asked questions

Is my OpenAI API key safe?
Yes. BotChap stores it encrypted on the server. The browser widget only talks to the BotChap proxy — it never sees your key.
Which models are supported?
Any model available via OpenAI Chat Completions: gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, and others.
Does message history persist across page reloads?
History is maintained per browser session. Reloading the page starts a new session and a fresh conversation.
Can I use function calling or tool use?
Not via the BotChap editor. For advanced function calling, use the n8n or Custom REST integration and handle the OpenAI call server-side.

Related integrations

Ready to connect OpenAI Chat to BotChap?

Create a free widget, configure the integration, and embed it on your site in minutes.

View all integrations