Chat request
curl --request POST \
--url https://api.pawa-ai.com/v1/chat/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "pawa-v1-ember-20240924",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a helpful assistant that answers questions asked "
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
],
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"stream": false
}
'import requests
url = "https://api.pawa-ai.com/v1/chat/request"
payload = {
"model": "pawa-v1-ember-20240924",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a helpful assistant that answers questions asked "
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
],
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"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: 'pawa-v1-ember-20240924',
messages: [
{
role: 'system',
content: [
{
type: 'text',
text: 'You are a helpful assistant that answers questions asked '
}
]
},
{
role: 'user',
content: [{type: 'text', text: 'What is the current president of Tanzania?'}]
}
],
temperature: 0.1,
top_p: 0.95,
max_tokens: 4096,
frequency_penalty: 0.3,
presence_penalty: 0.3,
seed: 2024,
stream: false
})
};
fetch('https://api.pawa-ai.com/v1/chat/request', 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.pawa-ai.com/v1/chat/request",
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' => 'pawa-v1-ember-20240924',
'messages' => [
[
'role' => 'system',
'content' => [
[
'type' => 'text',
'text' => 'You are a helpful assistant that answers questions asked '
]
]
],
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'What is the current president of Tanzania?'
]
]
]
],
'temperature' => 0.1,
'top_p' => 0.95,
'max_tokens' => 4096,
'frequency_penalty' => 0.3,
'presence_penalty' => 0.3,
'seed' => 2024,
'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.pawa-ai.com/v1/chat/request"
payload := strings.NewReader("{\n \"model\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\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.pawa-ai.com/v1/chat/request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/chat/request")
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\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Chat request processed successfully",
"data": {
"request": [
{
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Mimi ni pawa..."
},
"matched_stop": 106
}
],
"created": 1753304351,
"model": "pawa-v1-blaze-20250318",
"object": "chat.request"
}
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Chat
Send Request
This endpoint is used to receive chat request from user through API and return the answer.
POST
/
chat
/
request
Chat request
curl --request POST \
--url https://api.pawa-ai.com/v1/chat/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "pawa-v1-ember-20240924",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a helpful assistant that answers questions asked "
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
],
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"stream": false
}
'import requests
url = "https://api.pawa-ai.com/v1/chat/request"
payload = {
"model": "pawa-v1-ember-20240924",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a helpful assistant that answers questions asked "
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
],
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"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: 'pawa-v1-ember-20240924',
messages: [
{
role: 'system',
content: [
{
type: 'text',
text: 'You are a helpful assistant that answers questions asked '
}
]
},
{
role: 'user',
content: [{type: 'text', text: 'What is the current president of Tanzania?'}]
}
],
temperature: 0.1,
top_p: 0.95,
max_tokens: 4096,
frequency_penalty: 0.3,
presence_penalty: 0.3,
seed: 2024,
stream: false
})
};
fetch('https://api.pawa-ai.com/v1/chat/request', 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.pawa-ai.com/v1/chat/request",
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' => 'pawa-v1-ember-20240924',
'messages' => [
[
'role' => 'system',
'content' => [
[
'type' => 'text',
'text' => 'You are a helpful assistant that answers questions asked '
]
]
],
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'What is the current president of Tanzania?'
]
]
]
],
'temperature' => 0.1,
'top_p' => 0.95,
'max_tokens' => 4096,
'frequency_penalty' => 0.3,
'presence_penalty' => 0.3,
'seed' => 2024,
'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.pawa-ai.com/v1/chat/request"
payload := strings.NewReader("{\n \"model\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\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.pawa-ai.com/v1/chat/request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/chat/request")
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\": \"pawa-v1-ember-20240924\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"You are a helpful assistant that answers questions asked \"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is the current president of Tanzania?\"\n }\n ]\n }\n ],\n \"temperature\": 0.1,\n \"top_p\": 0.95,\n \"max_tokens\": 4096,\n \"frequency_penalty\": 0.3,\n \"presence_penalty\": 0.3,\n \"seed\": 2024,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Chat request processed successfully",
"data": {
"request": [
{
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Mimi ni pawa..."
},
"matched_stop": 106
}
],
"created": 1753304351,
"model": "pawa-v1-blaze-20250318",
"object": "chat.request"
}
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
- Basic Chat
- Multimodal Chat
- Tools Chat
- Reasoning Chat
- RAG Chat
- Agentic RAG Chat
- In Memory Chat
- Structured Ouput
The name of the model to use.
Available options:
pawa-v1-ember-20240924, pawa-v1-blaze-20250318 Example:
"pawa-v1-ember-20240924"
Messages to send to the model
Show child attributes
Show child attributes
Example:
[
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a helpful assistant that answers questions asked "
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
]
Sampling temperature
Required range:
0 <= x <= 2Nucleus sampling (top-p)
Required range:
0 <= x <= 1Maximum number of tokens in the response
Penalty for repeated tokens
Required range:
-2 <= x <= 2Penalty for new topic tokens
Required range:
-2 <= x <= 2Random seed for reproducibility
Whether to stream the response
⌘I