Create Chat Completion
Create a chat completion using a Letta agent (OpenAI-compatible).
This endpoint provides full OpenAI API compatibility. The agent is selected based on:
- The 'model' parameter in the request (should contain an agent ID in format 'agent-...')
When streaming is enabled (stream=true), the response will be Server-Sent Events
with ChatCompletionChunk objects.
Authentication
AuthorizationBearer
Header authentication of the form Bearer <token>
Request
This endpoint expects an object.
model
ID of the model to use
messages
Messages comprising the conversation so far
temperature
Sampling temperature
top_p
Nucleus sampling parameter
n
Number of chat completion choices to generate
stream
Whether to stream back partial progress
stop
Sequences where the API will stop generating
max_tokens
Maximum number of tokens to generate
presence_penalty
Presence penalty
frequency_penalty
Frequency penalty
user
A unique identifier representing your end-user
Response
Successful response
id
choices
created
model
object
service_tier
Allowed values:
system_fingerprint
usage