Completion API
The Completion API provides advanced text generation capabilities. Use it for content creation, summarization, and more.
Overview
The Completion API generates text based on a prompt you provide. It's ideal for chatbots, content tools, and productivity apps.
Endpoint
POST https://api.ketivee.com/v1/completion
Request
{
"prompt": "Write a poem about AI.",
"max_tokens": 64
}
Response
{
"data": {
"completion": "AI, the spark of modern mind..."
}
}
Example
fetch('https://api.ketivee.com/v1/completion', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'Write a poem about AI.',
max_tokens: 64
})
})
.then(res => res.json())
.then(console.log);