# Uapi v4 is out

**URL:** <https://forum.openwrt.org/t/uapi-v4-is-out/255783>\
**Category:** Community Builds, Projects & Packages\
**Created:** [November 25, 2026, 8:53pm UTC](https://forum.openwrt.org/t/uapi-v4-is-out/255783 "2026-11-25T20:53:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raspbeguy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/raspbeguy/32/135696_2.png) [@raspbeguy](https://forum.openwrt.org/u/raspbeguy)\
**Post date:** [November 25, 2026, 8:53pm UTC](https://forum.openwrt.org/t/uapi-v4-is-out/255783/1 "2026-11-25T20:53:03Z")

</div>

Some time ago I introduced [uapi](https://forum.openwrt.org/t/uapi-an-http-api-as-control-plane-for-iac-infrastructure-as-code/253138), the control plane API I build primarily for use with Terraform.

Recently [I released v4](https://github.com/openwrt-iac/uapi/releases/tag/v4.0.1), which targets next OpenWrt major release. It is already working with current snapshot. This also means that it won't work on OpenWrt 25.12, which should use uapi 3.x.

Since my last post, in addition to the [Terraform provider](https://registry.terraform.io/providers/openwrt-iac/uapi/latest/docs/resources/wireless_interface), I introduced a new way to consume uapi: [uapi-mcp](https://github.com/openwrt-iac/uapi-mcp), which let your AI agent configure your router through the MCP protocol .

Finally I'm happy to announce that uapi 4.0.1 will be the first version to be added in the official OpenWrt packages repository. The [PR](https://github.com/openwrt/packages/pull/30752) is very close to be merged.

As before you're very welcome to test it, contribute or spread the word. Here is the repo: [https://github.com/openwrt-iac/uapi](https://github.com/openwrt-iac/uapi)

Thanks for your attention.

---

<div class="post-metadata">

**Author:** ![EnzoAlbornoz](https://forum.openwrt.org/user_avatar/forum.openwrt.org/enzoalbornoz/32/137092_2.png) [@EnzoAlbornoz](https://forum.openwrt.org/u/EnzoAlbornoz)\
**Post date:** [November 28, 2026, 7:10pm UTC](https://forum.openwrt.org/t/uapi-v4-is-out/255783/2 "2026-11-28T19:10:32Z")

</div>

Very promising project. Do you have a pattern/example for managing multiple devices with the Terraform provider?

---

<div class="post-metadata">

**Author:** ![raspbeguy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/raspbeguy/32/135696_2.png) [@raspbeguy](https://forum.openwrt.org/u/raspbeguy)\
**Post date:** [November 28, 2026, 8:33pm UTC](https://forum.openwrt.org/t/uapi-v4-is-out/255783/3 "2026-11-28T20:33:51Z")

</div>

Thanks! There is no example in the repo yet. This is designed so one declared provider manages one device. I guess you mean a case like a gateway plus a few APs with the same Wi-Fi, or a fleet of similar routers.

The pattern I would start with: a module that holds the shared config, with variables for what differs per device (hostname, addresses, channel), called once per device with its own provider instance and its own token.

If you want all devices in one configuration, it looks like this:

```hcl
provider "uapi" {
  alias = "gw"
  endpoint = "https://192.168.1.1/api/v4"
  token = var.gw_token
}

provider "uapi" {
  alias = "ap1"
  endpoint = "https://192.168.1.2/api/v4"
  token = var.ap1_token
}

module "gw" {
  source = "./device"
  providers = { uapi = uapi.gw }
  hostname = "gw"
}

module "ap1" {
  source = "./device"
  providers = { uapi = uapi.ap1 }
  hostname = "ap1"
}

```

Personally, I use one workspace per device instead: the same code, with the endpoint and the token of the device set as variables of its workspace in OTF. I do not need to deploy a config to thousands of devices, so I apply the workspaces one after the other.

---

<div class="post-metadata">

**Author:** ![raspbeguy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/raspbeguy/32/135696_2.png) [@raspbeguy](https://forum.openwrt.org/u/raspbeguy)\
**Post date:** [November 29, 2026, 9:44am UTC](https://forum.openwrt.org/t/uapi-v4-is-out/255783/4 "2026-11-29T09:44:07Z")

</div>

A short update since 4.0.

**4.1.0 at the start of December**

Since 4.0, I received a feature contribution, and I made a few changes of my own. They are all merged, and they will ship as 4.1.0 at the start of December:

- `dhcp/domains` models the local DNS records of dnsmasq, the Hostnames tab of LuCI.
- When a package install or removal fails, the response gives the output of apk.
- The diagnostics of uapi keep the cause of a failed reload.
- The output of commands and the messages of interpreter errors stay out of syslog and the diagnostics, because they can quote config values.
- uapi keeps only the end of a command output, so a noisy package script cannot fill the memory of the router.

**A minor every month**

From 4.1.0, a new minor ships on the first Monday of each month, when there is something new in it. A fix does not wait for it: it ships as a patch when it is ready.

**uapi in the next OpenWrt release**

The package PRs are still open, for openwrt/packages ([https://github.com/openwrt/packages/pull/30752](https://github.com/openwrt/packages/pull/30752)) and for openwrt/luci ([https://github.com/openwrt/luci/pull/9128](https://github.com/openwrt/luci/pull/9128)). If they merge in time, uapi will be in the next stable release of OpenWrt.

The release branches of OpenWrt take only bug and security fixes. So the minor of uapi that the package feed carries when OpenWrt cuts its branch is the one that this release ships. I will keep that minor on its own branch, with bug and security fixes, for as long as OpenWrt supports the release.

**Call for contributions**

A feature that you want in the next OpenWrt release must be in a minor before OpenWrt cuts its branch. I do not know that date yet. I will post it here when I know it. Until then, each monthly minor can take your feature.

If something that you need is missing, open an issue or a PR. For example:

- a resource that uapi does not model yet, or an option that a resource does not cover.
- a configuration that OpenWrt ships and that uapi refuses. This is still the error class I care about most.

`docs/adding-a-resource.md` tells how to add a resource, and `CONTRIBUTING.md` gives the rules for a PR.

> **[GitHub - openwrt-iac/uapi: Native HTTP REST API for OpenWrt, designed as the...](https://github.com/openwrt-iac/uapi)**
>
> Native HTTP REST API for OpenWrt, designed as the backend for a Terraform provider

Thanks for your attention.
