Events
Datapoints
Datasets
Projects
Experiments
Create a batch of model events
Please refer to our instrumentation guide for detailed information
curl --request POST \
--url https://api.honeyhive.ai/events/model/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_events": [
{
"project": "New Project",
"model": "gpt-4o",
"provider": "openai",
"messages": [
{
"role": "system",
"content": "Hello, world!"
}
],
"response": {
"role": "assistant",
"content": "Hello, world!"
},
"duration": 42,
"usage": {
"prompt_tokens": 10,
"completion_tokens": 10,
"total_tokens": 20
},
"cost": 0.00008,
"error": null,
"source": "playground",
"event_name": "Model Completion",
"hyperparameters": {
"temperature": 0,
"top_p": 1,
"max_tokens": 1000,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"n": 1
},
"template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
],
"template_inputs": {
"name": "world"
},
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"format": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
],
"description": "The temperature unit to use. Infer this from the users location."
}
},
"required": [
"location",
"format"
]
}
}
],
"tool_choice": "none",
"response_format": {
"type": "text"
}
}
],
"is_single_session": true,
"session_properties": {
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}'
{
"event_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
"7f22137a-6911-4ed3-bc36-110f1dde6b67"
],
"success": true
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Project associated with the event
Model name
Model provider
Messages passed to the model
Final output JSON of the event
How long the event took in milliseconds
Usage statistics of the model
Cost of the model completion
Any error description if event failed
Source of the event - production, staging, etc
Name of the event
Hyperparameters used for the model
Template used for the model
Inputs for the template
Tools used for the model
Tool choice for the model
Response format for the model
Default is false. If true, all events will be associated with the same session
Name of the session
Source of the session - production, staging, etc
Unique id of the session, if not set, it will be auto-generated
Associated configuration for the session
Input object passed to the session - user query, text blob, etc
Final output of the session - completion, chunks, etc
Any error description if session failed
Any user properties associated with the session
Any values computed over the output of the session
Any user feedback provided for the session output
Any system or application metadata associated with the session
{
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
Was this page helpful?
curl --request POST \
--url https://api.honeyhive.ai/events/model/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_events": [
{
"project": "New Project",
"model": "gpt-4o",
"provider": "openai",
"messages": [
{
"role": "system",
"content": "Hello, world!"
}
],
"response": {
"role": "assistant",
"content": "Hello, world!"
},
"duration": 42,
"usage": {
"prompt_tokens": 10,
"completion_tokens": 10,
"total_tokens": 20
},
"cost": 0.00008,
"error": null,
"source": "playground",
"event_name": "Model Completion",
"hyperparameters": {
"temperature": 0,
"top_p": 1,
"max_tokens": 1000,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"n": 1
},
"template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
],
"template_inputs": {
"name": "world"
},
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"format": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
],
"description": "The temperature unit to use. Infer this from the users location."
}
},
"required": [
"location",
"format"
]
}
}
],
"tool_choice": "none",
"response_format": {
"type": "text"
}
}
],
"is_single_session": true,
"session_properties": {
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}'
{
"event_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
"7f22137a-6911-4ed3-bc36-110f1dde6b67"
],
"success": true
}