Skip to main content
POST
/
api
/
testsets
{
  "name": "Test API Key Dataset",
  "description": "Dataset for testing new features",
  "column_definitions": [
    {
      "field": "input"
    },
    {
      "field": "expected_output"
    }
  ],
  "starred": false
}
{
  "id": "testset_id_123",
  "name": "Test API Key Dataset",
  "description": "Dataset for testing new features",
  "column_definitions": [
    {"field": "input"},
    {"field": "expected_output"}
  ]
}
Create a new testset for evaluation.

Authentication

  • API key: Authorization: Bearer <API key>

Request Body

{
  "name": "Test API Key Dataset",
  "description": "Dataset for testing new features",
  "column_definitions": [
    {
      "field": "input"
    },
    {
      "field": "expected_output"
    }
  ],
  "starred": false
}

Examples

import requests

url = "https://api.keywordsai.co/api/testsets"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "name": "Test API Key Dataset",
    "description": "Dataset for testing new features",
    "column_definitions": [
        {"field": "input"},
        {"field": "expected_output"}
    ],
    "starred": False
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Response

{
  "id": "testset_id_123",
  "name": "Test API Key Dataset",
  "description": "Dataset for testing new features",
  "column_definitions": [
    {"field": "input"},
    {"field": "expected_output"}
  ]
}