Before calling this endpoint, an administrator must publish the Space in Team Settings > Published Spaces and copy its unique endpoint URL. Learn more in Published Spaces.
Endpoint
POST /v1/endpoints/{endpointId}/chat
Path Parameters
Request Headers
Request Body (application/json)
Message Sequence Rules
The API strictly validates conversation history on every request:messagesmust contain at least one message, and everycontentstring must be non-empty.- Only
"user"and"assistant"roles are accepted ("system"is rejected; configure system behavior in the Space’s Space Instructions). - Both the first message and the last message in
messagesmust haverole: "user". - Roles must strictly alternate (
user→assistant→user). Consecutive messages with the same role return400(unexpected_message_order).
Response Formats
1. Standard JSON Response (streaming: false)
When streaming is false, the endpoint completes generation and returns a single JSON object containing id, content, tokenUsage, and either references (default) or sources (when omnifact-enable-inline-sources: true).
- Default (references)
- Inline Sources (omnifact-enable-inline-sources: true)
2. SSE Streaming Response (streaming: true)
When streaming is true, the endpoint streams Server-Sent Events (Content-Type: text/event-stream).
SSE Event Types
Example Streaming Request
SSE Stream Output Example
Error Codes & Model Compatibility
Model Compatibility Note: Models that only support tool calling via the OpenAI Responses API, specifically GPT-6.1 Sol (OpenAI and Azure OpenAI), are excluded from Published Space endpoints (
invalid_endpoint_setup). Select models such as GPT-6.1 Terra, Claude Sonnet 5.5, Gemini 4 Argon, or Mistral Large 4 when publishing a Space.Code Examples
- JavaScript / Node.js
- Python
Next Steps
- Automate document ingestion with the Documents API
- Configure models, deprecation alerts, and endpoint lifecycle in Published Spaces