---
url: /integrations/openai.md
---
# OpenAI

OpenAI powers the [editor AI](/panel/editor-ai) in the panel and, by default, the [AI chatbot](/modules/ai-chatbot) on the site. Both read the same key.

## What you need

An API key from an OpenAI project at platform.openai.com. Create a project per client so that usage and billing stay separate, and copy the key once; OpenAI shows it only at creation.

## Keys

| Variable | Used by | Notes |
|---|---|---|
| `OPENAI_API_KEY` | editor AI, chatbot | Editable in the panel's Settings screen as a secret. |
| `OPENAI_MODEL` | editor AI | Default `gpt-5.2`. The chatbot's model is set through `laravel/ai`, see below. |
| `OPENAI_ORGANIZATION`, `OPENAI_PROJECT` | editor AI | Only when the key belongs to an organisation with several projects. |

The editor AI goes through `config/llm.php` (publish tag `evolve.llm`). The chatbot goes through `laravel/ai`, whose own `config/ai.php` names the default provider and model; publish it in the project to change either. Both default to OpenAI.

## Verifying

Run an editor command on any rich text field. For the chatbot, ask a question on the site. Either path reports provider errors in the application log with OpenAI's response body, which names the cause: an invalid key, a project without access to the model, or a billing limit.

## Cost control

The editor AI sends the selected text, the page generator the brief plus the current and reference page content, the page report the whole page once a day at most, and the chatbot the site context (pages, FAQs, recent posts) with every question. On a large site the chatbot's context is the biggest token consumer; `CHATBOT_CONTEXT_CACHE` only saves the rebuilding, not the sending. Set a monthly budget on the OpenAI project.
