Generate a completion
Ask for a completion and stores the prompt in the chat history.
Replica chat supports two response formats: streamed and JSON. To switch between these formats, use the 'Accept' header, specifying either 'text/event-stream' for streaming or 'application/json' for JSON. The streamed response honours the Stream Protocol, allowing the use of a number of SDKs, including Vercel AI SDK.
The streamed variant is not specified in the OpenAPI Schema because it is not an OpenAPI endpoint.
Request
- Base URL: https://api.sensay.io
- URL: https://api.sensay.io/v1/replicas/{replicaUUID}/chat/completions
- Auth: one of:
- API key in header X-ORGANIZATION-SECRET and API key in header X-USER-ID and API key in header X-USER-ID-TYPE
- API key in header X-ORGANIZATION-SECRET
Path parameters
The replica unique identifier (UUID)
Headers
Content encoding for request body compression. Optional - when used, client is responsible for gzipping and sending binary data.
Request body
Example request
{
"content": "How did you handle the immense pressure during the Civil War?"
}Response
List of chat messages had with a replica by the current user, including the completion
Example response
{
"success": true,
"content": "I handled the immense pressure during the Civil War by..."
}Changes
No recorded changes to this operation across all 1 revision of this API.