Skip to main content
POST
/
invoke
/
stream
Stream AI completion
curl --request POST \
  --url https://api.dev.knowmio.com/api/invoke/stream \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "id": "<string>",
  "messages": [
    {
      "id": "<string>",
      "role": "user",
      "parts": [
        {
          "type": "text",
          "text": "<string>"
        }
      ]
    }
  ],
  "model": "<string>",
  "provider": "openai",
  "organizationId": "<string>",
  "trigger": "<string>",
  "knowledgeIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}
'
"<string>"

Authorizations

x-api-key
string
header
required

API key for authentication (lowercase header name)

Body

application/json
id
string
required

Chat ID

messages
object[]
required

Conversation messages

model
string
required

Model slug (e.g., gpt-4.1)

provider
enum<string>
required
Available options:
openai,
anthropic,
google,
cohere,
bedrock
organizationId
string
required

Organization ID - Required when using API Key authentication. Optional with session authentication (defaults to session's active organization).

trigger
string
required

Trigger type (e.g., submit-message)

knowledgeIds
string<uuid>[]

Knowledge base IDs for RAG (optional)

Response

Server-Sent Events stream

UI message stream events