Generate data in API route header

Hello! I would like to use a custom API route to send a mock header back. This header (two actually) contains a “rate limit” remaining count. I tried to use the code below in my API route, but it caused a 500 error when hitting the mockaroo API route URL:

schema "docket"
header("X-RateLimit-Limit", "1000")
header("X-RateLimit-Remaining", rand(100..999).to_s)
generate 1

I also tried with the mockaroo version: random(100,999) but no luck. I assume this is just a not-yet-implemented feature… but does anyone have a workaround?