Skip to main content

Overview

This endpoint provides OpenAI-compatible chat completions, allowing you to use thinnestAI agents as a drop-in replacement for OpenAI’s API. It redirects to POST /v1/chat/completions.

Request Body

agent_id
string
required
Agent public ID (ag_*) or internal ID
messages
array
required
Array of message objects with role and content
session_id
string
Session ID for conversation continuity
stream
boolean
Enable SSE streaming (default: false)

Message Object


Response 200

Streaming Response

When stream: true, returns Server-Sent Events:

SDK Usage

Python (OpenAI SDK)

JavaScript (OpenAI SDK)


Errors