Skip to main content
POST
/
agents
/
chat
/
request
Agent chat request
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"
        }
      }
    ]
  },
  "agents": [
    2,
    3,
    4
  ],
  "memoryChat": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Habari yako?"
        }
      ]
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "Nzuri sana, asante. Wewe je?"
        }
      ]
    }
  ],
  "temperature": 0.1,
  "top_p": 0.95,
  "max_tokens": 4096,
  "frequency_penalty": 0.3,
  "presence_penalty": 0.3,
  "seed": 2024,
  "stream": false,
  "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"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The name of the agent

Example:

"TutorAI"

description
string
required

The description about the agent

Example:

"TutorAI is an AI agent designed to assist students with their studies."

instruction
string
required

What should the agent do

Example:

"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
any[]
required

The list of intents, how the model should behave?

Example:
["Be gentle", "Be detailed"]
model
string
default:pawa-v1-blaze-20250318
required

The name of the model to use.

message
object
required

Messages to send to the model

Example:
{
"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
number
default:0.1
required

Sampling temperature

top_p
number
default:0.95
required

Nucleus sampling (top-p)

max_tokens
number
default:4096
required

Maximum number of tokens in the response

frequency_penalty
number
default:0.3
required

Penalty for repeated tokens

presence_penalty
number
default:0.3
required

Penalty for new topic tokens

seed
number
default:2024
required

Random seed for reproducibility

stream
boolean
default:false
required

Whether to stream the response

agents
number[]

The list of agent IDs the main agent should use to respond

Example:
[2, 3, 4]
memoryChat
object[]

Previous messages in the conversation (as a JSON string)

Example:
[
{
"role": "user",
"content": [{ "type": "text", "text": "Habari yako?" }]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "Nzuri sana, asante. Wewe je?"
}
]
}
]
response_format
object

Optional response format specification

Example:
{
"type": "json_schema",
"json_schema": {
"name": "foo",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": { "type": "string", "pattern": "^\\d+$" }
},
"required": ["answer"],
"additionalProperties": false
}
}
}

Response

Agent chat request processed successfully

success
boolean
required
Example:

true

message
string
required
Example:

"Chat request processed successfully"

data
object
required
I