> ## 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 new chart



## OpenAPI

````yaml https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/openapi.yaml post /v1/charts
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:
  /v1/charts:
    post:
      tags:
        - Charts
      summary: Create a new chart
      operationId: createChart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChartRequest'
      responses:
        '200':
          description: Chart created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateChartResponse'
components:
  schemas:
    CreateChartRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 200
          description: Display name for the chart
        description:
          type: string
          description: Description of what the chart shows
        metric:
          type: string
          minLength: 1
          description: Name of the metric to visualize
        func:
          type: string
          description: Aggregation function to apply (e.g. sum, avg, median, min, max)
        groupBy:
          type:
            - string
            - 'null'
          description: Field to group results by
        bucketing:
          type: string
          enum:
            - minute
            - hour
            - day
            - week
            - month
          default: day
          description: Time bucket granularity for aggregation
        dateRange:
          anyOf:
            - $ref: '#/components/schemas/RelativeDateRange'
            - $ref: '#/components/schemas/AbsoluteDateRange'
          description: Time range to query
        query:
          type: array
          items:
            $ref: '#/components/schemas/QueryFilter'
          description: Filters to apply to the chart data
        owner_id:
          type: string
          minLength: 1
          description: ID of the user who owns this chart
      required:
        - name
        - metric
      additionalProperties: false
    CreateChartResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/CreateChartResponseData'
      required:
        - success
        - data
      additionalProperties: false
    RelativeDateRange:
      type: object
      properties:
        relative:
          type: string
      required:
        - relative
      additionalProperties: false
    AbsoluteDateRange:
      type: object
      properties:
        $gte:
          anyOf:
            - type: string
            - type: number
        $lte:
          anyOf:
            - type: string
            - type: number
      required:
        - $gte
        - $lte
    QueryFilter:
      type: object
      properties:
        field:
          type: string
          description: Name of the field to filter on
        value:
          type:
            - string
            - 'null'
          description: Value to compare against
        type:
          type: string
          description: Data type of the field (e.g. string, number)
        operator:
          type: string
          description: >-
            Comparison operator (e.g. is, is not, contains, greater than, less
            than)
      required:
        - field
        - value
        - type
        - operator
      additionalProperties: false
    CreateChartResponseData:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        name:
          type: string
          maxLength: 200
        description:
          type:
            - string
            - 'null'
        metric:
          type: string
        func:
          type:
            - string
            - 'null'
        groupBy:
          type:
            - string
            - 'null'
        bucketing:
          type: string
        dateRange:
          type:
            - object
            - 'null'
          additionalProperties: {}
        query:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/QueryFilter'
        owner_id:
          type:
            - string
            - 'null'
          minLength: 1
        owner_profile:
          type:
            - object
            - 'null'
          additionalProperties: {}
        is_active:
          type: boolean
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: string
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: string
            - type: 'null'
      required:
        - id
        - name
        - description
        - metric
        - func
        - groupBy
        - bucketing
        - dateRange
        - query
        - owner_id
        - is_active
        - created_at
        - updated_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````