Authentication
- API key:
Authorization: Bearer <API key>
Path Parameters
The ID of the experiment to add columns to.
{
"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": []
}
Authorization: Bearer <API key>{
"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"}]
}
]
}
]
}
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())
{
"added": 1,
"columns": []
}
Was this page helpful?
{
"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": []
}