Skip to main content
GET
https://api.keywordsai.co
/
api
/
logs
/
{log_id}
/
scores
/
{score_id}
import requests

url = "https://api.keywordsai.co/api/logs/{log_id}/scores/{score_id}/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
{
  "id": "eval_result_unique_id",
  "created_at": "2024-01-15T10:30:00Z",
  "type": "llm",
  "environment": "test",
  "numerical_value": 4.5,
  "string_value": "Good quality",
  "boolean_value": true,
  "categorical_value": ["excellent"],
  "is_passed": false,
  "cost": 0.0,
  "evaluator_id": null,
  "evaluator_slug": "quality_evaluator",
  "log_id": "log_unique_id",
  "dataset_id": null
}
Gets detailed information about a specific score for a log.
import requests

url = "https://api.keywordsai.co/api/logs/{log_id}/scores/{score_id}/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
{
  "id": "eval_result_unique_id",
  "created_at": "2024-01-15T10:30:00Z",
  "type": "llm",
  "environment": "test",
  "numerical_value": 4.5,
  "string_value": "Good quality",
  "boolean_value": true,
  "categorical_value": ["excellent"],
  "is_passed": false,
  "cost": 0.0,
  "evaluator_id": null,
  "evaluator_slug": "quality_evaluator",
  "log_id": "log_unique_id",
  "dataset_id": null
}

Score Enrichment in Logs

When you retrieve log details, scores are automatically included in the response under a scores field. This enriched format includes:
  • evaluator_name: Human-readable name of the evaluator
  • evaluator_slug: URL-friendly identifier
  • score_value: The actual score value (numerical, boolean, etc.)
Example enriched scores in a log response:
{
  "id": "log_abc123",
  "model": "gpt-4",
  "scores": {
    "550e8400-e29b-41d4-a716-446655440000": {
      "evaluator_name": "Response Quality",
      "evaluator_slug": "quality_v1",
      "score_value": 4.5
    }
  }
}

Score Summary Aggregations

Aggregated score summaries are available in summary endpoints. These show average scores for numerical evaluators and true/false counts for boolean evaluators:
  • Logs Summary: GET/POST /api/request-logs/summary/
  • Experiment Logs Summary: GET/POST /evaluations/experiments//logs/summary/
  • Dataset Logs Summary: GET/POST /api/datasets//logs/summary/
See the Logs Summary endpoint for complete details on the score summary format.