Portkey · Capability

Portkey API — Analytics > Graphs

Portkey API — Analytics > Graphs. 17 operations. Lead operation: Get cache hit rate graph. Self-contained Naftiko capability covering one Portkey business surface.

Run with Naftiko PortkeyAnalytics > Graphs

What You Can Do

GET
Get — Get cache hit rate graph
/v1/analytics/graphs/cache/hit-rate
GET
Get — Get cache hit latency graph
/v1/analytics/graphs/cache/latency
GET
Get — Get cost graph
/v1/analytics/graphs/cost
GET
Get — Get errors graph
/v1/analytics/graphs/errors
GET
Get — Get percentage error rate graph
/v1/analytics/graphs/errors/rate
GET
Get — Get status code wise stacked error graph
/v1/analytics/graphs/errors/stacks
GET
Get — Get status code wise grouped error graph.
/v1/analytics/graphs/errors/status-codes
GET
Get — Get feedbacks graph
/v1/analytics/graphs/feedbacks
GET
Get — Get feedbacks per ai_models graph
/v1/analytics/graphs/feedbacks/ai-models
GET
Get — Get score-wise feedbacks distribution graph
/v1/analytics/graphs/feedbacks/scores
GET
Get — Get weighted feedbacks graph. Weighted feedback is (value * score)
/v1/analytics/graphs/feedbacks/weighted
GET
Get — Get latency graph
/v1/analytics/graphs/latency
GET
Get — Get requests graph
/v1/analytics/graphs/requests
GET
Get — Get retry and fallback rescued requests graph
/v1/analytics/graphs/requests/rescued
GET
Get — Get tokens graph
/v1/analytics/graphs/tokens
GET
Get — Get users graph. Returns unique user count across different time buckets
/v1/analytics/graphs/users
GET
Get — Get users requests graph. Returns average requests per user across different time buckets
/v1/analytics/graphs/users/requests

MCP Tools

get-cache-hit-rate-graph

Get cache hit rate graph

read-only idempotent
get-cache-hit-latency-graph

Get cache hit latency graph

read-only idempotent
get-cost-graph

Get cost graph

read-only idempotent
get-errors-graph

Get errors graph

read-only idempotent
get-percentage-error-rate-graph

Get percentage error rate graph

read-only idempotent
get-status-code-wise-stacked

Get status code wise stacked error graph

read-only idempotent
get-status-code-wise-grouped

Get status code wise grouped error graph.

read-only idempotent
get-feedbacks-graph

Get feedbacks graph

read-only idempotent
get-feedbacks-per-ai-models

Get feedbacks per ai_models graph

read-only idempotent
get-score-wise-feedbacks-distribution

Get score-wise feedbacks distribution graph

read-only idempotent
get-weighted-feedbacks-graph-weighted

Get weighted feedbacks graph. Weighted feedback is (value * score)

read-only idempotent
get-latency-graph

Get latency graph

read-only idempotent
get-requests-graph

Get requests graph

read-only idempotent
get-retry-and-fallback-rescued

Get retry and fallback rescued requests graph

read-only idempotent
get-tokens-graph

Get tokens graph

read-only idempotent
get-users-graph-returns-unique

Get users graph. Returns unique user count across different time buckets

read-only idempotent
get-users-requests-graph-returns

Get users requests graph. Returns average requests per user across different time buckets

read-only idempotent

Capability Spec

portkey-analytics-graphs.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Portkey API — Analytics > Graphs
  description: 'Portkey API — Analytics > Graphs. 17 operations. Lead operation: Get cache hit rate graph. Self-contained
    Naftiko capability covering one Portkey business surface.'
  tags:
  - Portkey
  - Analytics > Graphs
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PORTKEY_API_KEY: PORTKEY_API_KEY
capability:
  consumes:
  - type: http
    namespace: portkey-analytics-graphs
    baseUri: https://api.portkey.ai/v1
    description: Portkey API — Analytics > Graphs business capability. Self-contained, no shared references.
    resources:
    - name: analytics-graphs-cache-hit-rate
      path: /analytics/graphs/cache/hit-rate
      operations:
      - name: get
        method: GET
        description: Get cache hit rate graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-cache-latency
      path: /analytics/graphs/cache/latency
      operations:
      - name: get
        method: GET
        description: Get cache hit latency graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-cost
      path: /analytics/graphs/cost
      operations:
      - name: get
        method: GET
        description: Get cost graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-errors
      path: /analytics/graphs/errors
      operations:
      - name: get
        method: GET
        description: Get errors graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-errors-rate
      path: /analytics/graphs/errors/rate
      operations:
      - name: get
        method: GET
        description: Get percentage error rate graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-errors-stacks
      path: /analytics/graphs/errors/stacks
      operations:
      - name: get
        method: GET
        description: Get status code wise stacked error graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-errors-status-codes
      path: /analytics/graphs/errors/status-codes
      operations:
      - name: get
        method: GET
        description: Get status code wise grouped error graph.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-feedbacks
      path: /analytics/graphs/feedbacks
      operations:
      - name: get
        method: GET
        description: Get feedbacks graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-feedbacks-ai-models
      path: /analytics/graphs/feedbacks/ai-models
      operations:
      - name: get
        method: GET
        description: Get feedbacks per ai_models graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-feedbacks-scores
      path: /analytics/graphs/feedbacks/scores
      operations:
      - name: get
        method: GET
        description: Get score-wise feedbacks distribution graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-feedbacks-weighted
      path: /analytics/graphs/feedbacks/weighted
      operations:
      - name: get
        method: GET
        description: Get weighted feedbacks graph. Weighted feedback is (value * score)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-latency
      path: /analytics/graphs/latency
      operations:
      - name: get
        method: GET
        description: Get latency graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-requests
      path: /analytics/graphs/requests
      operations:
      - name: get
        method: GET
        description: Get requests graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-requests-rescued
      path: /analytics/graphs/requests/rescued
      operations:
      - name: get
        method: GET
        description: Get retry and fallback rescued requests graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-tokens
      path: /analytics/graphs/tokens
      operations:
      - name: get
        method: GET
        description: Get tokens graph
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-users
      path: /analytics/graphs/users
      operations:
      - name: get
        method: GET
        description: Get users graph. Returns unique user count across different time buckets
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: analytics-graphs-users-requests
      path: /analytics/graphs/users/requests
      operations:
      - name: get
        method: GET
        description: Get users requests graph. Returns average requests per user across different time buckets
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      token: '{{env.PORTKEY_API_KEY}}'
  exposes:
  - type: rest
    namespace: portkey-analytics-graphs-rest
    port: 8080
    description: REST adapter for Portkey API — Analytics > Graphs. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/analytics/graphs/cache/hit-rate
      name: analytics-graphs-cache-hit-rate
      description: REST surface for analytics-graphs-cache-hit-rate.
      operations:
      - method: GET
        name: get
        description: Get cache hit rate graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/cache/latency
      name: analytics-graphs-cache-latency
      description: REST surface for analytics-graphs-cache-latency.
      operations:
      - method: GET
        name: get
        description: Get cache hit latency graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/cost
      name: analytics-graphs-cost
      description: REST surface for analytics-graphs-cost.
      operations:
      - method: GET
        name: get
        description: Get cost graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/errors
      name: analytics-graphs-errors
      description: REST surface for analytics-graphs-errors.
      operations:
      - method: GET
        name: get
        description: Get errors graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/errors/rate
      name: analytics-graphs-errors-rate
      description: REST surface for analytics-graphs-errors-rate.
      operations:
      - method: GET
        name: get
        description: Get percentage error rate graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/errors/stacks
      name: analytics-graphs-errors-stacks
      description: REST surface for analytics-graphs-errors-stacks.
      operations:
      - method: GET
        name: get
        description: Get status code wise stacked error graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/errors/status-codes
      name: analytics-graphs-errors-status-codes
      description: REST surface for analytics-graphs-errors-status-codes.
      operations:
      - method: GET
        name: get
        description: Get status code wise grouped error graph.
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/feedbacks
      name: analytics-graphs-feedbacks
      description: REST surface for analytics-graphs-feedbacks.
      operations:
      - method: GET
        name: get
        description: Get feedbacks graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/feedbacks/ai-models
      name: analytics-graphs-feedbacks-ai-models
      description: REST surface for analytics-graphs-feedbacks-ai-models.
      operations:
      - method: GET
        name: get
        description: Get feedbacks per ai_models graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/feedbacks/scores
      name: analytics-graphs-feedbacks-scores
      description: REST surface for analytics-graphs-feedbacks-scores.
      operations:
      - method: GET
        name: get
        description: Get score-wise feedbacks distribution graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/feedbacks/weighted
      name: analytics-graphs-feedbacks-weighted
      description: REST surface for analytics-graphs-feedbacks-weighted.
      operations:
      - method: GET
        name: get
        description: Get weighted feedbacks graph. Weighted feedback is (value * score)
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/latency
      name: analytics-graphs-latency
      description: REST surface for analytics-graphs-latency.
      operations:
      - method: GET
        name: get
        description: Get latency graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/requests
      name: analytics-graphs-requests
      description: REST surface for analytics-graphs-requests.
      operations:
      - method: GET
        name: get
        description: Get requests graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/requests/rescued
      name: analytics-graphs-requests-rescued
      description: REST surface for analytics-graphs-requests-rescued.
      operations:
      - method: GET
        name: get
        description: Get retry and fallback rescued requests graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/tokens
      name: analytics-graphs-tokens
      description: REST surface for analytics-graphs-tokens.
      operations:
      - method: GET
        name: get
        description: Get tokens graph
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/users
      name: analytics-graphs-users
      description: REST surface for analytics-graphs-users.
      operations:
      - method: GET
        name: get
        description: Get users graph. Returns unique user count across different time buckets
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/analytics/graphs/users/requests
      name: analytics-graphs-users-requests
      description: REST surface for analytics-graphs-users-requests.
      operations:
      - method: GET
        name: get
        description: Get users requests graph. Returns average requests per user across different time buckets
        call: portkey-analytics-graphs.get
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: portkey-analytics-graphs-mcp
    port: 9090
    transport: http
    description: MCP adapter for Portkey API — Analytics > Graphs. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: get-cache-hit-rate-graph
      description: Get cache hit rate graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-cache-hit-latency-graph
      description: Get cache hit latency graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-cost-graph
      description: Get cost graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-errors-graph
      description: Get errors graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-percentage-error-rate-graph
      description: Get percentage error rate graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-status-code-wise-stacked
      description: Get status code wise stacked error graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-status-code-wise-grouped
      description: Get status code wise grouped error graph.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-feedbacks-graph
      description: Get feedbacks graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-feedbacks-per-ai-models
      description: Get feedbacks per ai_models graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-score-wise-feedbacks-distribution
      description: Get score-wise feedbacks distribution graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-weighted-feedbacks-graph-weighted
      description: Get weighted feedbacks graph. Weighted feedback is (value * score)
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-latency-graph
      description: Get latency graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-requests-graph
      description: Get requests graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-retry-and-fallback-rescued
      description: Get retry and fallback rescued requests graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-tokens-graph
      description: Get tokens graph
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-users-graph-returns-unique
      description: Get users graph. Returns unique user count across different time buckets
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-users-requests-graph-returns
      description: Get users requests graph. Returns average requests per user across different time buckets
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-analytics-graphs.get
      outputParameters:
      - type: object
        mapping: $.