curl --request POST \
--url https://api.parallellabs.app/api/v0/chat/completions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 123,
"top_p": 1,
"n": 1,
"stream": false,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [
{}
],
"tool_choice": "<string>"
}
'import requests
url = "https://api.parallellabs.app/api/v0/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 123,
"top_p": 1,
"n": 1,
"stream": False,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [{}],
"tool_choice": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{role: '<string>', content: '<string>'}],
temperature: 1,
max_tokens: 123,
top_p: 1,
n: 1,
stream: false,
stop: '<string>',
presence_penalty: 0,
frequency_penalty: 0,
logit_bias: {},
user: '<string>',
response_format: {},
seed: 123,
tools: [{}],
tool_choice: '<string>'
})
};
fetch('https://api.parallellabs.app/api/v0/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.parallellabs.app/api/v0/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' => '<string>',
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'temperature' => 1,
'max_tokens' => 123,
'top_p' => 1,
'n' => 1,
'stream' => false,
'stop' => '<string>',
'presence_penalty' => 0,
'frequency_penalty' => 0,
'logit_bias' => [
],
'user' => '<string>',
'response_format' => [
],
'seed' => 123,
'tools' => [
[
]
],
'tool_choice' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.parallellabs.app/api/v0/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.parallellabs.app/api/v0/chat/completions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parallellabs.app/api/v0/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"logprobs": "<string>",
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create a chat completion (OpenAI compatible).
Fully compatible with OpenAI’s API specification for seamless integration with OpenAI libraries. Supports both streaming and non-streaming responses.
curl --request POST \
--url https://api.parallellabs.app/api/v0/chat/completions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 123,
"top_p": 1,
"n": 1,
"stream": false,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [
{}
],
"tool_choice": "<string>"
}
'import requests
url = "https://api.parallellabs.app/api/v0/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"temperature": 1,
"max_tokens": 123,
"top_p": 1,
"n": 1,
"stream": False,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [{}],
"tool_choice": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{role: '<string>', content: '<string>'}],
temperature: 1,
max_tokens: 123,
top_p: 1,
n: 1,
stream: false,
stop: '<string>',
presence_penalty: 0,
frequency_penalty: 0,
logit_bias: {},
user: '<string>',
response_format: {},
seed: 123,
tools: [{}],
tool_choice: '<string>'
})
};
fetch('https://api.parallellabs.app/api/v0/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.parallellabs.app/api/v0/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' => '<string>',
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'temperature' => 1,
'max_tokens' => 123,
'top_p' => 1,
'n' => 1,
'stream' => false,
'stop' => '<string>',
'presence_penalty' => 0,
'frequency_penalty' => 0,
'logit_bias' => [
],
'user' => '<string>',
'response_format' => [
],
'seed' => 123,
'tools' => [
[
]
],
'tool_choice' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.parallellabs.app/api/v0/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.parallellabs.app/api/v0/chat/completions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parallellabs.app/api/v0/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 123,\n \"top_p\": 1,\n \"n\": 1,\n \"stream\": false,\n \"stop\": \"<string>\",\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"user\": \"<string>\",\n \"response_format\": {},\n \"seed\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"logprobs": "<string>",
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Company API key - scoped to a specific company. Generate from the Integrations page in your dashboard.
Body
Chat completion request (OpenAI compatible)
Request body for chat completion (OpenAI compatible)
Model ID to use
Array of messages in the conversation
Show child attributes
Show child attributes
Sampling temperature (0-2)
Maximum tokens to generate
Nucleus sampling parameter (0-1)
Number of completions (only 1 supported)
Enable streaming response
Stop sequences (string or array)
Presence penalty (-2.0 to 2.0)
Frequency penalty (-2.0 to 2.0)
Token ID to bias mapping
End-user identifier
Response format specification
Random seed for reproducibility
Tool definitions
Tool choice specification
Response
Chat completion response

