Pawa AI API Reference
Complete reference for Pawa AI platform APIs
API Endpoints
Chat Request
POST
/v1/chat/requestThis endpoint is used to receive chat request from user in sandbox and return the answer.
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | The AI model to use for the chat request |
messages | array | Required | Array of message objects representing the conversation |
temperature | number | Optional | Controls randomness in response generation (0.0 to 1.0) |
max_tokens | number | Optional | Maximum number of tokens in the response |
stream | boolean | Optional | Whether to stream the response |
Requestbash
curl -X POST "https://staging.api.pawa-ai.com/v1/chat/request" \
-H "Authorization: Bearer PAWA_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "pawa-v1-ember-20240924",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
}
]
}
],
"temperature": 0.1,
"max_tokens": 4096,
"stream": false
}'JSON Responsejson
{
"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"
}
}Create Knowledge Base
POST
/v1/store/knowledge-baseThis endpoint used to create the new knowledge base in the Pawa platform system.
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Name of the knowledge base |
description | string | Required | Description of the knowledge base content and purpose |
Requestbash
curl -X POST "https://staging.api.pawa-ai.com/v1/store/knowledge-base" \
-H "Authorization: Bearer PAWA_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Pawa Knowledge Base",
"description": "This is a sample knowledge base for Pawa."
}'JSON Responsejson
{
"success": true,
"message": "Knowledge Base created successful",
"data": {
"id": 0,
"name": "WCF KnoledgeBase",
"kbReferenceId": "kb-858bf836-b27a-4a1e-8639-3fa1a863d758",
"description": "The knoledge about answering questions relating to the WCF ( Workers Compensation Fund) in Tanzania",
"status": "ACTIVE",
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z"
}
}Text to Speech
POST
/v1/voice/text-to-speechThis endpoint converts text into streaming audio.
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Required | The text to convert to speech |
voice | string | Required | Voice model to use for synthesis |
model | string | Required | TTS model version |
temperature | number | Optional | Controls voice variation (0.0 to 1.0) |
max_tokens | number | Optional | Maximum audio length in tokens |
Requestbash
curl -X POST "https://staging.api.pawa-ai.com/v1/voice/text-to-speech" \
-H "Authorization: Bearer PAWA_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, how are you?",
"voice": "ame",
"model": "pawa-tts-v1-20250704",
"temperature": 0.5
}' \
--output audio.mp3Audio Response
This endpoint returns audio data in audio/mpeg format.
Speech to Text
POST
/v1/voice/speech-to-textThis endpoint converts a single audio file into text.
| Name | Type | Required | Description |
|---|---|---|---|
file | file | Required | Audio file to transcribe (multipart/form-data) |
model | string | Required | Speech-to-text model version |
language | string | Optional | Language code (e.g., "sw" for Swahili, "en" for English) |
prompt | string | Optional | Optional prompt to guide transcription |
temperature | number | Optional | Controls transcription creativity (0.0 to 1.0) |
Requestbash
curl -X POST "https://staging.api.pawa-ai.com/v1/voice/speech-to-text" \
-H "Authorization: Bearer PAWA_AI_API_KEY" \
-F "file=@audio.mp3" \
-F "model=pawa-stt-v1-20240701" \
-F "language=sw" \
-F "prompt=Nipe maneno yaliyokwenye hii audio" \
-F "temperature=0.1"JSON Responsejson
{
"success": true,
"message": "Audio transcribed successfully",
"data": {
"text": "Hello, my name is Innocent Charles, welcome to Pawa AI"
}
}Create Embeddings
POST
/v1/vectors/embeddingThis endpoint used to create new custom embeddings to the Pawa platform system.
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | Embedding model version to use |
lang | string | Required | Language setting ("multi" for multilingual support) |
sentences | array | Required | Array of text strings to convert to embeddings |
Requestbash
curl -X POST "https://staging.api.pawa-ai.com/v1/vectors/embedding" \
-H "Authorization: Bearer PAWA_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "pawa-embedding-v1-20240701",
"lang": "multi",
"sentences": [
"Hello world",
"How are you?"
]
}'JSON Responsejson
{
"success": true,
"message": "Embeddings created successfully",
"data": {
"embeddings": [
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
],
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
]
]
}
}Need Help?
Check out our documentation or contact our support team for assistance.