> ## 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 data plane API key

> Create a fine-grained data plane API key rooted at a project. The caller's key must carry `project.fine_grained_api_key_dp.post` for the project. Only an organization-rooted key created in the organization's **Settings → API Keys**, on the **Data Plane** tab, can carry it, and a key created through this operation never can, so a provisioned key cannot create keys. The permissions requested are limited to the organization's data plane key policy, and `expires_at` to the system's maximum lifetime. The project must already exist on this data plane: a project created on the control plane reaches it asynchronously, and the operation answers 404 until it does. `key_value` is returned once and cannot be retrieved again.



## OpenAPI

````yaml https://raw.githubusercontent.com/honeyhiveai/honeyhive-openapi/main/data_plane_openapi.yaml post /v1/projects/{project_id}/fine_grained_api_keys
openapi: 3.1.0
info:
  title: HoneyHive Data Plane API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.14.0
servers:
  - url: https://api.dp1.us.honeyhive.ai
security: []
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: Data Plane Api Keys
    description: >
      Create fine-grained data plane API keys for a project from a provisioning
      flow, using an organization-rooted key that is permitted to create keys.
  - 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: Ingestion Api Keys
    description: >
      Create ingestion API keys for a project from a provisioning flow, using an
      organization-rooted data plane key that is permitted to create keys. An
      ingestion key is the credential an application sends traces with.
  - 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/projects/{project_id}/fine_grained_api_keys:
    post:
      tags:
        - Data Plane Api Keys
      summary: Create a data plane API key
      description: >-
        Create a fine-grained data plane API key rooted at a project. The
        caller's key must carry `project.fine_grained_api_key_dp.post` for the
        project. Only an organization-rooted key created in the organization's
        **Settings → API Keys**, on the **Data Plane** tab, can carry it, and a
        key created through this operation never can, so a provisioned key
        cannot create keys. The permissions requested are limited to the
        organization's data plane key policy, and `expires_at` to the system's
        maximum lifetime. The project must already exist on this data plane: a
        project created on the control plane reaches it asynchronously, and the
        operation answers 404 until it does. `key_value` is returned once and
        cannot be retrieved again.
      operationId: createDataPlaneApiKey
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            type: string
          description: The unique identifier of the project the key is rooted at
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataPlaneApiKeyRequest'
      responses:
        '200':
          description: Data plane API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDataPlaneApiKeyResponse'
      security:
        - DataPlaneApiKey: []
components:
  schemas:
    CreateDataPlaneApiKeyRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
          description: A name for the key, shown in the key list.
        description:
          type: string
          maxLength: 1024
          description: What the key is for.
        permissions:
          type: array
          items:
            type: string
          minItems: 1
          description: >-
            The permissions the key carries, such as `project.chart.get`. Each
            must be one the key's root scope can carry and one the
            organization's data plane key policy allows; the key creation screen
            under the project's Settings → API Keys lists them.
        expires_at:
          type: string
          format: date-time
          description: >-
            When the key expires, as an ISO 8601 timestamp. It must be in the
            future and within the maximum key lifetime; a later value is refused
            with the limit named.
      required:
        - name
        - permissions
        - expires_at
      additionalProperties: false
    CreateDataPlaneApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/CreateDataPlaneApiKeyResponseData'
      required:
        - success
        - data
      additionalProperties: false
    CreateDataPlaneApiKeyResponseData:
      type: object
      properties:
        key_value:
          type: string
        key_id:
          type: string
        permissions:
          type: array
          items:
            type: string
        root_scope_type:
          type: string
          enum:
            - project
        root_scope_id:
          type: string
        expires_at:
          type: string
          format: date-time
      required:
        - key_value
        - key_id
        - permissions
        - root_scope_type
        - root_scope_id
        - expires_at
      additionalProperties: false
  securitySchemes:
    DataPlaneApiKey:
      type: http
      scheme: bearer
      description: >-
        A fine-grained data plane API key (values begin with `hh_fgdp_`). Rooted
        at an organization, workspace, or project, it carries the permissions
        chosen when it was created, and only the operations whose paths begin
        with `/v1/projects/{project_id}/` accept it. Create one in the HoneyHive
        app under the project's, workspace's, or organization's **Settings → API
        Keys**, on the **Data Plane** tab.

````

## Related topics

- [Data Plane Api Keys](/v2/cli-reference/ref/data-plane-api-keys.md)
- [Data Plane Api Keys Methods](/v2/sdk-reference/typescript/ref/data-plane-api-keys/index.md)
- [CreateDataPlaneApiKeyRequest](/v2/sdk-reference/typescript/ref/data-plane-api-keys/CreateDataPlaneApiKeyRequest.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.