curl --request POST \
--url 'https://api.elkapi.com/v1/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "text_completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"text": "Hello, please introduce yourself",
"index": 1,
"finish_reason": "finish_reason"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
Native OpenAI Format
Completions
- Create a text completion from the provided prompt
POST
/
v1
/
completions
curl --request POST \
--url 'https://api.elkapi.com/v1/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "text_completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"text": "Hello, please introduce yourself",
"index": 1,
"finish_reason": "finish_reason"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"max_tokens": 1024,
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "text_completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"text": "Hello, please introduce yourself",
"index": 1,
"finish_reason": "finish_reason"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY
Body
string
default:"gpt-5.5"
required
Example:
gpt-5.5string or array<string>
required
integer
number
number
integer
boolean
string or array<string>
string
boolean
Response
string
string
Example:
text_completioninteger
string
default:"gpt-5.5"
Example:
gpt-5.5⌘I