Skip to main content
POST

Body

application/json
model
string
required

Model name

messages
object[]
required

Chat history as an array of message objects (each with a role and content)

tools
object[]

Optional list of function tools the model may call during the chat

format

Format to return a response in. Can be json or a JSON schema

Available options:
json
options
object

Runtime options that control text generation

stream
boolean
default:true
think

When true, returns separate thinking output in addition to content. Can be a boolean (true/false) or a string ("high", "medium", "low", "max") for supported models, with "max" requesting the highest thinking level.

keep_alive

Model keep-alive duration (for example 5m or 0 to unload immediately)

logprobs
boolean

Whether to return log probabilities of the output tokens

top_logprobs
integer

Number of most likely tokens to return at each token position when logprobs are enabled

Response

Chat response

model
string

Model name used to generate this message

created_at
string<date-time>

Timestamp of response creation (ISO 8601)

message
object
done
boolean

Indicates whether the chat response has finished

done_reason
string

Reason the response finished

total_duration
integer

Total time spent generating in nanoseconds

load_duration
integer

Time spent loading the model in nanoseconds

prompt_eval_count
integer

Number of tokens in the prompt

prompt_eval_duration
integer

Time spent evaluating the prompt in nanoseconds

eval_count
integer

Number of tokens generated in the response

eval_duration
integer

Time spent generating tokens in nanoseconds

logprobs
object[]

Log probability information for the generated tokens when logprobs are enabled