> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a batch of model events (deprecated)

> Deprecated. Use `POST /v1/events/batch` with `event_type="model"` on each event instead. Migration notes: the top-level array `model_events` becomes `events`; each element must explicitly set `event_type: "model"` (the legacy route sets this server-side); the deprecated top-level aliases `is_single_session` and `session` are not accepted by the v1 route (`PostEventBatchRequest` is `.strict()`); use `single_session` and `session_properties` instead. The legacy route continues to serve traffic and remaps the model-specific fields on each event (`model`, `messages`, `response`, `provider`, `usage`, `cost`, `hyperparameters`, `template`, `template_inputs`, `tools`, `tool_choice`, `response_format`, `duration`, `error`) into `inputs.*` / `outputs.*` before storage.




## OpenAPI

````yaml https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/openapi.yaml post /events/model/batch
openapi: 3.1.0
info:
  title: HoneyHive Data Plane API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.2.1
servers:
  - url: https://api.honeyhive.ai
security:
  - BearerAuth: []
tags:
  - name: Charts
    description: >
      Define and manage saved charts. Charts are visualizations that aggregate
      metrics over time with bucketing, filters, and groupings.
  - name: Configurations
    description: >
      Manage prompt configurations, i.e. model parameters, message templates,
      and response settings that can be versioned and deployed without code
      changes.
  - name: Datapoints
    description: >
      Manage individual records inside datasets, including batch creation and
      mapping to source events.
  - name: Datasets
    description: >
      Curate collections of datapoints used as test sets for evaluations and
      experiments.
  - name: Events
    description: >
      Read and write trace events. Events are the spans that capture every step
      of an AI application's execution.
  - name: Experiments
    description: >
      Run, retrieve, and compare evaluation runs to measure how prompt or
      configuration changes affect agent performance.
  - name: Metric Versions
    description: >
      Snapshot, list, and deploy versions of a metric's definition so changes
      can be reviewed and rolled back without losing history.
  - name: Metrics
    description: >
      Define and run evaluators, i.e. automated quality checks that score traces
      against criteria like accuracy, safety, or correctness.
  - name: Queues
    description: >
      Manage annotation queues for human review of traces, turning expert
      feedback into labeled datasets.
  - name: Sessions
    description: >
      Group related trace events into sessions, the top-level container for a
      multi-step or multi-service AI interaction.
paths:
  /events/model/batch:
    post:
      tags:
        - Events
      summary: Create a batch of model events (deprecated)
      description: >
        Deprecated. Use `POST /v1/events/batch` with `event_type="model"` on
        each event instead. Migration notes: the top-level array `model_events`
        becomes `events`; each element must explicitly set `event_type: "model"`
        (the legacy route sets this server-side); the deprecated top-level
        aliases `is_single_session` and `session` are not accepted by the v1
        route (`PostEventBatchRequest` is `.strict()`); use `single_session` and
        `session_properties` instead. The legacy route continues to serve
        traffic and remaps the model-specific fields on each event (`model`,
        `messages`, `response`, `provider`, `usage`, `cost`, `hyperparameters`,
        `template`, `template_inputs`, `tools`, `tool_choice`,
        `response_format`, `duration`, `error`) into `inputs.*` / `outputs.*`
        before storage.
      operationId: createModelEventBatchLegacy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostModelEventBatchRequest'
      responses:
        '200':
          description: Model events created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostEventBatchResponse'
              example:
                event_ids:
                  - 7f22137a-6911-4ed3-bc36-110f1dde6b66
                  - 7f22137a-6911-4ed3-bc36-110f1dde6b67
                success: true
        '500':
          description: Model events partially created
      deprecated: true
components:
  schemas:
    PostModelEventBatchRequest:
      type: object
      properties:
        model_events:
          type: array
          items:
            $ref: '#/components/schemas/ModelEvent'
          description: Array of model events to create
        single_session:
          type: boolean
          description: If true, all events share the same session
        is_single_session:
          type: boolean
          deprecated: true
          description: Legacy field name for single_session (backward compatibility)
        session:
          $ref: '#/components/schemas/SessionProperties'
          description: Alias for session_properties (backward compatibility)
          deprecated: true
        session_properties:
          $ref: '#/components/schemas/SessionProperties'
      required:
        - model_events
      description: Request body for POST /events/model/batch
    PostEventBatchResponse:
      type: object
      properties:
        event_ids:
          type: array
          items:
            type: string
        session_id:
          type: string
        success:
          type: boolean
      required:
        - event_ids
        - success
      description: Response for POST /events/batch
    ModelEvent:
      type: object
      properties:
        project:
          type: string
          deprecated: true
          description: >-
            Project name (ignored by server — project is determined from API key
            scope)
        project_id:
          type: string
          description: Project ID
        source:
          type: string
          description: Source of the event (e.g., sdk-python)
        event_name:
          type: string
          description: Name of the event
        event_type:
          type: string
          enum:
            - model
            - tool
            - chain
            - session
          description: Type of event (model, tool, chain, or session)
        event_id:
          type: string
          description: Unique event identifier
        session_id:
          type: string
          description: Session this event belongs to
        parent_id:
          type: string
          description: Parent event ID in the trace hierarchy
        children_ids:
          type: array
          items:
            type: string
          description: Child event IDs in the trace hierarchy
        config:
          type: object
          additionalProperties: {}
          description: Configuration used for this event
        inputs:
          type: object
          additionalProperties: {}
          description: Input data for the event
        outputs:
          type: object
          additionalProperties: {}
          description: Output data from the event
        error:
          type:
            - string
            - 'null'
          deprecated: true
          description: Legacy alias — remapped to inputs.error for model events
        start_time:
          type: number
          description: Event start time as Unix milliseconds
        end_time:
          type: number
          description: Event end time as Unix milliseconds
        duration:
          type: number
          deprecated: true
          description: Legacy alias — remapped to inputs.duration for model events
        metadata:
          type: object
          additionalProperties: {}
          description: Arbitrary metadata for the event
        feedback:
          type: object
          additionalProperties: {}
          description: Feedback data associated with the event
        metrics:
          type: object
          additionalProperties: {}
          description: Metric values computed for the event
        user_properties:
          type: object
          additionalProperties: {}
          description: User properties associated with the event
        model_name:
          type: string
          description: Model identifier (either this or event_name required)
        model_version:
          type: string
          description: Model version string
        model:
          type: string
          deprecated: true
          description: Legacy alias for model_name
        messages:
          type: array
          items: {}
          deprecated: true
          description: Legacy alias — remapped to inputs.messages
        response:
          deprecated: true
          description: Legacy alias — remapped to outputs.response
        provider:
          type: string
          deprecated: true
          description: Legacy alias — remapped to inputs.provider
        usage:
          type: object
          additionalProperties: {}
          deprecated: true
          description: Legacy alias — remapped to inputs.usage
        cost:
          deprecated: true
          description: Legacy alias — remapped to inputs.cost
        hyperparameters:
          type: object
          additionalProperties: {}
          deprecated: true
          description: Legacy alias — remapped to inputs.hyperparameters
        template:
          deprecated: true
          description: Legacy alias — remapped to inputs.template
        template_inputs:
          deprecated: true
          description: Legacy alias — remapped to inputs.template_inputs
        tools:
          deprecated: true
          description: Legacy alias — remapped to inputs.tools
        tool_choice:
          deprecated: true
          description: Legacy alias — remapped to inputs.tool_choice
        response_format:
          deprecated: true
          description: Legacy alias — remapped to inputs.response_format
      additionalProperties: {}
      description: Model event object with model-specific fields and legacy aliases
    SessionProperties:
      type: object
      properties:
        session_name:
          type: string
        start_time:
          type: number
          description: Session start time as Unix milliseconds
        user_properties:
          type: object
          additionalProperties: {}
        metadata:
          type: object
          additionalProperties: {}
      additionalProperties: {}
      description: Session properties for batch event creation
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````