Custom Properties
Add custom metadata to LLM requests for advanced segmentation and analysis. Tag requests with session IDs, conversation context, or application data to gain deeper insights into your AI application performance.
Introduction
Custom Properties allow you to add any additional information to your requests, such as:
- The
session
,conversation
, orapp
id - The
prompt chain
by adding a common value to group of requests Application
oruser
metadata making the request
Custom Properties appear as headers in the `Request` table.
Why Custom Properties
- Get the total cost or latency for a group of requests in a prompt chain
- Get the “unit economics” of your application. For example, the average cost of a conversation.
- Slice and dice your requests and metrics by any custom property.
Quick Start
Adding Custom Properties at Request Time
Use headers to add Custom Properties to your LLM requests.
Define the Header
Name your header in the format Helicone-Property-[Name]
where Name
is the name of your custom property.
Define the Value
The value is a string that labels your request for this custom property. Here are some examples:
Special Case: Helicone-User-Id
While most custom properties can be defined freely, Helicone-User-Id
is a reserved header for attributing requests to individual users. It enables per-user metrics such as request volume, cost, and behavior, visible in the Users tab of your dashboard.
Refer to User Metrics Documentation for implementation details.
Updating Custom Properties After Request
You can also update Custom Properties post-request submission by making a PUT request to a designated API endpoint.
Obtain the Request ID
Option 1: Pre-define the Request ID
Option 1: Pre-define the Request ID
You can pre-define the Request ID and assign to the header Helicone-Request-Id
. This approach allows you to control the request ID yourself, to meet certain requirements or follow a specific format.
Refer to Request ID Predefinition for additional documentation.
Option 2: Get the Request ID From the Response Header
Option 2: Get the Request ID From the Response Header
Alternatively, you can retrieve your Request ID from the response header helicone-id
. Depending on the client library, the method to extract the Request ID may be different.
Make a PUT Request
Here are the code snippets on how to make a PUT request:
PUT Request API
Check out the detailed documentation.
Need more help?
Need more help?
Additional questions or feedback? Reach out to help@helicone.ai or schedule a call with us.