curl --request POST \
--url https://api.pawa-ai.com/v1/agents/chat/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "TutorAI",
"description": "TutorAI is an AI agent designed to assist students with their studies.",
"instruction": "Teaching students on subjects ranging from form 0ne to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to",
"intents": [
"Be gentle",
"Be detailed"
],
"model": "pawa-v1-blaze-20250318",
"message": {
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png"
}
}
]
},
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"stream": false,
"agents": [
2,
3,
4
],
"memoryChat": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Habari yako?"
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "Nzuri sana, asante. Wewe je?"
}
]
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "foo",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"pattern": "^\\d+$"
}
},
"required": [
"answer"
],
"additionalProperties": false
}
}
}
}
'{
"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"
}
}This endpoint is used to receive agent chat request from user through API and return the answer.
curl --request POST \
--url https://api.pawa-ai.com/v1/agents/chat/request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "TutorAI",
"description": "TutorAI is an AI agent designed to assist students with their studies.",
"instruction": "Teaching students on subjects ranging from form 0ne to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to",
"intents": [
"Be gentle",
"Be detailed"
],
"model": "pawa-v1-blaze-20250318",
"message": {
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png"
}
}
]
},
"temperature": 0.1,
"top_p": 0.95,
"max_tokens": 4096,
"frequency_penalty": 0.3,
"presence_penalty": 0.3,
"seed": 2024,
"stream": false,
"agents": [
2,
3,
4
],
"memoryChat": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Habari yako?"
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "Nzuri sana, asante. Wewe je?"
}
]
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "foo",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"pattern": "^\\d+$"
}
},
"required": [
"answer"
],
"additionalProperties": false
}
}
}
}
'{
"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"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The name of the agent
"TutorAI"
The description about the agent
"TutorAI is an AI agent designed to assist students with their studies."
What should the agent do
"Teaching students on subjects ranging from form 0ne to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to"
The list of intents, how the model should behave?
["Be gentle", "Be detailed"]The name of the model to use.
Messages to send to the model
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is the current president of Tanzania?"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/image.png" }
}
]
}Sampling temperature
Nucleus sampling (top-p)
Maximum number of tokens in the response
Penalty for repeated tokens
Penalty for new topic tokens
Random seed for reproducibility
Whether to stream the response
The list of agent IDs the main agent should use to respond
[2, 3, 4]Previous messages in the conversation (as a JSON string)
Show child attributes
The role of the message sender
user, system, assistant, tool, function "user"
Content of the message
[
{
"type": "text",
"text": "What is the current president of Tanzania?"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/image.png" }
}
][
{
"role": "user",
"content": [{ "type": "text", "text": "Habari yako?" }]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "Nzuri sana, asante. Wewe je?"
}
]
}
]Optional response format specification
Show child attributes
The type of response format
json_schema "json_schema"
The JSON schema definition for the response
{
"name": "foo",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": { "type": "string", "pattern": "^\\d+$" }
},
"required": ["answer"],
"additionalProperties": false
}
}{
"type": "json_schema",
"json_schema": {
"name": "foo",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": { "type": "string", "pattern": "^\\d+$" }
},
"required": ["answer"],
"additionalProperties": false
}
}
}Agent chat request processed successfully
true
"Chat request processed successfully"
Show child attributes
Show child attributes
1753304351
"pawa-v1-blaze-20250318"
"chat.request"