Proxy Chat Completions
curl --request POST \
--url https://api.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "brahma-30b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}
'import requests
url = "https://api.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions"
payload = {
"model": "brahma-30b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
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: 'brahma-30b',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'Hello!'}
],
temperature: 0.7,
max_tokens: 256,
stream: false
})
};
fetch('https://api.peachdeskai.com/api/v1/voice-engine/llm/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.peachdeskai.com/api/v1/voice-engine/llm/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' => 'brahma-30b',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'Hello!'
]
],
'temperature' => 0.7,
'max_tokens' => 256,
'stream' => false
]),
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.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\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.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peachdeskai.com/api/v1/voice-engine/llm/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\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_bodyBibha BRAHMA LLM
Chat Completions
Send an OpenAI-compatible chat-completions request to Bibha BRAHMA-30B.
POST
/
api
/
v1
/
voice-engine
/
llm
/
v1
/
chat
/
completions
Proxy Chat Completions
curl --request POST \
--url https://api.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "brahma-30b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}
'import requests
url = "https://api.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions"
payload = {
"model": "brahma-30b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
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: 'brahma-30b',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'Hello!'}
],
temperature: 0.7,
max_tokens: 256,
stream: false
})
};
fetch('https://api.peachdeskai.com/api/v1/voice-engine/llm/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.peachdeskai.com/api/v1/voice-engine/llm/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' => 'brahma-30b',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'Hello!'
]
],
'temperature' => 0.7,
'max_tokens' => 256,
'stream' => false
]),
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.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\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.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peachdeskai.com/api/v1/voice-engine/llm/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\": \"brahma-30b\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 256,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_bodySend an OpenAI-compatible chat-completions request to Bibha BRAHMA-30B, your organization’s self-hosted LLM.
Unsupported fields:
The response ends with the usage accounting for the request:
The tail of the stream looks like:
POST /api/v1/voice-engine/llm/v1/chat/completions
The request and response bodies follow the OpenAI chat-completions schema, so existing OpenAI clients work by pointing at this base URL and authenticating with your PeachDesk API key (X-API-Key). Requests route to your organization’s self-hosted BRAHMA-30B GPU, never to an external provider. Set stream: true to receive tokens incrementally as Server-Sent Events. Non-streaming responses include a usage object with prompt_tokens, completion_tokens, and total_tokens. Every response carries per-organization rate-limit headers and an x-request-id; non-2xx responses use the OpenAI error format. Use the playground to send a live request and inspect the response.
The staging base URL is
api.stage.peachdeskai.com. The production base URL api.peachdeskai.com applies once production DNS is live.Request fields
| Field | Type | Description |
|---|---|---|
model | string | Model id. Use brahma-30b. The field is accepted for OpenAI compatibility; completions are always served by BRAHMA-30B. |
messages | array (required) | The conversation so far. See Message roles below. |
max_completion_tokens | integer | Preferred cap on generated tokens (1–4096). Set it on every request — it bounds worst-case latency and cost. When the cap is hit, finish_reason is "length". When omitted, a conservative server default (256 tokens, deploy-tunable) applies — long-form callers should always set an explicit value. |
max_tokens | integer | Legacy alias for max_completion_tokens (OpenAI-deprecated but fully supported). If both are sent, max_completion_tokens wins. |
temperature | number | Sampling temperature. Lower is more deterministic. |
top_p | number | Nucleus sampling probability mass. |
top_k | integer | Top-k sampling cutoff (BRAHMA extension). |
min_p | number | Minimum-probability sampling floor (BRAHMA extension). |
seed | integer | Best-effort deterministic sampling. |
stop | string or array | Up to 4 stop sequences; generation halts before emitting them. |
frequency_penalty | number | Penalizes tokens by how often they already appeared. |
presence_penalty | number | Penalizes tokens that appeared at all. |
repetition_penalty | number | Multiplicative repetition penalty (BRAHMA extension). |
no_repeat_ngram_size | integer | Blocks exact n-gram repeats of this size (BRAHMA extension). |
stream | boolean | true streams chat.completion.chunk deltas as Server-Sent Events. |
stream_options | object | {"include_usage": true} adds a final usage chunk to a stream (see Usage on streams). |
tools / tool_choice / parallel_tool_calls | — | Let the model call your functions — see Function calling. |
response_format | object | JSON-schema-constrained or JSON-object output — see Structured outputs. |
store | boolean | Persist the completion for later retrieval — see Stored completions. |
metadata | object | Up to 16 string key–value pairs stored with the completion (keys ≤ 64 chars, values ≤ 512 chars). Violations return 422 before the request runs. |
n | integer | Only n: 1 is supported; larger values are rejected. |
logprobs: true and any top_logprobs value are rejected with a 422 error (logprobs: false is accepted). logit_bias is accepted and silently ignored. Audio and image content parts are not supported — content parts must be text.
Message roles
| Role | Purpose |
|---|---|
system | Identity, rules, and behavior for the whole conversation. Highest-priority instructions. |
developer | OpenAI’s newer name for the same slot; treated like system. |
user | End-user input. |
assistant | A prior model turn. May carry tool_calls instead of (or besides) content. |
tool | The result of a tool call. Must include tool_call_id referencing the assistant’s tool_calls[].id, with the result in content. |
content is either a plain string or an array of text parts:
{"role": "user", "content": [{"type": "text", "text": "Summarize PeachDesk in one sentence."}]}
Default system prompt
When a request contains nosystem or developer message, BRAHMA injects its default system prompt (the model’s standard identity and behavior). To fully control the model’s behavior, supply your own system (or developer) message — your message completely replaces the default; nothing is merged. Because the API is stateless, send that system message on every request (see Prompt engineering).
finish_reason values
| Value | Meaning |
|---|---|
stop | The model finished naturally or hit a stop sequence. |
length | Generation was cut off by max_completion_tokens / max_tokens. |
tool_calls | The model is calling one or more of your tools; run them and send the results back. |
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Completion id (chatcmpl-...). Use it with stored completions. |
object | string | chat.completion (non-streaming) or chat.completion.chunk (streaming). |
created | integer | Unix timestamp. |
model | string | brahma-30b. |
choices[].index | integer | Always 0 (n: 1). |
choices[].message.role | string | assistant. |
choices[].message.content | string or null | The generated text; null on a pure tool-call turn. |
choices[].message.tool_calls | array | Present when the model calls tools; function.arguments is a JSON string. |
choices[].message.refusal | null | OpenAI-parity field; always null. |
choices[].message.annotations | array | OpenAI-parity field; always []. |
choices[].finish_reason | string | stop, length, or tool_calls. |
choices[].logprobs | null | Always null (logprobs are unsupported). |
usage | object | prompt_tokens, completion_tokens, total_tokens. |
Non-streaming
Omitstream (or set it to false) to receive the full completion as a single JSON body, including the usage object.
curl -X POST https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions \
-H "X-API-Key: bibha_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "brahma-30b",
"messages": [
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
"max_completion_tokens": 256,
"stream": false
}'
import requests
resp = requests.post(
"https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions",
headers={"X-API-Key": "bibha_your_api_key"},
json={
"model": "brahma-30b",
"messages": [
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
"max_completion_tokens": 256,
"stream": False,
},
)
data = resp.json()
print(data["choices"][0]["message"]["content"])
print(data["usage"]) # {'prompt_tokens': ..., 'completion_tokens': ..., 'total_tokens': ...}
const resp = await fetch(
"https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions",
{
method: "POST",
headers: {
"X-API-Key": "bibha_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "brahma-30b",
messages: [
{ role: "user", content: "Summarize PeachDesk in one sentence." },
],
max_completion_tokens: 256,
stream: false,
}),
}
);
const data = await resp.json();
console.log(data.choices[0].message.content);
console.log(data.usage); // { prompt_tokens, completion_tokens, total_tokens }
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "brahma-30b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "...",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 42,
"total_tokens": 60
}
}
Streaming
Setstream: true to receive chat.completion.chunk deltas as Server-Sent Events, terminated by data: [DONE].
curl -X POST https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions \
-H "X-API-Key: bibha_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "brahma-30b",
"messages": [
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
"max_completion_tokens": 256,
"stream": true
}'
import requests
resp = requests.post(
"https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions",
headers={"X-API-Key": "bibha_your_api_key"},
json={
"model": "brahma-30b",
"messages": [
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
"max_completion_tokens": 256,
"stream": True,
},
stream=True,
)
for line in resp.iter_lines():
if line:
print(line.decode())
const resp = await fetch(
"https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions",
{
method: "POST",
headers: {
"X-API-Key": "bibha_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "brahma-30b",
messages: [
{ role: "user", content: "Summarize PeachDesk in one sentence." },
],
max_completion_tokens: 256,
stream: true,
}),
}
);
const reader = resp.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { value, done } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
Usage on streams
Streaming responses do not include usage by default. Setstream_options: {"include_usage": true} to receive it — every chunk then carries "usage": null, and one final usage chunk with an empty choices array arrives before data: [DONE]. This matches OpenAI’s streaming-usage semantics exactly.
cURL
curl -N -X POST https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1/chat/completions \
-H "X-API-Key: bibha_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "brahma-30b",
"messages": [
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
"max_completion_tokens": 256,
"stream": true,
"stream_options": {"include_usage": true}
}'
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","model":"brahma-30b","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","model":"brahma-30b","choices":[],"usage":{"prompt_tokens":18,"completion_tokens":42,"total_tokens":60}}
data: [DONE]
OpenAI SDK drop-in
Point an official OpenAI SDK at BRAHMA by setting the base URL tohttps://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1 and passing your PeachDesk API key as the API key.
from openai import OpenAI
client = OpenAI(
base_url="https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1",
api_key="bibha_your_api_key",
)
completion = client.chat.completions.create(
model="brahma-30b",
messages=[
{"role": "user", "content": "Summarize PeachDesk in one sentence."}
],
max_completion_tokens=256,
)
print(completion.choices[0].message.content)
print(completion.usage)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.stage.peachdeskai.com/api/v1/voice-engine/llm/v1",
apiKey: "bibha_your_api_key",
});
const completion = await client.chat.completions.create({
model: "brahma-30b",
messages: [
{ role: "user", content: "Summarize PeachDesk in one sentence." },
],
max_completion_tokens: 256,
});
console.log(completion.choices[0].message.content);
console.log(completion.usage);
Authorizations
SessionAuthApiKeyAuth
Interactive user session: the login JWT, sent as Authorization: Bearer <token>.
Body
application/json
OpenAI-compatible chat completion request. Additional OpenAI parameters not listed here are forwarded to the engine unchanged.
Model id from GET /v1/models. brahma-30b-reasoning is served on the dedicated reasoning plane.
Example:
"brahma-30b"
The conversation so far.
Minimum array length:
1Show child attributes
Show child attributes
Required range:
0 <= x <= 2Output token ceiling. Omitted leaves the engine's realtime default.
Required range:
1 <= x <= 4096Stream the completion back as server-sent events.
Required range:
0 <= x <= 1Up to a few stop sequences.
Response
Successful Response

