AI Configs

Get AI Config metrics by variation

Retrieve usage metrics for an AI Config by config key, with results split by variation.

get/api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics-by-variation

Path parameters

projectKeystring required
configKeystring required

Query parameters

frominteger required

The starting time, as milliseconds since epoch (inclusive).

tointeger required

The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after from.

envstring required

An environment key. Only metrics from this environment will be included.

Response

Metrics computed

variationKeystring

Example response

[
  {
    "metrics": {
      "judgeRelevance": 0.14894159,
      "inputCost": 7.386281948385884,
      "outputCost": 1.2315135367772556,
      "generationSuccessCount": 5,
      "inputTokens": 0,
      "generationErrorCount": 2,
      "thumbsDown": 9,
      "judgeToxicity": 0.6846853,
      "totalTokens": 1,
      "judgeAccuracy": 0.10246457,
      "generationCount": 5,
      "timeToFirstTokenMs": 2,
      "outputTokens": 6,
      "thumbsUp": 7,
      "durationMs": 3,
      "satisfactionRating": 0.4145608
    },
    "variationKey": "variationKey"
  }
]

Changes

Changed in 1 of the 5 revisions of this API.15

  • 69c5c9aafe7815See the full diff
    • deleted the header request parameter LD-API-Version

      request-parameter-removed

    • api tag AI Configs added

      api-tag-added

    • api tag AI Configs (beta) removed

      api-tag-removed

    • added the optional property items/metrics/judgeAccuracy to the response with the 200 status

      response-optional-property-added

    • added the optional property items/metrics/judgeRelevance to the response with the 200 status

      response-optional-property-added

    • added the optional property items/metrics/judgeToxicity to the response with the 200 status

      response-optional-property-added

    This revision also has 13 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog