Metadata
This feature is available on all Portkey plans.
You can send custom metadata along with your requests in Portkey, which can later be used for auditing or filtering logs. You can pass any number of keys, all values should be of type string
with max-length as 128 characters.
Adding Metadata to Requests
The metadata object accepts a JSON - Portkey will then parse it and let you filter on your metadata.
_user is a special key
This key is used to provide user analytics in the analytics section of Portkey app.
If you pass the user
key in the OpenAI request body, we will automatically also store it in Portkey’s _user
key. If both the OpenAI request body user
key and the Portkey metadata _user
key are passed, then only the metadata _user
key will be stored.
Send metadata along with your requests as shown below:
Using Metadata
See metadata summary on the Analytics page:
Just head over to the metadata tab and you should see all of your keys in the filter.
Filter requests according to your custom metadata on the Logs page
Select the “Meta” filter and choose the key:value pairs you want to filter the requests on. All the custom keys you have sent with any of your requests should show up here.