Skip to main content

Endpoint

Send JSON to POST /query:
POST http://127.0.0.1:8080/query

Request Structure

{
  "parts": [
    { "type": "text", "text": "Your prompt here" },
    {
      "type": "file",
      "name": "data.csv",
      "mimeType": "text/csv",
      "base64": "..."
    }
  ],
  "kwargs": {
    "session_id": "unique-session-id",
    "customField": "any metadata you need"
  }
}

Request Fields

parts (required)

Array of text and/or base64-encoded files that make up the user’s message. Text part:
{
  "type": "text",
  "text": "Your prompt here"
}
File part:
{
  "type": "file",
  "name": "data.csv",
  "mimeType": "text/csv",
  "base64": "base64-encoded-content"
}

kwargs (optional)

Optional metadata passed to your agent handler. Common uses:
  • session_id - For conversation continuity
  • Custom fields - Any additional data your agent needs

Example: Simple Text Request

curl -N \
  -H "Content-Type: application/json" \
  -X POST http://127.0.0.1:8080/query \
  -d '{"parts":[{"type":"text","text":"Say hello"}],"kwargs":{}}'

Example: Request with Session

curl -N \
  -H "Content-Type: application/json" \
  -X POST http://127.0.0.1:8080/query \
  -d '{
    "parts": [{"type":"text","text":"Remember this conversation"}],
    "kwargs": {"session_id": "user-123"}
  }'
The -N flag disables buffering in curl, allowing you to see the streaming response in real-time.

Next Steps