Chat inference via API Gateway (buffered responses) with multimodal support
POST /api/v3/organizations/{organisation}/ai/chat
Sends requests to the AI API Gateway endpoint which buffers responses. Supports text, images, videos, and documents via base64 encoding.
*
* Multimodal Support:
* - Text: Simple string content
* - Images: Base64-encoded PNG, JPEG, GIF, WebP (up to 25MB)
* - Videos: Base64-encoded MP4, MOV, WebM, etc. (up to 25MB)
* - Documents: Base64-encoded PDF, DOCX, CSV, etc. (up to 25MB)
*
* Supported Models:
* - Amazon Nova Lite, Micro, Pro (all support multimodal)
* - Claude models (text only)
*
* Usage Tips:
* - Use base64 encoding for images/videos < 5-10MB
* - Place media before text prompts for best results
* - Label multiple media files (e.g., ‘Image 1:’, ‘Image 2:’)
* - Maximum 25MB total payload size
*
* Response Patterns:
* - Text-only: Returns simple text response when no tools requested
* - Single tool: Returns toolUse object when AI requests one tool
* - Multiple tools: Returns toolUse array when AI requests multiple tools
* - Auto-execute sync: Automatically executes tool and returns final text response
* - Auto-execute async: Returns toolUse with executionId and status for polling
Authorizations
Parameters
Path Parameters
The organisation ID
Request Body required
Chat request with optional multimodal content blocks
object
Array of chat messages. Content can be a simple string or an array of content blocks for multimodal input.
object
Simple text message
Multimodal content blocks (text, image, video, document)
object
What's in this image?object
object
object
Base64-encoded image data
object
object
object
Base64-encoded video data
object
object
report.pdfobject
Base64-encoded document data
Model ID. Use Nova models for multimodal support.
amazon.nova-lite-v1:0Ignored in buffered mode, always returns complete response
Optional custom system prompt. When tools are enabled, this is prepended with tool usage guidance.
Custom stop sequences
Structured JSON output (Claude 3.5 Sonnet v1/v2, Nova Pro)
object
JSON Schema defining expected structure
object
Function calling configuration (Claude 3+, Nova Pro)
object
object
object
object
JSON Schema for function parameters
object
When true, backend automatically executes tools and feeds results back to AI. For async tools (e.g., image generation), returns executionId for polling. Security: Use allowedTools to whitelist which tools can auto-execute.
Whitelist of tool names that can be auto-executed. Required when autoExecute is true for security. Example: [‘get_weather’, ‘generate_image’]
Responses
200
Chat inference completed (buffered response)
object
Assistant’s response message. May contain text content and/or tool use requests.
object
assistantText response content
I'll help you with that.Single tool request
object
abc123get_weatherobject
{ "location": "Sydney"}Present for async tools with autoExecute
exec_abc123def456Present for async tools with autoExecute
Tool execution result (only present when status=‘complete’ for sync auto-executed tools). For async tools, poll /tools/executions/{executionId}
object
Base64 data URIs for images
Signed S3 URLs for downloads
Multiple tool requests
object
object
Present for async tools with autoExecute
Present for async tools with autoExecute
Present when status=‘complete’ for sync tools
object
Model used for generation
amazon.nova-pro-v1:0Unique request identifier
req-abc123Why the model stopped generating
Token usage information
object
Number of input tokens
25Number of output tokens
150Total tokens consumed
175Example
{ "response": { "role": "assistant", "content": "The capital of Australia is Canberra." }, "model": "amazon.nova-lite-v1:0", "requestId": "req-abc123", "finishReason": "stop", "usage": { "inputTokens": 12, "outputTokens": 8, "totalTokens": 20 }}500
Failed to perform chat inference