Prompts
Create prompt
POST
/
api
/
prompts
/
import requests
url = "https://api.keywordsai.co/api/prompts/"
api_key = "YOUR_KEYWORDS_AI_API_KEY" # Replace with your actual Keywords AI API key
data = {
"name": "Your Prompt Name",
"description": "Your Prompt Description"
}
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
// Define the function with TypeScript
fetch('https://api.keywordsai.co/api/prompts/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_KEYWORDS_AI_API_KEY'
},
body: JSON.stringify({
name: "Your Prompt Name",
description: "Your Prompt Description"
})
})
.then(response => response.json())
.then(data => console.log(data));
You can create a prompt by sending a POST request to the prompts endpoint. The request should include the name of the prompt and an optional description.
After you created a prompt, you can create versions of the prompt by sending a POST request to the prompt versions endpoint.
string
required
The name of the prompt.
string
Description of the prompt
import requests
url = "https://api.keywordsai.co/api/prompts/"
api_key = "YOUR_KEYWORDS_AI_API_KEY" # Replace with your actual Keywords AI API key
data = {
"name": "Your Prompt Name",
"description": "Your Prompt Description"
}
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
// Define the function with TypeScript
fetch('https://api.keywordsai.co/api/prompts/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_KEYWORDS_AI_API_KEY'
},
body: JSON.stringify({
name: "Your Prompt Name",
description: "Your Prompt Description"
})
})
.then(response => response.json())
.then(data => console.log(data));
Was this page helpful?
⌘I
import requests
url = "https://api.keywordsai.co/api/prompts/"
api_key = "YOUR_KEYWORDS_AI_API_KEY" # Replace with your actual Keywords AI API key
data = {
"name": "Your Prompt Name",
"description": "Your Prompt Description"
}
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
// Define the function with TypeScript
fetch('https://api.keywordsai.co/api/prompts/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_KEYWORDS_AI_API_KEY'
},
body: JSON.stringify({
name: "Your Prompt Name",
description: "Your Prompt Description"
})
})
.then(response => response.json())
.then(data => console.log(data));