Integration Guides

Home Assistant with an OpenAI-Compatible API: Setup Options (2026)

ROIBest AI

Can Home Assistant use an OpenAI-compatible API?

Yes, but not through the integration most people try first. Home Assistant's built-in OpenAI integration only talks to OpenAI itself. Its documentation says it "works only with the official OpenAI API endpoint and does not support OpenAI-API-compatible third-party services, proxies, or alternative backends." There is no Base URL field to change.

To point Home Assistant's Assist at vLLM, LM Studio, llama.cpp, a gateway such as LiteLLM, or any other provider that speaks the OpenAI format, you have three working routes:

  1. A custom integration with a Base URL field: Extended OpenAI Conversation or Local LLM (home-llm), both installed through HACS.
  2. The built-in OpenRouter integration, if the models you want are on OpenRouter.
  3. The built-in Ollama integration, if your local models run on Ollama. It uses Ollama's own API rather than the OpenAI format, but it is the most direct path to a local model.

Everything below was checked on November 24, 2026 against the Home Assistant OpenAI docs, the OpenRouter and Ollama integration pages, and the source of Extended OpenAI Conversation and Local LLM.

Which route to pick

Your backend

Use

Built in?

Where to put the URL

Any OpenAI-compatible API (vLLM, LM Studio, llama.cpp server, LiteLLM, DeepSeek, a relay)

Extended OpenAI Conversation

No, HACS

Base URL, for example http://192.168.1.20:8000/v1

A local server, and you want small models tuned for home control

Local LLM (home-llm), "Generic OpenAI API" backend

No, HACS

Host, Port, SSL and API Path (v1) as separate fields

Models hosted on OpenRouter

OpenRouter integration

Yes, since 2025.8

No URL; just an OpenRouter API key

Models running on Ollama

Ollama integration

Yes, since 2024.4

URL, for example http://192.168.1.10:11434

OpenAI's own API

OpenAI integration

Yes

No URL; OpenAI key only

If you are unsure, start with Extended OpenAI Conversation: it accepts any server that implements /v1/chat/completions.

Option 1: Extended OpenAI Conversation (any compatible endpoint)

This custom component is derived from the built-in OpenAI integration and adds a Base URL option, plus function calling that lets the model call Home Assistant services, add automations and read entity history. Its latest release at the time of writing is 2.0.3 (October 2026).

  1. In HACS, add https://github.com/jekalmin/extended_openai_conversation as a custom repository (category: Integration) and install it, or copy the extended_openai_conversation folder into config/custom_components.
  2. Restart Home Assistant.
  3. Go to Settings > Devices & services > Add Integration and pick Extended OpenAI Conversation.
  4. Fill in the fields:
  • API Key: your provider's key. For a local server without auth, any placeholder works, and the integration also has a skip authentication option.
  • Base URL: the full base including /v1, such as http://192.168.1.20:8000/v1. The default is https://api.openai.com/v1.
  • API provider: leave on OpenAI unless you use Azure OpenAI.
  1. In the integration options, set the model to the exact ID your server returns from GET /v1/models.
  2. Go to Settings > Voice assistants, edit your assistant, and choose Extended OpenAI Conversation as the conversation agent.
  3. Expose the entities the model may control at Settings > Voice assistants > Expose.

The default model ID in the code is an OpenAI model, so change it; a server that does not host that model will return 404. If you are not sure what to put in the Base URL, our guide to the OpenAI-compatible base URL covers the /v1 rules.

Option 2: Local LLM (home-llm) with the Generic OpenAI backend

Local LLM is built for running Assist on your own hardware. It can run llama.cpp inside Home Assistant, or connect to an external server. For an OpenAI-compatible server, choose the Generic OpenAI API backend (Chat Completions). A Generic OpenAI Responses backend also exists for servers that implement the Responses API.

The connection is split into fields rather than one URL:

Field

What to enter

Host

IP or hostname of the server, such as 192.168.1.20

Port

The server's port, or empty for the default

SSL

On for HTTPS, off for plain HTTP (default off)

API Key

Only if your server requires one

API Path

The path prefix, normally v1

Two settings matter for slow hardware: Request Timeout defaults to 90 seconds and should go higher on low-power machines, and Max tokens defaults to 512. An "Advanced Options" section lets you add extra HTTP headers and extra request parameters such as reasoning_effort. The project also publishes small "Home" models fine-tuned for device control, which you can serve from your own OpenAI-compatible server.

Option 3: the built-in OpenRouter integration

Home Assistant added an OpenRouter integration in 2025.8, and the OpenAI integration's own docs point to it for non-OpenAI providers. It gives you conversation agents and AI tasks over every model on OpenRouter, billed by OpenRouter, and it supports bringing your own provider key. There is no base URL to set, so it does not help with a self-hosted server or a different relay. For how OpenRouter compares with running your own gateway, see OpenRouter vs LiteLLM.

Option 4: the built-in Ollama integration (local, native API)

If your models run on Ollama, the Ollama integration is the simplest local setup and needs no HACS. It talks to Ollama's native API, so you give it the server root, such as http://192.168.1.10:11434, not a /v1 URL. The API key field can stay empty if your Ollama server does not require one.

Useful defaults from the docs: the default model is qwen3:4b-instruct, the context window defaults to 8,192 tokens (minimum 2,048), and Home Assistant downloads a model to the Ollama server if it is not there yet. Only models that support tools can use Device control.

Device control needs tool calling

Whichever route you pick, Assist controls devices by sending the model a set of tools and expecting tool calls back. That puts requirements on the backend, not only on the integration:

  • Pick a model that supports tool calling. Ollama's library marks these with a "tools" tag; for other servers check the model card.
  • Turn tool calling on in the server. vLLM needs --enable-auto-tool-choice and a --tool-call-parser that matches the model, otherwise tool calls come back as plain text. llama.cpp server needs its Jinja chat templates, which are on by default in current builds.
  • Expose as few entities as possible. Every exposed entity goes into the prompt. Small local models make more mistakes with long entity lists, and the Ollama docs recommend exposing only what the assistant needs.
  • Remember sentence triggers run first. If one of your sentence triggers matches, it answers and the conversation agent never sees the sentence.

If chat works but device commands do nothing, or the reply contains raw JSON, tool calling is the problem, not the URL. Our article on OpenAI compatibility issues lists the other fields that differ between servers.

Networking: the most common failure

Home Assistant usually runs in a container or on Home Assistant OS, so localhost means Home Assistant itself, not the PC with the GPU.

  • Use the LAN IP of the model server, for example http://192.168.1.20:8000/v1.
  • Make the server listen on the network. Ollama binds to 127.0.0.1:11434 by default; set OLLAMA_HOST=0.0.0.0:11434 to accept LAN connections. vLLM and llama.cpp take --host 0.0.0.0.
  • Test from another machine before blaming Home Assistant:
curl http://192.168.1.20:8000/v1/models \
  -H "Authorization: Bearer $API_KEY"

A 200 listing your model means the URL and key are right. To keep an eye on the server afterwards, see OpenAI-compatible API health checks.

Privacy and cost

With a cloud provider, the model sees the state of every entity you expose, which can include presence and location; the Local LLM README warns about exactly this. A local server keeps that data at home. Cloud providers also bill every Assist request, and the device list is sent each time, so a large home can use more tokens per request than you expect. Set a spending limit on the provider side.

FAQ

Does the Home Assistant OpenAI integration support a custom base URL?

No. The official docs say it works only with OpenAI's own endpoint. Use Extended OpenAI Conversation or Local LLM for other OpenAI-compatible servers, or the OpenRouter integration for OpenRouter models.

How do I use LM Studio or vLLM with Home Assistant?

Run the server on a machine on your network, listening on its LAN address, then add Extended OpenAI Conversation with Base URL http://<server-ip>:<port>/v1, or Local LLM with the Generic OpenAI API backend.

Why can't Home Assistant reach my local model at localhost?

Inside a container or Home Assistant OS, localhost refers to Home Assistant itself. Use the model server's LAN IP and make sure the server listens on 0.0.0.0 rather than 127.0.0.1.

Why does the assistant chat but not control devices?

The model or server is not returning tool calls. Use a tool-capable model, enable tool calling on the server, and expose the entities you want it to control.

Is OpenRouter or a local model better for Home Assistant?

OpenRouter gives you large models with no hardware, but every request is billed and leaves your network. A local model keeps data at home and has no per-request cost, at the price of hardware and more errors from smaller models.

The short version

The built-in OpenAI integration cannot use a custom endpoint. For any OpenAI-compatible server, install Extended OpenAI Conversation and set the Base URL, or use Local LLM's Generic OpenAI backend. For hosted models use the built-in OpenRouter integration, and for Ollama use the built-in Ollama integration. Then make sure the model supports tool calling and the server is reachable on your LAN, not on localhost.