If you'd like to report data from a platform not supported by our SDKs, this page is for you.
The HTTP integration allows you to report data to the Lunary API endpoint.
This is useful if you want to integrate Lunary with a custom language where our SDKs are not available.
The endpoint accepts POST requests with a JSON body containing an array of Event objects.
You need to pass your Project tracking ID (public key) as the Bearer token in the Authorization header.
Here is an example with cURL to send a POST request to the API endpoint:
Once your LLM call succeeds, you would need to send an
end event to the API endpoint with the
output data from the LLM call.
Input / output format
You can use any valid JSON for the input & output fields. However, for LLM calls you should use the OpenAI chat message format:
Tracking LLM calls options data.
You can report extra LLM data such as
tools, etc. in the
Example of tracking an LLM's data with a
The Event object has the following properties:
|The type of the event. Can be one of "llm", "agent", "tool", "chain", "chat", "thread".
|The name of the event. Can be one of "start", "end, "error", "feedback",
|The ID of the run (UUID recommended)
|The ID of the parent run, if any.
|Timestamp in ISO 8601 format.
|Array of tags.
|The name of the current model, agent, tool, etc.
|Input data (with
|Output data (with
|Extra data associated with the run.
|Feedback data associated with the run (only when
type = 'feedback')
|An object containing the number of prompt and completion tokens used (only for
|An object containing the error message and stack trace if an error occurred.
tokensUsage object has the following properties:
|The number of prompt tokens used.
|The number of completion tokens used.
tokensUsage is not provided, the number of tokens used will be calculated from the input and output fields. This works best with models from OpenAI, Anthropic and Google at the moment.
The error object has the following properties:
|The error message.
|The stack trace of the error.
feedback field, refer to the Feedback page for more information.