> ## 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 Model Analytics

> Get comprehensive analytics for a specific model including quality scores, sentiment analysis, safety metrics, LLM-generated recommendations, and time-series data.

**Requires Growth+ plan or higher.**

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



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi get /models/{modelId}/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:
  /models/{modelId}/analytics:
    get:
      tags:
        - Analytics
        - Models
      summary: Get Model Analytics
      description: >-
        Get comprehensive analytics for a specific model including quality
        scores, sentiment analysis, safety metrics, LLM-generated
        recommendations, and time-series data.


        **Requires Growth+ plan or higher.**


        Rate limited based on your plan's `maxAnalysesPerHour`.
      parameters:
        - schema:
            type: string
            format: uuid
            description: The model ID to get analytics for
          required: true
          description: The model ID to get analytics for
          name: modelId
          in: path
        - schema:
            type: string
            enum:
              - 7d
              - 30d
              - 90d
            default: 30d
            description: 'Time period for analytics data: 7d, 30d (default), or 90d.'
          required: false
          description: 'Time period for analytics data: 7d, 30d (default), or 90d.'
          name: period
          in: query
      responses:
        '200':
          description: Model analytics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetModelAnalyticsResponse'
              example:
                avgConversationQualityIndex: 7.8
                avgSatisfactionScore: 0.82
                avgGrowthScore: 0.65
                avgFrictionScore: 0.88
                avgSafetyScore: 0.94
                averageUserSentiment:
                  label: positive
                  score: 0.28
                averageChangeInUserSentiment:
                  label: stable
                  score: 0.03
                averageFrustration:
                  label: low
                  score: 0.18
                averageStruggle:
                  label: low
                  score: 0.14
                averageCommercialIntent:
                  label: moderate
                  score: 0.42
                hallucinationCount:
                  total: 8
                  percentage: 0.9
                jailbreakCount:
                  total: 2
                  percentage: 0.2
                userBiasCount:
                  total: 1
                  percentage: 0.1
                modelBiasCount:
                  total: 3
                  percentage: 0.3
                userToxicityCount:
                  total: 4
                  percentage: 0.4
                modelToxicityCount:
                  total: 0
                  percentage: 0
                recommendations:
                  summary: >-
                    GPT-4o is performing well overall. Hallucination rate is
                    slightly elevated for refund policy topics.
                  healthLevel: healthy
                  strengths:
                    - High satisfaction scores across all products
                    - Excellent safety compliance
                    - Low friction in multi-turn conversations
                  recommendations:
                    - title: Reduce hallucination in billing topics
                      action: Add explicit billing policy context to the system prompt
                      rationale:
                        whyThisMatters: Billing hallucinations erode customer trust.
                        observedPattern: >-
                          65% of hallucinations occur in refund/billing
                          conversations.
                        tradeoff: Longer system prompt may slightly increase latency.
                      evidence:
                        exampleSnippets:
                          - >-
                            Bot stated "refunds are processed in 24 hours" when
                            policy says 5-7 business days.
                      expectedImpact:
                        - Reduce hallucination rate by ~40%
                        - Improve billing conversation CQI from 6.2 to 7.5+
                      priority: high
                      category: prompt_optimization_link
                  detectedIssues:
                    - id: hallucination-billing
                      severity: warning
                      title: >-
                        Elevated hallucination rate in billing-related
                        conversations
                conversationCount: 4520
                messageCount: 31640
                averageConversationRating: 4.2
                dataPoints:
                  - date: '2025-10-01T00:00:00Z'
                    avgConversationQualityIndex: 7.6
                    avgSatisfactionScore: 0.8
                    avgGrowthScore: 0.63
                    avgFrictionScore: 0.86
                    avgSafetyScore: 0.93
                    conversationCount: 152
                    messageCount: 1064
                  - date: '2025-10-08T00:00:00Z'
                    avgConversationQualityIndex: 7.9
                    avgSatisfactionScore: 0.83
                    avgGrowthScore: 0.66
                    avgFrictionScore: 0.89
                    avgSafetyScore: 0.95
                    conversationCount: 168
                    messageCount: 1176
        '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 get model analytics operations.
              example:
                success: false
                error: This endpoint requires a Growth plan or higher
        '404':
          description: Model 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 get model analytics operations.
              example:
                success: false
                error: Model 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 get model analytics operations.
              example:
                success: false
                error: >-
                  Rate limit exceeded for analytics requests. Please try again
                  later.
        '500':
          description: Server error
          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 get model analytics 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 getModelAnalyticsResponse = await
            client.models.getModelAnalytics(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );


            console.log(getModelAnalyticsResponse.averageChangeInUserSentiment);
        - 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_model_analytics_response = client.models.get_model_analytics(
                model_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(get_model_analytics_response.average_change_in_user_sentiment)
components:
  schemas:
    GetModelAnalyticsResponse:
      type: object
      properties:
        avgConversationQualityIndex:
          type:
            - number
            - 'null'
          description: Average conversation quality index.
        avgSatisfactionScore:
          type:
            - number
            - 'null'
          description: Average satisfaction score.
        avgGrowthScore:
          type:
            - number
            - 'null'
          description: Average growth score.
        avgFrictionScore:
          type:
            - number
            - 'null'
          description: Average friction score.
        avgSafetyScore:
          type:
            - number
            - 'null'
          description: Average safety score.
        averageUserSentiment:
          type:
            - object
            - 'null'
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average user sentiment.
        averageChangeInUserSentiment:
          type:
            - object
            - 'null'
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average change in user sentiment.
        averageFrustration:
          type:
            - object
            - 'null'
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average frustration level.
        averageStruggle:
          type:
            - object
            - 'null'
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average struggle level.
        averageCommercialIntent:
          type:
            - object
            - 'null'
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average commercial intent.
        hallucinationCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: Hallucination detection counts.
        jailbreakCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: Jailbreak detection counts.
        userBiasCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: User bias detection counts.
        modelBiasCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: Model bias detection counts.
        userToxicityCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: User toxicity detection counts.
        modelToxicityCount:
          type:
            - object
            - 'null'
          properties:
            total:
              type: number
            percentage:
              type: number
          required:
            - total
            - percentage
          description: Model toxicity detection counts.
        recommendations:
          type:
            - object
            - 'null'
          properties:
            summary:
              type: string
              description: Overall summary of model health.
            healthLevel:
              type: string
              enum:
                - healthy
                - needs_attention
                - critical
              description: Overall health level.
            strengths:
              type: array
              items:
                type: string
              description: Identified model strengths.
            recommendations:
              type: array
              items:
                type: object
                properties:
                  title:
                    type: string
                  action:
                    type: string
                  rationale:
                    type: object
                    properties:
                      whyThisMatters:
                        type: string
                      observedPattern:
                        type: string
                      tradeoff:
                        type: string
                    required:
                      - whyThisMatters
                      - observedPattern
                  evidence:
                    type: object
                    properties:
                      exampleSnippets:
                        type: array
                        items:
                          type: string
                    required:
                      - exampleSnippets
                  expectedImpact:
                    type: array
                    items:
                      type: string
                  priority:
                    type: string
                    enum:
                      - high
                      - medium
                      - low
                  category:
                    type: string
                    enum:
                      - model_switch
                      - cost_optimization
                      - use_case_fit
                      - prompt_optimization_link
                required:
                  - title
                  - action
                  - rationale
                  - evidence
                  - expectedImpact
                  - priority
                  - category
              description: Actionable recommendations.
            detectedIssues:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  severity:
                    type: string
                    enum:
                      - critical
                      - warning
                      - info
                  title:
                    type: string
                required:
                  - id
                  - severity
                  - title
              description: Issues detected via rules-based analysis.
          required:
            - summary
            - healthLevel
            - strengths
            - recommendations
            - detectedIssues
          description: LLM-generated recommendations and health assessment.
        conversationCount:
          type: number
          description: Total conversation count.
        messageCount:
          type: number
          description: Total message count.
        averageConversationRating:
          type:
            - number
            - 'null'
          description: Average conversation rating.
        dataPoints:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date-time
                description: Data point date.
              avgConversationQualityIndex:
                type:
                  - number
                  - 'null'
                description: Average conversation quality index.
              avgSatisfactionScore:
                type:
                  - number
                  - 'null'
                description: Average satisfaction score.
              avgGrowthScore:
                type:
                  - number
                  - 'null'
                description: Average growth score.
              avgFrictionScore:
                type:
                  - number
                  - 'null'
                description: Average friction score.
              avgSafetyScore:
                type:
                  - number
                  - 'null'
                description: Average safety score.
              conversationCount:
                type: number
                description: Number of conversations.
              messageCount:
                type: number
                description: Number of messages.
            required:
              - date
              - avgConversationQualityIndex
              - avgSatisfactionScore
              - avgGrowthScore
              - avgFrictionScore
              - avgSafetyScore
              - conversationCount
              - messageCount
          description: Time-series data points for the requested period.
      required:
        - avgConversationQualityIndex
        - avgSatisfactionScore
        - avgGrowthScore
        - avgFrictionScore
        - avgSafetyScore
        - averageUserSentiment
        - averageChangeInUserSentiment
        - averageFrustration
        - averageStruggle
        - averageCommercialIntent
        - hallucinationCount
        - jailbreakCount
        - userBiasCount
        - modelBiasCount
        - userToxicityCount
        - modelToxicityCount
        - recommendations
        - conversationCount
        - messageCount
        - averageConversationRating
        - dataPoints
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````