Evaluation Datasets

Manage test case collections for prompt and model evaluation.

Endpoints

MethodPathAuthDescription
POST/v1/eval/datasetsAPI KeyCreate dataset
GET/v1/eval/datasetsAPI KeyList datasets
GET/v1/eval/datasets/:idAPI KeyGet dataset
PUT/v1/eval/datasets/:idAPI KeyUpdate dataset
DELETE/v1/eval/datasets/:idAPI KeyDelete dataset + items
POST/v1/eval/datasets/:id/itemsAPI KeyAdd items (batch, max 100)
GET/v1/eval/datasets/:id/itemsAPI KeyList items
DELETE/v1/eval/datasets/:id/items/:itemIdAPI KeyDelete item
POST/v1/eval/datasets/:id/import-from-logsAPI KeyImport from prod logs
GET/v1/eval/datasets/:id/exportAPI KeyExport CSV or JSON

Create dataset

curl -X POST https://api.brainstormrouter.com/v1/eval/datasets \
  -H "Authorization: Bearer br_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Customer Support", "description": "Test cases for support prompts"}'

Add items

curl -X POST https://api.brainstormrouter.com/v1/eval/datasets/{id}/items \
  -H "Authorization: Bearer br_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {"input": {"topic": "billing"}, "expected_output": "I can help with billing."},
      {"input": {"topic": "refund"}, "expected_output": "To process a refund..."}
    ]
  }'

Maximum 100 items per batch.

Import from production logs

curl -X POST https://api.brainstormrouter.com/v1/eval/datasets/{id}/import-from-logs \
  -H "Authorization: Bearer br_live_..." \
  -d '{"model": "anthropic/claude-sonnet-5", "min_tokens": 100, "limit": 50}'

Imports request metadata from the completion_audit table as dataset items.

Export

# JSON
curl ".../v1/eval/datasets/{id}/export?format=json"

# CSV
curl ".../v1/eval/datasets/{id}/export?format=csv" > dataset.csv

CSV columns: input, expected_output, metadata.