---
title: "Get event metrics"
method: POST
path: "/v1/events/metrics"
tags: ["events"]
---

# Get event metrics

`POST /v1/events/metrics`

## Request

- Base URL: `https://api.mixedbread.com`
- URL: `https://api.mixedbread.com/v1/events/metrics`
- Auth: HTTP bearer

Aggregate what the events carry beyond their count, per time bucket and over the whole window.

Ingestion volume (files, chunks, tokens, bytes, timings), searches by kind
(semantic, reranked, rewritten, agentic, grep) with latency percentiles and
agentic token usage, and chat completions with their prompt, cached, and
completion tokens, hosted tool calls, and turn durations. Embedding and
reranking requests come with their tokens, reranked documents, and latency
percentiles. Buckets with no events are omitted; the totals' percentiles
span every event in the window.

## Query parameters

- `limit` integer: Maximum number of items to return per page (1-100)
- `after` string, nullable: Cursor for forward pagination - get items after this position. Use last_cursor from previous response.
- `before` string, nullable: Cursor for backward pagination - get items before this position. Use first_cursor from previous response.
- `include_total` boolean: Whether to include total count in response (expensive operation)
- `store_identifier` union: Restrict to one store by ID or name; omit to span every store
  - string
  - string, uuid
- `group_by` 'store', nullable: Split every bucket and total per store, carrying its `store_id`, for one page of the busiest stores by queries then files; the other stores share rows with a null `store_id`, and events with no store are left out.
- `include_previous` boolean: Also aggregate the window of the same length that ends at `start_time`.

## Request body

- EventHistogramParams: Time window and bucket size of an event histogram.
  - `start_time` string, date-time: Start time of the histogram
  - `end_time` string, date-time: End time of the histogram
  - `bucket_seconds` integer: Number of seconds in each bucket

## Response `200`

Usage aggregates of the organization's events per time bucket

- EventMetricsResponse
  - `data` EventMetricsBucket[], required: Usage aggregates per time bucket, oldest first
    - `bucket_start` string, date-time, required: Start time of the bucket
    - `bucket_end` string, date-time, required: End time of the bucket
    - `store_id` string, uuid, nullable: The store this bucket aggregates, when the metrics are grouped by store
    - `ingestion` EventMetricsIngestion, required: Ingestion volume and timings within one bucket.
      - `files` integer: Files whose ingestion completed
      - `high_quality_files` integer: Files ingested with the high-quality strategy
      - `chunks` integer: Chunks produced
      - `tokens` integer: Tokens embedded during ingestion
      - `bytes` integer: Bytes of source files ingested
      - `avg_ingestion_time` string, duration, nullable: Mean processing time, excluding queueing
      - `avg_queue_time` string, duration, nullable: Mean time files waited before processing
    - `search` EventMetricsSearch, required: Search activity within one bucket, split by kind.
      - `semantic` integer: Plain semantic searches, including the reranked ones
      - `reranked` integer: Semantic searches that applied a reranker
      - `rewritten` integer: Semantic searches that enabled query rewriting
      - `agentic` integer: Agentic searches
      - `grep` integer: Grep searches
      - `qa` integer: Question answering requests
      - `avg_search_time` string, duration, nullable: Mean latency of semantic searches
      - `p95_search_time` string, duration, nullable: 95th-percentile latency of semantic searches
      - `avg_agentic_search_time` string, duration, nullable: Mean wall-clock time of agentic searches
      - `p95_agentic_search_time` string, duration, nullable: 95th-percentile wall-clock time of agentic searches
      - `agentic_prompt_tokens` integer: Prompt tokens consumed by agentic searches
      - `agentic_completion_tokens` integer: Completion tokens generated by agentic searches
      - `avg_agentic_rounds` number, nullable: Mean rounds an agentic search executed
    - `completion` EventMetricsCompletion, required: Chat completion activity within one bucket.
      - `count` integer: Completion turns across both APIs
      - `responses` integer: Turns created through the Responses API
      - `prompt_tokens` integer: Prompt tokens consumed, including cached ones
      - `cached_tokens` integer: Prompt tokens served from the prompt cache
      - `completion_tokens` integer: Completion tokens generated
      - `tool_calls` integer: Hosted store tool calls executed server-side
      - `function_tool_calls` integer: Client-executed function tool calls the model requested
      - `avg_total_time` string, duration, nullable: Mean wall-clock time of a turn
    - `embedding` EventMetricsEmbedding, required: Embeddings API activity within one bucket.
      - `requests` integer: Embedding requests
      - `tokens` integer: Tokens embedded
      - `avg_time` string, duration, nullable: Mean latency of embedding requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of embedding requests
    - `reranking` EventMetricsReranking, required: Reranking API activity within one bucket.
      - `requests` integer: Reranking requests
      - `tokens` integer: Tokens consumed by reranking
      - `documents` integer: Documents submitted for reranking
      - `avg_time` string, duration, nullable: Mean latency of reranking requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of reranking requests
  - `totals` EventMetricsBucket[], required: The whole window as one bucket, one per store when grouped by store; empty without events
    - `bucket_start` string, date-time, required: Start time of the bucket
    - `bucket_end` string, date-time, required: End time of the bucket
    - `store_id` string, uuid, nullable: The store this bucket aggregates, when the metrics are grouped by store
    - `ingestion` EventMetricsIngestion, required: Ingestion volume and timings within one bucket.
      - `files` integer: Files whose ingestion completed
      - `high_quality_files` integer: Files ingested with the high-quality strategy
      - `chunks` integer: Chunks produced
      - `tokens` integer: Tokens embedded during ingestion
      - `bytes` integer: Bytes of source files ingested
      - `avg_ingestion_time` string, duration, nullable: Mean processing time, excluding queueing
      - `avg_queue_time` string, duration, nullable: Mean time files waited before processing
    - `search` EventMetricsSearch, required: Search activity within one bucket, split by kind.
      - `semantic` integer: Plain semantic searches, including the reranked ones
      - `reranked` integer: Semantic searches that applied a reranker
      - `rewritten` integer: Semantic searches that enabled query rewriting
      - `agentic` integer: Agentic searches
      - `grep` integer: Grep searches
      - `qa` integer: Question answering requests
      - `avg_search_time` string, duration, nullable: Mean latency of semantic searches
      - `p95_search_time` string, duration, nullable: 95th-percentile latency of semantic searches
      - `avg_agentic_search_time` string, duration, nullable: Mean wall-clock time of agentic searches
      - `p95_agentic_search_time` string, duration, nullable: 95th-percentile wall-clock time of agentic searches
      - `agentic_prompt_tokens` integer: Prompt tokens consumed by agentic searches
      - `agentic_completion_tokens` integer: Completion tokens generated by agentic searches
      - `avg_agentic_rounds` number, nullable: Mean rounds an agentic search executed
    - `completion` EventMetricsCompletion, required: Chat completion activity within one bucket.
      - `count` integer: Completion turns across both APIs
      - `responses` integer: Turns created through the Responses API
      - `prompt_tokens` integer: Prompt tokens consumed, including cached ones
      - `cached_tokens` integer: Prompt tokens served from the prompt cache
      - `completion_tokens` integer: Completion tokens generated
      - `tool_calls` integer: Hosted store tool calls executed server-side
      - `function_tool_calls` integer: Client-executed function tool calls the model requested
      - `avg_total_time` string, duration, nullable: Mean wall-clock time of a turn
    - `embedding` EventMetricsEmbedding, required: Embeddings API activity within one bucket.
      - `requests` integer: Embedding requests
      - `tokens` integer: Tokens embedded
      - `avg_time` string, duration, nullable: Mean latency of embedding requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of embedding requests
    - `reranking` EventMetricsReranking, required: Reranking API activity within one bucket.
      - `requests` integer: Reranking requests
      - `tokens` integer: Tokens consumed by reranking
      - `documents` integer: Documents submitted for reranking
      - `avg_time` string, duration, nullable: Mean latency of reranking requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of reranking requests
  - `previous_totals` EventMetricsBucket[], nullable: The window of the same length that ends at `start_time`, aggregated like `totals`; only with `include_previous`
    - `bucket_start` string, date-time, required: Start time of the bucket
    - `bucket_end` string, date-time, required: End time of the bucket
    - `store_id` string, uuid, nullable: The store this bucket aggregates, when the metrics are grouped by store
    - `ingestion` EventMetricsIngestion, required: Ingestion volume and timings within one bucket.
      - `files` integer: Files whose ingestion completed
      - `high_quality_files` integer: Files ingested with the high-quality strategy
      - `chunks` integer: Chunks produced
      - `tokens` integer: Tokens embedded during ingestion
      - `bytes` integer: Bytes of source files ingested
      - `avg_ingestion_time` string, duration, nullable: Mean processing time, excluding queueing
      - `avg_queue_time` string, duration, nullable: Mean time files waited before processing
    - `search` EventMetricsSearch, required: Search activity within one bucket, split by kind.
      - `semantic` integer: Plain semantic searches, including the reranked ones
      - `reranked` integer: Semantic searches that applied a reranker
      - `rewritten` integer: Semantic searches that enabled query rewriting
      - `agentic` integer: Agentic searches
      - `grep` integer: Grep searches
      - `qa` integer: Question answering requests
      - `avg_search_time` string, duration, nullable: Mean latency of semantic searches
      - `p95_search_time` string, duration, nullable: 95th-percentile latency of semantic searches
      - `avg_agentic_search_time` string, duration, nullable: Mean wall-clock time of agentic searches
      - `p95_agentic_search_time` string, duration, nullable: 95th-percentile wall-clock time of agentic searches
      - `agentic_prompt_tokens` integer: Prompt tokens consumed by agentic searches
      - `agentic_completion_tokens` integer: Completion tokens generated by agentic searches
      - `avg_agentic_rounds` number, nullable: Mean rounds an agentic search executed
    - `completion` EventMetricsCompletion, required: Chat completion activity within one bucket.
      - `count` integer: Completion turns across both APIs
      - `responses` integer: Turns created through the Responses API
      - `prompt_tokens` integer: Prompt tokens consumed, including cached ones
      - `cached_tokens` integer: Prompt tokens served from the prompt cache
      - `completion_tokens` integer: Completion tokens generated
      - `tool_calls` integer: Hosted store tool calls executed server-side
      - `function_tool_calls` integer: Client-executed function tool calls the model requested
      - `avg_total_time` string, duration, nullable: Mean wall-clock time of a turn
    - `embedding` EventMetricsEmbedding, required: Embeddings API activity within one bucket.
      - `requests` integer: Embedding requests
      - `tokens` integer: Tokens embedded
      - `avg_time` string, duration, nullable: Mean latency of embedding requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of embedding requests
    - `reranking` EventMetricsReranking, required: Reranking API activity within one bucket.
      - `requests` integer: Reranking requests
      - `tokens` integer: Tokens consumed by reranking
      - `documents` integer: Documents submitted for reranking
      - `avg_time` string, duration, nullable: Mean latency of reranking requests
      - `p95_time` string, duration, nullable: 95th-percentile latency of reranking requests
  - `pagination` CursorPaginationResponse: Response model for cursor-based pagination.
    - `has_more` boolean, required: Contextual direction-aware flag: True if more items exist in the requested pagination direction. For 'after': more items after this page. For 'before': more items before this page.
    - `first_cursor` string, nullable, required: Cursor of the first item in this page. Use for backward pagination. None if page is empty.
    - `last_cursor` string, nullable, required: Cursor of the last item in this page. Use for forward pagination. None if page is empty.
    - `total` integer, nullable: Total number of items available across all pages. Only included when include_total=true was requested. Expensive operation - use sparingly.
  - `object` 'event_metrics': The object type of the response

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-19** `e083f1cdb54e`: 5 info
  - added the new optional `query` request parameter `after`
  - added the new optional `query` request parameter `before`
  - added the new optional `query` request parameter `include_total`
  - added the new optional `query` request parameter `limit`
  - …1 more
- **2026-10-18** `afd04ad39e80`: 6 info
  - added the new optional `query` request parameter `include_previous`
  - added the optional property `data/items/search/p95_agentic_search_time` to the response with the `200` status
  - added the optional property `previous_totals` to the response with the `200` status
  - added the required property `data/items/embedding` to the response with the `200` status
  - …2 more
- **2026-09-26** `9c6c72afde2d`: 3 info
  - added the new optional `query` request parameter `group_by`
  - added the optional property `data/items/search/qa` to the response with the `200` status
  - added the optional property `data/items/store_id` to the response with the `200` status
- **2026-08-22** `6dac6bb49f72`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mixedbread/apis/mxbai-omni/changes/v1/events/metrics/post.md)

---

[API](https://skmtc.dev/mixedbread/apis/mxbai-omni.md) - [All operations](https://skmtc.dev/mixedbread/apis/mxbai-omni/llms.txt) - [OpenAPI document](https://skmtc.dev/mixedbread/apis/mxbai-omni/revisions/da24b4f7e983?raw)
