The effect of terahertz (THz) pulse generation has revolutionized
broadband coherent spectroscopy and imaging at THz frequencies. However,
THz pulses typically lack spatial structure, whereas structured beams
are becoming essential for advanced spectroscopy applications. Nonlinear
optical metasurfaces with nanoscale THz emitters can provide a solution
by defining the beam structure at the generation stage. We develop
a nonlinear InAs metasurface consisting of nanoscale optical resonators
for simultaneous generation and structuring of THz beams. We find
that THz pulse generation in the resonators is governed by optical
rectification. It is more efficient than in ZnTe crystals, and it
allows us to control the pulse polarity and amplitude, offering a
platform for realizing binary-phase THz metasurfaces. To illustrate
this capability, we demonstrate an InAs metalens, which simultaneously
generates and focuses THz pulses. The control of spatiotemporal structure
using nanoscale emitters opens doors for THz beam engineering and
advanced spectroscopy and imaging applications.