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

# Get Prompt Analytics

> Get computed analytics for a specific prompt, including quality metrics, usage statistics, and suggestion data.

**Requires Growth+ plan or higher.**

Returns:
- **Quality**: Average conversation quality index
- **Usage**: Total conversations and last used timestamp
- **Suggestions**: Suggestion count, effective suggestion count (active versions only), and needs-review flag

Rate limited based on your plan's `maxAnalysesPerHour`.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi get /prompts/{id}/analytics
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /prompts/{id}/analytics:
    get:
      tags:
        - Analytics
        - Prompts
      summary: Get Prompt Analytics
      description: >-
        Get computed analytics for a specific prompt, including quality metrics,
        usage statistics, and suggestion data.


        **Requires Growth+ plan or higher.**


        Returns:

        - **Quality**: Average conversation quality index

        - **Usage**: Total conversations and last used timestamp

        - **Suggestions**: Suggestion count, effective suggestion count (active
        versions only), and needs-review flag


        Rate limited based on your plan's `maxAnalysesPerHour`.
      parameters:
        - schema:
            type: string
            format: uuid
            description: The prompt ID to get analytics for
          required: true
          description: The prompt ID to get analytics for
          name: id
          in: path
      responses:
        '200':
          description: Prompt analytics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPromptAnalyticsResponse'
              example:
                avgQualityIndex: 7.2
                totalConversations: 1250
                lastUsedAt: '2025-10-15T14:30:00Z'
                suggestionCount: 5
                effectiveSuggestionCount: 3
                needsReview: true
        '403':
          description: Requires paid plan
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for GetPromptAnalytics operations.
              example:
                success: false
                error: This endpoint requires a paid plan
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for GetPromptAnalytics operations.
              example:
                success: false
                error: Prompt not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for GetPromptAnalytics operations.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Greenflash from 'greenflash';


            const client = new Greenflash({
              apiKey: process.env['GREENFLASH_API_KEY'], // This is the default and can be omitted
            });


            const getPromptAnalyticsResponse = await
            client.prompts.getPromptAnalytics(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );


            console.log(getPromptAnalyticsResponse.avgQualityIndex);
        - lang: Python
          source: |-
            import os
            from greenflash import Greenflash

            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )
            get_prompt_analytics_response = client.prompts.get_prompt_analytics(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(get_prompt_analytics_response.avg_quality_index)
components:
  schemas:
    GetPromptAnalyticsResponse:
      type: object
      properties:
        avgQualityIndex:
          type:
            - number
            - 'null'
          description: >-
            Average conversation quality index across all conversations using
            this prompt.
        totalConversations:
          type: number
          description: Total number of conversations using this prompt.
        lastUsedAt:
          type:
            - string
            - 'null'
          description: >-
            ISO 8601 timestamp of the most recent conversation using this
            prompt.
        suggestionCount:
          type: number
          description: Total number of suggestions from prompt analyses.
        effectiveSuggestionCount:
          type: number
          description: >-
            Suggestion count scoped to active versions only. Zero if the prompt
            is not part of an active version.
        needsReview:
          type: boolean
          description: Whether the prompt has effective suggestions that need review.
      required:
        - avgQualityIndex
        - totalConversations
        - lastUsedAt
        - suggestionCount
        - effectiveSuggestionCount
        - needsReview
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````