You could use route guards I suppose:
post "/resource/:api_key" when api_key == @api_key, Controller, :dostuff
Sugar is still really alpha, so I don't know if it supports middleware yet or not. You might be better off using Plug directly until Sugar stabilizes.