Use the custom logging endpoint to log any operation to Helicone - database queries, API calls, ML inference, or any other operation you want to track.
Example#
Understanding the Structure#
All custom logs have three main parts:
1. Provider Request#
What you're about to do. Must include:
url: "custom-model-nopath"- Required for custom logsjson._type: "data"- Identifies this as a custom data logjson.name- A descriptive name for your operation- Any custom fields you want to track (query, endpoint, model, etc.)
2. Provider Response#
What happened. Should include:
json._type: "data"- Identifies this as a custom data responsejson.name- Same name as the requestjson.status- Success or error statestatus- HTTP status code (typically 200)- Any result data you want to track
3. Timing#
When it happened:
startTime- When the operation began (Unix epoch)endTime- When the operation completed (Unix epoch)
Examples#
Database Query#
External API Call#
ML Model Inference#
API Reference#
Endpoint#
Note: The endpoint may vary depending on your Helicone setup:
- US:
https://api.us.helicone.ai/custom/v1/log - Elsewhere:
https://api.helicone.ai/custom/v1/log
Headers#
| Name | Value |
|---|---|
| Authorization | Bearer {API_KEY} |
| Content-Type | application/json |
