when
block of your gateway configurations to selectively apply rules for rate limiting, model fallbacks, load balancing, and more.X-TFY-METADATA
header. Here’s an example of how to log custom metadata:
Filtering requests using custom Metadata Keys
customer_id
key.
Grouping metrics by a custom 'customer_id' metadata key.
metadata
field inside a when
block to apply configurations only when certain metadata is present in the request.
Here are a few examples:
limit all requests to the gpt-4 model from the dev environment to 1000 requests per day
.
customer-id
or set up specific fallback models for a feature
.
Learn more in the Load Balancing and Fallback documentation.