Northwind AI GatewayDocsAPIGuidesChangelogStatusSupport

Chat completions

POST /v1/chat/completions creates a model response for a conversation.

ParameterTypeDescription
modelstringModel ID from List models
messagesarrayConversation so far, as role and content pairs
streambooleanReturn server-sent events as tokens are produced
temperaturenumberSampling temperature, 0 to 2
max_tokensintegerUpper bound on generated tokens
toolsarrayFunction definitions the model may call

Example

curl http://kpnmail.net/v1/chat/completions \
  -H "Authorization: Bearer $NORTHWIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Summarize our refund policy"}]}'

Response

{"id":"chatcmpl-8f2c","object":"chat.completion","model":"gpt-4o",
 "choices":[{"index":0,"message":{"role":"assistant","content":"..."},"finish_reason":"stop"}],
 "usage":{"prompt_tokens":14,"completion_tokens":96,"total_tokens":110}}