Skip to main content
POST
/
api
/
experiments
/
{experiment_id}
/
columns
{
  "columns": [
    {
      "id": "68a8b20d-f00b-4c10-9ae1-d64424da6e15",
      "model": "gpt-3.5-turbo",
      "name": "Prompt version generation - AAA",
      "temperature": 0.7,
      "max_completion_tokens": 256,
      "prompt_messages": [
        {
          "role": "system",
          "content": [{"text": "You are a helpful assistant", "type": "text"}]
        },
        {
          "role": "user",
          "content": [{"text": "{{input}}", "type": "text"}]
        }
      ]
    }
  ]
}
{
  "added": 1,
  "columns": []
}
Add columns to an experiment.

Authentication

  • API key: Authorization: Bearer <API key>

Path Parameters

experiment_id
string
required
The ID of the experiment to add columns to.

Request Body

{
  "columns": [
    {
      "id": "68a8b20d-f00b-4c10-9ae1-d64424da6e15",
      "model": "gpt-3.5-turbo",
      "name": "Prompt version generation - AAA",
      "temperature": 0.7,
      "max_completion_tokens": 256,
      "prompt_messages": [
        {
          "role": "system",
          "content": [{"text": "You are a helpful assistant", "type": "text"}]
        },
        {
          "role": "user",
          "content": [{"text": "{{input}}", "type": "text"}]
        }
      ]
    }
  ]
}

Examples

import requests

experiment_id = "experiment_id_123"
url = f"https://api.keywordsai.co/api/experiments/{experiment_id}/columns"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "columns": [
        {
            "model": "gpt-3.5-turbo",
            "name": "Test Column",
            "prompt_messages": [
                {"role": "user", "content": [{"text": "{{input}}", "type": "text"}]}
            ]
        }
    ]
}

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

Response

{
  "added": 1,
  "columns": []
}