Generate a chat message

Generate the next chat message in a conversation between a user and an assistant.

post/api/chat

Request body

modelstring required

Model name

streamboolean
thinkboolean

When true, returns separate thinking output in addition to content

Response

Chat response

modelstring

Model name used to generate this message

created_atstring date-time

Timestamp of response creation (ISO 8601)

doneboolean

Indicates whether the chat response has finished

done_reasonstring

Reason the response finished

total_durationinteger

Total time spent generating in nanoseconds

load_durationinteger

Time spent loading the model in nanoseconds

prompt_eval_countinteger

Number of tokens in the prompt

prompt_eval_durationinteger

Time spent evaluating the prompt in nanoseconds

eval_countinteger

Number of tokens generated in the response

eval_durationinteger

Time spent generating tokens in nanoseconds

Changes