Chat
Copy page
Chat completions endpoints
Chat (Vercel Streaming Protocol)
Authorization
bearerAuth Bearer token authentication. Use this for API clients and service-to-service communication. Set the Authorization header to "Bearer ".
In: header
Request Body
application/json
Override the agent execution mode for this request. Takes precedence over the agent config default. Falls back to classic if unset.
"classic" | "durable"Headers data for template processing
Maximum tokens to generate
Client-supplied user message id. Optional; server generates one if omitted. Persisted as messages.id so events keyed to this id can join back to the message row. Constrained to the server id alphabet ([A-Za-z0-9_-]).
^[A-Za-z0-9_-]+$1 <= length <= 64Per-turn properties (page url, referrer, etc.) for the conversation
Run configuration
Whether to stream the response
trueUser properties to associate with the conversation
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.pilot.inkeep.com/run/api/chat" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "system" } ] }'{
"code": "bad_request",
"detail": "Bad Request",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 400,
"title": "Bad Request",
"error": {
"code": "bad_request",
"message": "Bad Request"
}
}{
"code": "unauthorized",
"detail": "Unauthorized",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 401,
"title": "Unauthorized",
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"code": "forbidden",
"detail": "Forbidden",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 403,
"title": "Forbidden",
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}{
"code": "not_found",
"detail": "Not Found",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 404,
"title": "Not Found",
"error": {
"code": "not_found",
"message": "Not Found"
}
}{
"code": "conflict",
"detail": "Message with the supplied id already exists",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 409,
"title": "Conflict",
"error": {
"code": "conflict",
"message": "Message with the supplied id already exists"
}
}{
"code": "unprocessable_entity",
"detail": "Unprocessable Entity",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 422,
"title": "Unprocessable Entity",
"error": {
"code": "unprocessable_entity",
"message": "Unprocessable Entity"
}
}{
"code": "internal_server_error",
"detail": "Internal Server Error",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 500,
"title": "Internal Server Error",
"error": {
"code": "internal_server_error",
"message": "Internal Server Error"
}
}Create chat completion
Authorization
bearerAuth Bearer token authentication. Use this for API clients and service-to-service communication. Set the Authorization header to "Bearer ".
In: header
Request Body
application/json
Conversation ID for multi-turn chat
Override the agent execution mode for this request. Takes precedence over the agent config default. Falls back to classic if unset.
"classic" | "durable"Frequency penalty (-2 to 2)
Headers data for template processing (validated against context config schema)
Token logit bias
Maximum tokens to generate
Client-supplied user message id. Optional; server generates one if omitted. Persisted as messages.id so events keyed to this id can join back to the message row. Constrained to the server id alphabet ([A-Za-z0-9_-]).
^[A-Za-z0-9_-]+$1 <= length <= 64The conversation messages
The model to use for the completion
Number of completions to generate
Presence penalty (-2 to 2)
Per-turn properties (page url, referrer, etc.) for the conversation
Run configuration
Whether to stream the response
Controls randomness (0-1)
Available tools
Controls nucleus sampling
User identifier
User properties to associate with the conversation
Response Body
text/event-stream
application/json
application/json
application/problem+json
application/json
curl -X POST "https://api.pilot.inkeep.com/run/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "content": "string", "role": "system" } ], "model": "string" }'"string"{
"details": [
{
"field": "string",
"message": "string",
"value": null
}
],
"error": "string"
}{
"error": "string"
}{
"code": "conflict",
"detail": "Message with the supplied id already exists",
"instance": "/conversations/123",
"requestId": "req_1234567890",
"status": 409,
"title": "Conflict",
"error": {
"code": "conflict",
"message": "Message with the supplied id already exists"
}
}{
"error": "string",
"message": "string"
}