Chat inference
Chat Completion
OpenAI-compatible chat completion. The request body follows the OpenAI Chat Completions API.
POST
/
chat-completion
Chat Completion
curl --request POST \
--url https://rei-api.reilabs.org/v1/chat-completion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "google/gemini-2.5-flash",
"temperature": 1,
"max_tokens": 2,
"top_p": 0.5,
"n": 2,
"seed": 4503599627370495.5,
"stream": true,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"user": "<string>",
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
}
}
]
}
'import requests
url = "https://rei-api.reilabs.org/v1/chat-completion"
payload = {
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "google/gemini-2.5-flash",
"temperature": 1,
"max_tokens": 2,
"top_p": 0.5,
"n": 2,
"seed": 4503599627370495.5,
"stream": True,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"user": "<string>",
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<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>',
type: 'function',
function: {name: '<string>', arguments: '<string>'}
}
]
}
],
model: 'google/gemini-2.5-flash',
temperature: 1,
max_tokens: 2,
top_p: 0.5,
n: 2,
seed: 4503599627370495.5,
stream: true,
stop: '<string>',
presence_penalty: 0,
frequency_penalty: 0,
logit_bias: {},
logprobs: true,
top_logprobs: 123,
user: '<string>',
tools: [
{
type: 'function',
function: {name: '<string>', parameters: {}, description: '<string>', strict: true}
}
]
})
};
fetch('https://rei-api.reilabs.org/v1/chat-completion', 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://rei-api.reilabs.org/v1/chat-completion",
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>',
'type' => 'function',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'model' => 'google/gemini-2.5-flash',
'temperature' => 1,
'max_tokens' => 2,
'top_p' => 0.5,
'n' => 2,
'seed' => 4503599627370495.5,
'stream' => true,
'stop' => '<string>',
'presence_penalty' => 0,
'frequency_penalty' => 0,
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'user' => '<string>',
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'parameters' => [
],
'description' => '<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://rei-api.reilabs.org/v1/chat-completion"
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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\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://rei-api.reilabs.org/v1/chat-completion")
.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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rei-api.reilabs.org/v1/chat-completion")
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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Authorizations
Unit API Key
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Model to use. Defaults to agent's configured model.
Available options:
google/gemini-2.5-flash Required range:
0 <= x <= 2Required range:
x >= 1Required range:
0 <= x <= 1Required range:
x >= 1Required range:
0 <= x <= 9007199254740991Required range:
-2 <= x <= 2Required range:
-2 <= x <= 2Token IDs as string keys, values between -100 and 100
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
none, auto ⌘I
Chat Completion
curl --request POST \
--url https://rei-api.reilabs.org/v1/chat-completion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "google/gemini-2.5-flash",
"temperature": 1,
"max_tokens": 2,
"top_p": 0.5,
"n": 2,
"seed": 4503599627370495.5,
"stream": true,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"user": "<string>",
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
}
}
]
}
'import requests
url = "https://rei-api.reilabs.org/v1/chat-completion"
payload = {
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"model": "google/gemini-2.5-flash",
"temperature": 1,
"max_tokens": 2,
"top_p": 0.5,
"n": 2,
"seed": 4503599627370495.5,
"stream": True,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"user": "<string>",
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"parameters": {},
"description": "<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>',
type: 'function',
function: {name: '<string>', arguments: '<string>'}
}
]
}
],
model: 'google/gemini-2.5-flash',
temperature: 1,
max_tokens: 2,
top_p: 0.5,
n: 2,
seed: 4503599627370495.5,
stream: true,
stop: '<string>',
presence_penalty: 0,
frequency_penalty: 0,
logit_bias: {},
logprobs: true,
top_logprobs: 123,
user: '<string>',
tools: [
{
type: 'function',
function: {name: '<string>', parameters: {}, description: '<string>', strict: true}
}
]
})
};
fetch('https://rei-api.reilabs.org/v1/chat-completion', 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://rei-api.reilabs.org/v1/chat-completion",
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>',
'type' => 'function',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'model' => 'google/gemini-2.5-flash',
'temperature' => 1,
'max_tokens' => 2,
'top_p' => 0.5,
'n' => 2,
'seed' => 4503599627370495.5,
'stream' => true,
'stop' => '<string>',
'presence_penalty' => 0,
'frequency_penalty' => 0,
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'user' => '<string>',
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'parameters' => [
],
'description' => '<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://rei-api.reilabs.org/v1/chat-completion"
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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\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://rei-api.reilabs.org/v1/chat-completion")
.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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rei-api.reilabs.org/v1/chat-completion")
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 \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"model\": \"google/gemini-2.5-flash\",\n \"temperature\": 1,\n \"max_tokens\": 2,\n \"top_p\": 0.5,\n \"n\": 2,\n \"seed\": 4503599627370495.5,\n \"stream\": true,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"user\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\",\n \"strict\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}