PromptLayer allows you to attach multiple key value pairs as metadata to a request. In the dashboard, you can look up requests and analyze analytics using metadata.

We recommend using this for things like session IDs, user IDs, or error messages. Metadata is useful to help you use the advanced search or understand the Analytics page.

Endpoint Reference

Things to note:

  1. Currently keys and values need to be strings in PromptLayer.
  2. If you track a key that was already tracked before for a specific request_id, the value that corresponds to that key will be replaced.

Once metadata is added, you will then be able to see it in the web UI.

score

Please note that while metadata is optimized for storing unique, request-specific data such as user IDs or session IDs, it might not be the best choice for categorizing requests when you have a small set of predefined categories. For categorization based on a small number of predefined options, please use tags instead.