POST
/
events
/
model
/
batch
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model_events
object[]
is_single_session
boolean

Default is false. If true, all events will be associated with the same session

session_properties
object
Example:
{
  "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"
  }
}

Response

200
application/json
Model events created
event_ids
string[]
success
boolean