Give dhcp leace from subnet based on ssid

I have several AP's on different channels with the same private and guest SSID's. A sort of mesh network so to speak.

OpenWRT is the only DHCP server

I'd like to give devices that are coming in via the guest SSID an ip address that resides in a different subnet as to be able to be sure that access is only allow to WAN.

is that possible

Of course it is.
In the guest interface you can set independent lease time from the lan interface.

Thx for the suggestion! Will this also work when the device is using a AP other than the openwrt one? Openwrt is only dhcp and firewall, gateway

As long as you create the necessary vlans for guest and lan and propagate them to all connected devices, it is possible to have all your private and guest networks on all the devices.