curl --request POST \
--url https://api.parallellabs.app/api/v0/chat/completions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"max_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {},
"seed": 123,
"stop": "<string>",
"stream": false,
"temperature": 1,
"tool_choice": "<string>",
"tools": [
{}
],
"top_p": 1,
"user": "<string>"
}
'import requests
url = "https://api.parallellabs.app/api/v0/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"max_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {},
"seed": 123,
"stop": "<string>",
"stream": False,
"temperature": 1,
"tool_choice": "<string>",
"tools": [{}],
"top_p": 1,
"user": "<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({
messages: [{content: '<string>', role: '<string>'}],
model: '<string>',
frequency_penalty: 0,
logit_bias: {},
max_tokens: 123,
n: 1,
presence_penalty: 0,
response_format: {},
seed: 123,
stop: '<string>',
stream: false,
temperature: 1,
tool_choice: '<string>',
tools: [{}],
top_p: 1,
user: '<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([
'messages' => [
[
'content' => '<string>',
'role' => '<string>'
]
],
'model' => '<string>',
'frequency_penalty' => 0,
'logit_bias' => [
],
'max_tokens' => 123,
'n' => 1,
'presence_penalty' => 0,
'response_format' => [
],
'seed' => 123,
'stop' => '<string>',
'stream' => false,
'temperature' => 1,
'tool_choice' => '<string>',
'tools' => [
[
]
],
'top_p' => 1,
'user' => '<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"logprobs": "<string>",
"message": {
"content": "<string>",
"role": "<string>"
}
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"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 '
{
"messages": [
{
"content": "<string>",
"role": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"max_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {},
"seed": 123,
"stop": "<string>",
"stream": false,
"temperature": 1,
"tool_choice": "<string>",
"tools": [
{}
],
"top_p": 1,
"user": "<string>"
}
'import requests
url = "https://api.parallellabs.app/api/v0/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"max_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {},
"seed": 123,
"stop": "<string>",
"stream": False,
"temperature": 1,
"tool_choice": "<string>",
"tools": [{}],
"top_p": 1,
"user": "<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({
messages: [{content: '<string>', role: '<string>'}],
model: '<string>',
frequency_penalty: 0,
logit_bias: {},
max_tokens: 123,
n: 1,
presence_penalty: 0,
response_format: {},
seed: 123,
stop: '<string>',
stream: false,
temperature: 1,
tool_choice: '<string>',
tools: [{}],
top_p: 1,
user: '<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([
'messages' => [
[
'content' => '<string>',
'role' => '<string>'
]
],
'model' => '<string>',
'frequency_penalty' => 0,
'logit_bias' => [
],
'max_tokens' => 123,
'n' => 1,
'presence_penalty' => 0,
'response_format' => [
],
'seed' => 123,
'stop' => '<string>',
'stream' => false,
'temperature' => 1,
'tool_choice' => '<string>',
'tools' => [
[
]
],
'top_p' => 1,
'user' => '<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"model\": \"<string>\",\n \"frequency_penalty\": 0,\n \"logit_bias\": {},\n \"max_tokens\": 123,\n \"n\": 1,\n \"presence_penalty\": 0,\n \"response_format\": {},\n \"seed\": 123,\n \"stop\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"tool_choice\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"top_p\": 1,\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"logprobs": "<string>",
"message": {
"content": "<string>",
"role": "<string>"
}
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"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)
Array of messages in the conversation
Show child attributes
Show child attributes
Model ID to use
Frequency penalty (-2.0 to 2.0)
Token ID to bias mapping
Maximum tokens to generate
Number of completions (only 1 supported)
Presence penalty (-2.0 to 2.0)
Response format specification
Random seed for reproducibility
Stop sequences (string or array)
Enable streaming response
Sampling temperature (0-2)
Tool choice specification
Tool definitions
Nucleus sampling parameter (0-1)
End-user identifier
Response
Chat completion response

