OpenAI community integration, free and open source

Run the Gladys assistant on OpenAI GPT models with your own OpenAI API key.
Overview
This integration runs the assistant of Gladys on the GPT models of OpenAI, through the official OpenAI API (Responses API) and your own API key. Once you choose it in Settings → Artificial Intelligence, every AI request of Gladys goes to OpenAI: the chat and the devices it controls, the scenes it creates, the "ask the AI" scene action and the weekly digest. It works without a Gladys Plus account: you pay OpenAI directly, per use.
It also adds two scene triggers (the assistant fails, the assistant answers again) and a dashboard widget of your consumption.
Not affiliated with OpenAI. Not tested with a real OpenAI key yet: feedback welcome.
Prerequisites
- Gladys Assistant 5.3.0 or later.
- An account on the OpenAI platform with prepaid credits (Billing), and an API key: API keys, Create new secret key (a project key is enough).
- Costs: billed per token. With the default models, a chat turn costs a fraction of a cent; the reasoning tokens count as output. Set a monthly budget and spend limits in Limits: the integration then stops cleanly when they are reached.
- Your data: OpenAI does not train its models on API data unless you opt in. The integration sends every request with storage off (
store: false), but OpenAI keeps abuse monitoring logs for up to 30 days. - What leaves your home: every chat message, the history, the tools Gladys offers and their results (the state of the devices the model reads) and the chat images go to OpenAI over HTTPS. The answers control your devices and create scenes.
Configuration
| Field or button | Default | Meaning |
|---|---|---|
| OpenAI API key | — | Required. Never shown again, never logged |
| Chat model | GPT-6.1 Terra | Answers the chat, creates scenes, writes the weekly digest |
| Router model | GPT-6 Luna | Sorts every message before the answer and must reply within 20 seconds |
| Other model id | — | Only when a model is set to "Other model": the exact API id (it must call tools in Responses) |
| Reasoning of the chat model | Low | More reasoning, better scenes, slower and costlier answers |
| Maximum answer length (tokens) | 16000 | Reasoning included; OpenAI advises 25000 to try high reasoning |
| Test the connection | — | One short answer from each model with its time; spends a few tokens |
The status of the configuration screen says whether OpenAI accepts the key and both models, without spending a token. Reading a model does not prove that the project can pay (no credit left, spend limit): Test the connection does.
Usage
- Integrations → OpenAI → Configuration: paste the API key, keep the default models, press Test the connection.
- Settings → Artificial Intelligence: choose OpenAI.
- Talk to Gladys in the chat: "turn on the living room", "what is the temperature in the bedroom?", "create a scene that closes the shutters at sunset".
Choosing the models
Prices per million tokens, input / output, on 5 November 2026:
- GPT-6.1 Terra (default for the chat, $1 / $5): fast, good at calling tools and at clear writing.
- GPT-6.1 Sol ($2 / $10): close to Astra for complex requests.
- GPT-6 Astra ($10 / $50): the most capable, for long scene descriptions.
- GPT-6 Luna (default router, $0.10 / $0.50): the fastest and cheapest; less reliable to create scenes.
- GPT-5.6 Terra and GPT-5.6 Luna: the previous generation, still supported.
- Other model: a newer model or a dated snapshot. If it refuses the reasoning effort, the integration sends it without from then on.
GPT-6.1 Sol and GPT-6 Astra cannot turn reasoning off: None becomes low for them. The router always uses the least reasoning its model accepts.
Dashboard widget
The OpenAI usage widget shows the requests and tokens of the day, the tokens of the month, the errors of the day, the tokens per day over 30 days, whether OpenAI answers, the last request and the last error. It counts what Gladys asked, reasoning included; the Usage page of the OpenAI platform stays the reference for the bill.

Scenes
- Trigger "OpenAI: the assistant fails": once per failure (key refused, credits or spend limit, rate limit, model unavailable, API unreachable, too slow, OpenAI error), with the kind, the message, the request and the model.
- Trigger "OpenAI: the assistant answers again": the first answer after a failure, with the minutes of failure.
Examples: when the assistant fails because of credits or the spend limit, send a Telegram message to the administrator; when it answers again, send another one with the minutes of failure.
There is no web search action: OpenAI requires web results to be shown with their sources as prominent, clickable links, which a scene notification cannot guarantee.
Troubleshooting
- "OpenAI refused the API key": copy the key again from the API keys page; a revoked key gives the same message. The same message appears when Gladys runs in a country OpenAI does not serve.
- "OpenAI refuses to run …: no credit left or spend limit reached": add credits in Billing, or raise the budget in Limits. Waiting does not help: the integration does not retry.
- "Rate limit reached": the limits depend on the usage tier of the account and rise as you spend. A chat turn makes at least two requests.
- "… is not available to this API key": the model does not exist, was shut down, or the project has no access to it; choose another one.
- The chat answers without doing anything: try GPT-6.1 Terra or 6.1 Sol with low or medium reasoning; GPT-6 Luna is less reliable with many tools.
- "The answer was cut at max_tokens": raise the maximum answer length, or lower the reasoning.
- "… refused to answer" or "content_filter": OpenAI's safety systems blocked the request or the answer; rephrase it.
- Logs: Settings → Supervision, the logs of the integration. Never share your API key.
Configuration settings
These are the settings OpenAI asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Getting started | section | No | The assistant answers through the OpenAI API, billed per use on your OpenAI account (prepaid credits): create an API key on platform.openai.com, paste it below, then select this integration in Settings, Artificial Intelligence. OpenAI then sees every chat message, the history, the state of the devices it reads and the chat images. |
| Costs and privacy | section | No | OpenAI does not train its models on API data unless you opt in. Requests are sent with store off, but OpenAI keeps abuse monitoring logs for up to 30 days. Every chat message also runs the router: set a monthly budget and spend limits in the Limits page of the platform. |
| OpenAI API key | secret | Yes | Created on platform.openai.com, in API keys (a project key is enough). It stays in Gladys and is never shown again nor logged. |
| Chat model | select | Yes | Answers the chat, creates the scenes and writes the weekly digest. 6.1 Terra balances quality and cost; 6.1 Sol and 6 Astra are stronger but cost 2 and 10 times more; 6 Luna is the cheapest but less reliable to create scenes. |
| Router model | select | Yes | Sorts every chat message before the answer, and must reply within 20 seconds: a small, fast model fits best. |
| Other model id | string | No | Only for “Other model”: the exact API id of an OpenAI model (a newer model, a dated snapshot…). It must call functions through the Responses API. |
| Reasoning of the chat model | select | Yes | More reasoning gives better scenes but slower, costlier answers. 6.1 Sol and 6 Astra cannot turn it off: “None” becomes low for them. |
| Maximum answer length (tokens) | number | No | The reasoning counts in it too. Raise it if the logs say an answer hit max_tokens; OpenAI advises 25000 to experiment with high reasoning. |
How to install OpenAI in Gladys
- In Gladys, open Integrations: OpenAI appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/william-de71/gladys-openai:0.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/William-De71/gladys-openai.
OpenAI requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
OpenAI is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by William-De71, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation