curl --request POST \
--url https://api.akumi.eu/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "<string>",
"models": [
"<string>"
],
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"allow_fallbacks": true,
"require_parameters": true
},
"temperature": 123,
"max_tokens": 2,
"stream": true,
"stream_options": {
"include_usage": true
},
"firewall": true,
"collection": [
"<string>"
],
"user": "<string>",
"thread": "<string>",
"tags": [
"<string>"
],
"name": "<string>",
"top_p": 0.5,
"stop": [
"<string>"
],
"presence_penalty": 0,
"frequency_penalty": 0,
"n": 2,
"seed": 123,
"logit_bias": [
0
],
"logprobs": true,
"top_logprobs": 10,
"max_completion_tokens": 2,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": [
"<string>"
]
}
}
],
"tool_choice": "<string>",
"parallel_tool_calls": true,
"cache": true,
"response_format": {
"json_schema": {
"name": "<string>",
"schema": [
"<string>"
],
"strict": true
}
}
}
'import requests
url = "https://api.akumi.eu/v1/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "<string>",
"models": ["<string>"],
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"allow_fallbacks": True,
"require_parameters": True
},
"temperature": 123,
"max_tokens": 2,
"stream": True,
"stream_options": { "include_usage": True },
"firewall": True,
"collection": ["<string>"],
"user": "<string>",
"thread": "<string>",
"tags": ["<string>"],
"name": "<string>",
"top_p": 0.5,
"stop": ["<string>"],
"presence_penalty": 0,
"frequency_penalty": 0,
"n": 2,
"seed": 123,
"logit_bias": [0],
"logprobs": True,
"top_logprobs": 10,
"max_completion_tokens": 2,
"tools": [{ "function": {
"name": "<string>",
"description": "<string>",
"parameters": ["<string>"]
} }],
"tool_choice": "<string>",
"parallel_tool_calls": True,
"cache": True,
"response_format": { "json_schema": {
"name": "<string>",
"schema": ["<string>"],
"strict": True
} }
}
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({
messages: [
{
content: '<string>',
name: '<string>',
tool_call_id: '<string>',
tool_calls: [{id: '<string>', function: {name: '<string>', arguments: '<string>'}}]
}
],
model: '<string>',
models: ['<string>'],
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
allow_fallbacks: true,
require_parameters: true
},
temperature: 123,
max_tokens: 2,
stream: true,
stream_options: {include_usage: true},
firewall: true,
collection: ['<string>'],
user: '<string>',
thread: '<string>',
tags: ['<string>'],
name: '<string>',
top_p: 0.5,
stop: ['<string>'],
presence_penalty: 0,
frequency_penalty: 0,
n: 2,
seed: 123,
logit_bias: [0],
logprobs: true,
top_logprobs: 10,
max_completion_tokens: 2,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: ['<string>']}
}
],
tool_choice: '<string>',
parallel_tool_calls: true,
cache: true,
response_format: {json_schema: {name: '<string>', schema: ['<string>'], strict: true}}
})
};
fetch('https://api.akumi.eu/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.akumi.eu/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([
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_call_id' => '<string>',
'tool_calls' => [
[
'id' => '<string>',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'model' => '<string>',
'models' => [
'<string>'
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'allow_fallbacks' => true,
'require_parameters' => true
],
'temperature' => 123,
'max_tokens' => 2,
'stream' => true,
'stream_options' => [
'include_usage' => true
],
'firewall' => true,
'collection' => [
'<string>'
],
'user' => '<string>',
'thread' => '<string>',
'tags' => [
'<string>'
],
'name' => '<string>',
'top_p' => 0.5,
'stop' => [
'<string>'
],
'presence_penalty' => 0,
'frequency_penalty' => 0,
'n' => 2,
'seed' => 123,
'logit_bias' => [
0
],
'logprobs' => true,
'top_logprobs' => 10,
'max_completion_tokens' => 2,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
'<string>'
]
]
]
],
'tool_choice' => '<string>',
'parallel_tool_calls' => true,
'cache' => true,
'response_format' => [
'json_schema' => [
'name' => '<string>',
'schema' => [
'<string>'
],
'strict' => true
]
]
]),
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.akumi.eu/v1/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\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.akumi.eu/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.akumi.eu/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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\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>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123
},
"credits": {
"base": 123,
"services": 123,
"total": 123
}
},
"sources": [
{}
]
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Create a chat completion
OpenAI-compatible: point an existing OpenAI client at this base URL and change
nothing else. Pass a single model, or an ordered models chain to fall back
automatically when a provider is unavailable. Every request is metered and
audited.
curl --request POST \
--url https://api.akumi.eu/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "<string>",
"models": [
"<string>"
],
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"allow_fallbacks": true,
"require_parameters": true
},
"temperature": 123,
"max_tokens": 2,
"stream": true,
"stream_options": {
"include_usage": true
},
"firewall": true,
"collection": [
"<string>"
],
"user": "<string>",
"thread": "<string>",
"tags": [
"<string>"
],
"name": "<string>",
"top_p": 0.5,
"stop": [
"<string>"
],
"presence_penalty": 0,
"frequency_penalty": 0,
"n": 2,
"seed": 123,
"logit_bias": [
0
],
"logprobs": true,
"top_logprobs": 10,
"max_completion_tokens": 2,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": [
"<string>"
]
}
}
],
"tool_choice": "<string>",
"parallel_tool_calls": true,
"cache": true,
"response_format": {
"json_schema": {
"name": "<string>",
"schema": [
"<string>"
],
"strict": true
}
}
}
'import requests
url = "https://api.akumi.eu/v1/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "<string>",
"models": ["<string>"],
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"allow_fallbacks": True,
"require_parameters": True
},
"temperature": 123,
"max_tokens": 2,
"stream": True,
"stream_options": { "include_usage": True },
"firewall": True,
"collection": ["<string>"],
"user": "<string>",
"thread": "<string>",
"tags": ["<string>"],
"name": "<string>",
"top_p": 0.5,
"stop": ["<string>"],
"presence_penalty": 0,
"frequency_penalty": 0,
"n": 2,
"seed": 123,
"logit_bias": [0],
"logprobs": True,
"top_logprobs": 10,
"max_completion_tokens": 2,
"tools": [{ "function": {
"name": "<string>",
"description": "<string>",
"parameters": ["<string>"]
} }],
"tool_choice": "<string>",
"parallel_tool_calls": True,
"cache": True,
"response_format": { "json_schema": {
"name": "<string>",
"schema": ["<string>"],
"strict": True
} }
}
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({
messages: [
{
content: '<string>',
name: '<string>',
tool_call_id: '<string>',
tool_calls: [{id: '<string>', function: {name: '<string>', arguments: '<string>'}}]
}
],
model: '<string>',
models: ['<string>'],
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
allow_fallbacks: true,
require_parameters: true
},
temperature: 123,
max_tokens: 2,
stream: true,
stream_options: {include_usage: true},
firewall: true,
collection: ['<string>'],
user: '<string>',
thread: '<string>',
tags: ['<string>'],
name: '<string>',
top_p: 0.5,
stop: ['<string>'],
presence_penalty: 0,
frequency_penalty: 0,
n: 2,
seed: 123,
logit_bias: [0],
logprobs: true,
top_logprobs: 10,
max_completion_tokens: 2,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: ['<string>']}
}
],
tool_choice: '<string>',
parallel_tool_calls: true,
cache: true,
response_format: {json_schema: {name: '<string>', schema: ['<string>'], strict: true}}
})
};
fetch('https://api.akumi.eu/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.akumi.eu/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([
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_call_id' => '<string>',
'tool_calls' => [
[
'id' => '<string>',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'model' => '<string>',
'models' => [
'<string>'
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'allow_fallbacks' => true,
'require_parameters' => true
],
'temperature' => 123,
'max_tokens' => 2,
'stream' => true,
'stream_options' => [
'include_usage' => true
],
'firewall' => true,
'collection' => [
'<string>'
],
'user' => '<string>',
'thread' => '<string>',
'tags' => [
'<string>'
],
'name' => '<string>',
'top_p' => 0.5,
'stop' => [
'<string>'
],
'presence_penalty' => 0,
'frequency_penalty' => 0,
'n' => 2,
'seed' => 123,
'logit_bias' => [
0
],
'logprobs' => true,
'top_logprobs' => 10,
'max_completion_tokens' => 2,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
'<string>'
]
]
]
],
'tool_choice' => '<string>',
'parallel_tool_calls' => true,
'cache' => true,
'response_format' => [
'json_schema' => [
'name' => '<string>',
'schema' => [
'<string>'
],
'strict' => true
]
]
]),
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.akumi.eu/v1/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\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.akumi.eu/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.akumi.eu/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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_parameters\": true\n },\n \"temperature\": 123,\n \"max_tokens\": 2,\n \"stream\": true,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"firewall\": true,\n \"collection\": [\n \"<string>\"\n ],\n \"user\": \"<string>\",\n \"thread\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"top_p\": 0.5,\n \"stop\": [\n \"<string>\"\n ],\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"n\": 2,\n \"seed\": 123,\n \"logit_bias\": [\n 0\n ],\n \"logprobs\": true,\n \"top_logprobs\": 10,\n \"max_completion_tokens\": 2,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"cache\": true,\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": [\n \"<string>\"\n ],\n \"strict\": true\n }\n }\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>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123
},
"credits": {
"base": 123,
"services": 123,
"total": 123
}
},
"sources": [
{}
]
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Your own id for this request, which becomes the platform's request id. A retry carrying the same key is matched to the first request's usage record rather than billed again, so make it unique per request. A generated uuid is used when absent.
The application making this request, shown and filtered on in the trace explorer. The same string on every request a deployment sends, so an SDK sets it once. Up to 120 characters; a longer value is ignored rather than cut.
120Your own W3C trace context. The trace id and the incoming span id are recorded on the trace so it can be lined up with the same request in your APM. A value that cannot be parsed is ignored rather than rejected.
Body
The per-file caps below bound one attachment. This bounds the body they arrive in, which is the number a provider actually enforces.
1Show child attributes
Show child attributes
Exactly one of model / models is required: a single model slug,
or an ordered chain of slugs/aliases to try in turn (see RouteIntent
and RoutePlanner). prohibits:models on model is what turns
sending both into a 422 rather than models silently winning.
1The provider preferences object (OpenRouter-parity routing
controls). Every field may only narrow what workspace policy
already permits; see App\Services\Inference\Data\ProviderPreferences.
Show child attributes
Show child attributes
x >= 1OpenAI's opt-in for a trailing usage-only chunk on streamed responses. Usage is always attached to the finish chunk regardless (see RunChatCompletion::streamResponse()); this only controls the additional empty-choices frame emitted after it.
Show child attributes
Show child attributes
Defaults true. Set false to opt out of the firewall and accept non-EU routing; honoured only when the organization has recorded a compliance acceptance, otherwise the egress guard refuses the call.
The language the firewall analyses this request as, overriding
the workspace's setting for this call only. auto detects per
message. A caller sending several languages needs this per call
rather than a workspace each; one that always sends the same
language should set it on the workspace and omit it here.
auto, nl, en, fr, de Narrows retrieval to named knowledge collections. Omit it (the default) to blend the whole workspace: personal memory, the workspace's shared knowledge, and every collection in it. Pass a collection slug, or a list of slugs, to read only those plus the caller's own personal memory. A slug the workspace does not have is rejected, never ignored.
255Optional end-user id (OpenAI's user). Scopes long-term memory facts.
255Optional conversation id, chosen by the caller. Groups this call with every other call that sends the same one on its trace; it changes nothing about how the request is served.
255Free-form labels recorded on the trace, at most ten of at most 64 characters each. They do not change how the request is served: they make the trace explorer able to answer questions about it afterwards.
1064A human label for this request, shown on its trace.
1200 <= x <= 1stop accepts a bare string or an array of strings; stop.* validates
array elements when an array is supplied but does not apply to a scalar.
-2 <= x <= 2-2 <= x <= 2x >= 1-100 <= x <= 1000 <= x <= 20x >= 1Show child attributes
Show child attributes
tool_choice may be a string ('none'|'auto'|'required') OR an object ({type:'function',function:{name}}); the controller normalises it downstream.
How hard a reasoning model thinks. A level the model does not take is refused in strict mode and dropped otherwise.
high, low, max, medium, minimal, none, xhigh, null Set false to bypass the response cache for this request even when the Cache service is enabled and the request would otherwise be cacheable. Defaults true (cache enabled when service is on).
Show child attributes
Show child attributes