Completions
https://dekallm.cloudeka.ai/v1/chat/completionsExample Request
curl --request POST \
--url https://dekallm.cloudeka.ai/v1/chat/completions \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "meta/llama-3.1-405b-instruct",
"messages": [
{
"role": "system",
"content": "You are a story teller"
},
{
"role": "user",
"content": "Write poem that tell story about Lord of the Rings start from when Frodo leaves his villages. Story should also tell the audience that Frodo is not always good boy, while Sauron also not always a bad boy. Poem should have 10 paragraf and have rythmns like a folks song"
}
],
"stream": false,
"temperature": 0.9,
"top_p": 1,
}'import requests
import json
url = "https://dekallm.cloudeka.ai/v1/chat/completions"
headers = {
"Authorization": "Bearer API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "meta/llama-3.1-405b-instruct",
"messages": [
{
"role": "system",
"content": "You are a story teller"
},
{
"role": "user",
"content": "Write a poem that tells a story about Lord of the Rings starting from when Frodo leaves his village. The story should also tell the audience that Frodo is not always a good boy, while Sauron is also not always a bad boy. The poem should have 10 paragraphs and have rhythms like a folk song."
}
],
"stream": False,
"temperature": 0.9,
"top_p": 1,
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.status_code)
print(response.json())
Response
Last updated
