Skip to content
API referenceGet prompt analytics

Get prompt analytics

GET/v1/prompts/{slug}/analytics

Get prompt analytics.

Returns the requests attributed to the prompt in a time window (prompt completions, and other requests sent with x-prompt-slug): count, cost, latency and cache hit rate, in total and per version. Only the prompt's own organization's requests made with a virtual key or a routing config count. Requires membership of the prompt's workspace (organization admins have it). 404 when the prompt does not exist.

Authorization

  • AuthorizationBearer va_

    A platform API key (va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.

Path parameters

  • slugstringrequired

    the prompt's slug

Query parameters

  • organizationstringrequired

    slug of the organization that owns it

  • fromstring<date-time>

    start of the window (ISO 8601 date-time, inclusive). Default: 30 days before to

  • tostring<date-time>

    end of the window (ISO 8601 date-time, exclusive). Default: now

Responses

200application/json
  • prompt_slugstring

    Slug of the prompt.

  • time_window_startstring<date-time>

    Start of the window, inclusive (ISO 8601).

  • time_window_endstring<date-time>

    End of the window, exclusive (ISO 8601).

  • total_requestsinteger<int64>

    Requests in the window, across all versions.

  • total_cost_usdnumber<double>

    Total cost in USD across all versions. Requests answered from the cache cost 0.

  • avg_duration_msnumber<double>

    The mean of the versions' average request durations, in milliseconds: each version counts once, whatever its number of requests. 0 when there were no requests.

  • p95_duration_msnumber<double>

    The highest of the versions' 95th-percentile request durations, in milliseconds. Null when there were no requests.

  • cache_hit_ratenumber<double>

    The mean of the versions' cache hit rates, from 0 to 1: each version counts once. 0 when there were no requests.

  • by_versionobject[]

    Figures per version, highest version first.

    Child attributes
    • version_numberinteger<int32>

      The prompt version. Null for requests attributed to the prompt without a version.

    • total_requestsinteger<int64>

      Requests in the window.

    • total_cost_usdnumber<double>

      Total cost in USD. Requests answered from the cache cost 0.

    • avg_duration_msnumber<double>

      Average request duration, in milliseconds.

    • p95_duration_msnumber<double>

      95th-percentile request duration, in milliseconds.

    • cache_hit_ratenumber<double>

      Share of requests answered from the cache (exact or semantic hit), from 0 to 1.

NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.