How to redirect api requests to another endpoint in cloudflare pages?

We have API somewhere outside Cloudflare that we need to access out of Cloudflare page previews.

On Netlify we have such redirects in netlify.toml

  from = "/api/*"
  to = ""
  status = 200

but on Cloudflare, it does not work because «Proxying will only support relative URLs on your site. You cannot proxy external domains.»

How it can be achieved on Cloudflare?