A terahertz device for detecting or emitting or for both detecting and emitting electromagnetic waves in the terahertz frequency range. The terahertz device comprises: a first waveguide branch and a second waveguide branch, the first and second waveguide branches being configured to allow optical signals to propagate through them, the first and second waveguide branches being nonlinear dielectric elements with a thickness of at most 500 micrometres; and an antenna arrangement comprising a set of antennas for capturing and/or emitting electromagnetic waves in the terahertz frequency range, the antennas being placed along at least one of the waveguide branches in an immediate vicinity of the respective waveguide branch and/or around the respective waveguide branch to at least partially enclose the respective waveguide branch in a respective antenna gap of the respective antenna.