curl --request POST \
--url https://api.lithosai.cloud/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "moonshotai/Kimi-K3",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>"
}
],
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 1,
"top_p": 1,
"top_k": 123,
"n": 1,
"stop": "<string>",
"stream": false,
"stream_options": {
"include_usage": true
},
"presence_penalty": 0,
"frequency_penalty": 0,
"seed": 123,
"logprobs": true,
"top_logprobs": 123,
"logit_bias": {},
"response_format": {},
"reasoning_effort": "<string>",
"tools": [
{}
],
"tool_choice": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.lithosai.cloud/v1/chat/completions"
payload = {
"model": "moonshotai/Kimi-K3",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>"
}
],
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 1,
"top_p": 1,
"top_k": 123,
"n": 1,
"stop": "<string>",
"stream": False,
"stream_options": { "include_usage": True },
"presence_penalty": 0,
"frequency_penalty": 0,
"seed": 123,
"logprobs": True,
"top_logprobs": 123,
"logit_bias": {},
"response_format": {},
"reasoning_effort": "<string>",
"tools": [{}],
"tool_choice": "<string>",
"user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'moonshotai/Kimi-K3',
messages: [
{
content: '<string>',
name: '<string>',
tool_calls: [{}],
tool_call_id: '<string>'
}
],
max_tokens: 2,
max_completion_tokens: 2,
temperature: 1,
top_p: 1,
top_k: 123,
n: 1,
stop: '<string>',
stream: false,
stream_options: {include_usage: true},
presence_penalty: 0,
frequency_penalty: 0,
seed: 123,
logprobs: true,
top_logprobs: 123,
logit_bias: {},
response_format: {},
reasoning_effort: '<string>',
tools: [{}],
tool_choice: '<string>',
user: '<string>'
})
};
fetch('https://api.lithosai.cloud/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lithosai.cloud/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'moonshotai/Kimi-K3',
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>'
]
],
'max_tokens' => 2,
'max_completion_tokens' => 2,
'temperature' => 1,
'top_p' => 1,
'top_k' => 123,
'n' => 1,
'stop' => '<string>',
'stream' => false,
'stream_options' => [
'include_usage' => true
],
'presence_penalty' => 0,
'frequency_penalty' => 0,
'seed' => 123,
'logprobs' => true,
'top_logprobs' => 123,
'logit_bias' => [
],
'response_format' => [
],
'reasoning_effort' => '<string>',
'tools' => [
[
]
],
'tool_choice' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lithosai.cloud/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lithosai.cloud/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithosai.cloud/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{}
]
},
"finish_reason": "stop",
"logprobs": {}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}{
"error": {
"message": "invalid API key",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}{
"error": {
"message": "the model `nope` does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}Create a chat completion
Generates a completion for the supplied conversation.
Set stream: true to receive Server-Sent Events. Most chunks carry
a usage object: the opening role delta and the chunk carrying finish_reason omit
it. The final chunk before [DONE] reports the totals with an empty choices
array.
Sampling constraints are per model. The bounds in this schema are the OpenAI-wire bounds, not the per-model ones.
Retry 429 and 5xx with exponential backoff and jitter. Prefer the delay we advise,
retry-after-ms first and then retry-after, over an interval of your own. Do not
retry 400, 401, 402 or 404, and do not retry anything carrying x-should-retry: false:
the answer will not change until you do something about it.
A 429 means one of your three per-minute budgets is empty. See Rate limits for what they are and how to read the headers that report them.
curl --request POST \
--url https://api.lithosai.cloud/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "moonshotai/Kimi-K3",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>"
}
],
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 1,
"top_p": 1,
"top_k": 123,
"n": 1,
"stop": "<string>",
"stream": false,
"stream_options": {
"include_usage": true
},
"presence_penalty": 0,
"frequency_penalty": 0,
"seed": 123,
"logprobs": true,
"top_logprobs": 123,
"logit_bias": {},
"response_format": {},
"reasoning_effort": "<string>",
"tools": [
{}
],
"tool_choice": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.lithosai.cloud/v1/chat/completions"
payload = {
"model": "moonshotai/Kimi-K3",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>"
}
],
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 1,
"top_p": 1,
"top_k": 123,
"n": 1,
"stop": "<string>",
"stream": False,
"stream_options": { "include_usage": True },
"presence_penalty": 0,
"frequency_penalty": 0,
"seed": 123,
"logprobs": True,
"top_logprobs": 123,
"logit_bias": {},
"response_format": {},
"reasoning_effort": "<string>",
"tools": [{}],
"tool_choice": "<string>",
"user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'moonshotai/Kimi-K3',
messages: [
{
content: '<string>',
name: '<string>',
tool_calls: [{}],
tool_call_id: '<string>'
}
],
max_tokens: 2,
max_completion_tokens: 2,
temperature: 1,
top_p: 1,
top_k: 123,
n: 1,
stop: '<string>',
stream: false,
stream_options: {include_usage: true},
presence_penalty: 0,
frequency_penalty: 0,
seed: 123,
logprobs: true,
top_logprobs: 123,
logit_bias: {},
response_format: {},
reasoning_effort: '<string>',
tools: [{}],
tool_choice: '<string>',
user: '<string>'
})
};
fetch('https://api.lithosai.cloud/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lithosai.cloud/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'moonshotai/Kimi-K3',
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>'
]
],
'max_tokens' => 2,
'max_completion_tokens' => 2,
'temperature' => 1,
'top_p' => 1,
'top_k' => 123,
'n' => 1,
'stop' => '<string>',
'stream' => false,
'stream_options' => [
'include_usage' => true
],
'presence_penalty' => 0,
'frequency_penalty' => 0,
'seed' => 123,
'logprobs' => true,
'top_logprobs' => 123,
'logit_bias' => [
],
'response_format' => [
],
'reasoning_effort' => '<string>',
'tools' => [
[
]
],
'tool_choice' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lithosai.cloud/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lithosai.cloud/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithosai.cloud/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 123,\n \"n\": 1,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"seed\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"logit_bias\": {},\n \"response_format\": {},\n \"reasoning_effort\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{}
]
},
"finish_reason": "stop",
"logprobs": {}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}{
"error": {
"message": "invalid API key",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}{
"error": {
"message": "the model `nope` does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "invalid_json"
}
}Authorizations
A key created on the API Keys console page, sent as Authorization: Bearer <key>.
Body
The model id, e.g. moonshotai/Kimi-K3.
"moonshotai/Kimi-K3"
1Show child attributes
Show child attributes
x >= 1x >= 10 <= x <= 2Prod-flagged Kimi-K3 engines require a value in [0.95, 1.0].
0 <= x <= 1Non-standard sampling parameter; accepted by LithosAI.
Kimi-K3 requires 1.
Show child attributes
Show child attributes
Kimi-K3 requires 0.0.
-2 <= x <= 2Kimi-K3 requires 0.0.
-2 <= x <= 2Show child attributes
Show child attributes