1. Search & Chat
AboAI-Doc
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
      • Native Gemini Format
      • Native Claude Format
      • Responses Request (openai)
    • Audio
      • Native OpenAI Format TTS
      • Native Gemini Format TTS
    • Images
      • Native OpenAI Format Image Generation
      • Native Gemini Format Image Generation
      • Native OpenAI Format Image Editing (JSON)
      • Native OpenAI Format Image Editing (Multipart)
    • Video
      • Seedance2.0 format
        • Create Video Generation Task
        • Query Video Generation Task Status
    • Vector
      • Embeddings
        • Create Embedding
    • Translation
      • Speech Translation
    • Knowledge
      • Knowledge Management
        • List Knowledge Bases
        • Create Knowledge Base
        • Update Knowledge Base
        • Get Knowledge Base Details
        • Delete Knowledge Base
      • Attachments
        • List Attachments
        • Upload Attachment
        • Get Attachment Status
        • Get Attachment Details
        • Delete Attachment
      • Search & Chat
        • Knowledge Search
          POST
        • RAG Chat
          POST
  • AI application
    • AboAI API Integration with Claude Code
    • AboAI API Integration with Cursor
    • AboAI API Integration with Codex-cli
    • AboAI API Integration with Codex Desktop
    • AboAI API Integration with Hermes Agent
  1. Search & Chat

RAG Chat

POST
/v1/knowledge/chat
messages carries the full conversation (including the latest user turn); the last user message is the question and the search input for this turn. system messages are merged into client constraints; the rest is history. Chunks retrieved per searchMode are passed as context to the LLM to generate the answer.
When stream is omitted or true, the response is SSE (text/event-stream) with events in order: delta → sources (when returnSources=true) → done (carries response) → [DONE]; on failure an error event is sent. When stream=false, JSON is returned.

Request

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Success: JSON below when stream=false; text/event-stream when stream=true, see examples 2 / 3
Bodyapplication/json

🟠400Bad Request
🟠401Forbidden
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://vipapi.aboai.ai/v1/knowledge/chat' \
--header 'Authorization: Bearer {{apiKey}}' \
--header 'Content-Type: application/json' \
--data '{
    "model": "Claude-Haiku-5.5",
    "kid": "NkD5Y4RkLGnp",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "hi"
                }
            ]
        }
    ],
    "maxTokens": 4096,
    "topK": 10,
    "hybridAlpha": 0.55,
    "returnSources": false,
    "stream": true
}'
Response Response Example
200 - Non-streaming success example
{
    "id": "resp_abc123",
    "provider": "openai",
    "model": "gpt-4o",
    "content": "According to the product manual, returns are accepted within 7 days of receipt for any reason, provided the item and packaging are intact.",
    "thinking": "Thinking process",
    "tool_calls": [
        {
            "id": "call_abc123",
            "type": "function",
            "function": {
                "name": "get_weather",
                "arguments": "{\"city\":\"Shanghai\",\"unit\":\"celsius\"}"
            }
        }
    ],
    "finish_reason": "stop",
    "usage": {
        "input_tokens": 1250,
        "output_tokens": 85,
        "cached_input_tokens": 0,
        "reasoning_tokens": 0
    },
    "raw_usage": {
        "prompt_tokens": 1250,
        "completion_tokens": 85,
        "total_tokens": 1335
    }
}
Modified at 2026-11-04 09:19:19
Previous
Knowledge Search
Next
AboAI API Integration with Claude Code
Built with