API Reference

Chat

Copy page

Chat completions endpoints

Chat (Vercel Streaming Protocol)

POST
/run/api/chat

Authorization

bearerAuth
AuthorizationBearer <token>

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

conversationId?string
headers?

Headers data for template processing

id?string
max_tokens?number

Maximum tokens to generate

messages*array<>
model?string
runConfig?

Run configuration

stream?boolean

Whether to stream the response

Defaulttrue

Response Body

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"      }    ]  }'
Empty
{
  "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": "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"
  }
}

Approve or deny tool execution

POST
/run/api/tool-approvals

Authorization

bearerAuth
AuthorizationBearer <token>

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

approved*boolean

Whether the tool execution is approved

conversationId*string

The conversation ID

reason?string

Optional reason for the decision

toolCallId*string

The tool call ID to respond to

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.pilot.inkeep.com/run/api/tool-approvals" \  -H "Content-Type: application/json" \  -d '{    "approved": true,    "conversationId": "string",    "toolCallId": "string"  }'
{
  "message": "string",
  "success": true
}
{
  "error": "string"
}
{
  "error": "string"
}
{
  "error": "string",
  "message": "string"
}

Create chat completion

POST
/run/v1/chat/completions

Authorization

bearerAuth
AuthorizationBearer <token>

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

conversationId?string

Conversation ID for multi-turn chat

frequency_penalty?number

Frequency penalty (-2 to 2)

headers?

Headers data for template processing (validated against context config schema)

logit_bias?

Token logit bias

max_tokens?number

Maximum tokens to generate

messages*array<>

The conversation messages

model*string

The model to use for the completion

n?number

Number of completions to generate

presence_penalty?number

Presence penalty (-2 to 2)

runConfig?

Run configuration

stream?boolean

Whether to stream the response

temperature?number

Controls randomness (0-1)

tools?array<>

Available tools

top_p?number

Controls nucleus sampling

user?string

User identifier

Response Body

text/event-stream

application/json

application/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"
}
{
  "error": "string",
  "message": "string"
}