OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side.
For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"co-mind.ai","colors":{"primary":"#2563EB","light":"#60A5FA","dark":"#1E40AF"},"logo":{"light":"https://mintcdn.com/co-mindai/U0q2IjULpfUdByiO/logo/light.png?fit=max\u0026auto=format\u0026n=U0q2IjULpfUdByiO\u0026q=85\u0026s=03467e2b4fb228b6e1e862020818a9ff","dark":"https://mintcdn.com/co-mindai/U0q2IjULpfUdByiO/logo/dark.png?fit=max\u0026auto=format\u0026n=U0q2IjULpfUdByiO\u0026q=85\u0026s=6ae59fd885a8918c46a68a009be13c57"},"favicon":"https://mintcdn.com/co-mindai/mmwMTPu_RzumK-aI/favicon.png?fit=max\u0026auto=format\u0026n=mmwMTPu_RzumK-aI\u0026q=85\u0026s=6350bc9d275608abf3917ceedd14ee76","navbar":{"links":[{"href":"mailto:support@co-mind.ai","label":"Support"}]},"footer":{"socials":{"website":"https://co-mind.ai"}},"search":{},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"co-mindai","hasAudioNarration":false,"actualSubdomain":"co-mindai","customDomains":["docs.co-mind.ai"],"gitSource":{"type":"github","owner":"co-mind-ai","repo":"comind-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ab24ec7913bdee5b47709a5","collectionId":"bd50ce7d-cbe9-4cab-93c5-24cde205ba24","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ab24ec7913bdee5b47709a5"},"entitlements":{},"buildId":"6ab24ec7913bdee5b47709a5","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"API Reference","count":70},{"language":"default","tag":"Researcher","count":25},{"language":"default","tag":"Guides","count":18},{"language":"default","tag":"Authentication","count":11},{"language":"default","tag":"API Walkthrough","count":10},{"language":"default","tag":"Knowledge Base","count":9},{"language":"default","tag":"Chat Sessions (Preview)","count":8},{"language":"default","tag":"API Tokens","count":5},{"language":"default","tag":"Admin","count":2},{"language":"default","tag":"Admin APIs","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag","slug":"/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag","pageMetadata":{"title":"Chat with knowledge bases (stateless RAG)","description":"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. **Stateless** — the client sends the full conversation history in `messages[]` on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side.\n\nFor stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebase/chat/completions","href":"/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. \", _jsx(_components.strong, {\n children: \"Stateless\"\n }), \" — the client sends the full conversation history in \", _jsx(_components.code, {\n children: \"messages[]\"\n }), \" on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\"\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat with knowledge bases (stateless RAG)","description":"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. **Stateless** — the client sends the full conversation history in `messages[]` on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side.\n\nFor stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebase/chat/completions","href":"/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Knowledge Base"],"summary":"Chat with knowledge bases (stateless RAG)","description":"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. **Stateless** — the client sends the full conversation history in `messages[]` on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side.\n\nFor stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\n","operationId":"knowledgeBaseChatCompletion","requestBody":"7ff7ab91-5e90-4c52-a806-fb5c9d1d6bc0","responses":{"200":"7ab52e62-3e6c-44dd-8058-dfa5ade7dc20","400":"a2302d54-9c6b-4be4-84af-0afdf7cc6422","429":"74885ff7-9ad4-4828-b944-422954bfd905"},"method":"post","type":"path","servers":["541e99fe-2d4a-434a-9715-1eb2a45721cc"],"security":["010d3af1-953c-4139-b880-8393db7db08a"],"path":"/v1/knowledgebase/chat/completions","baseUrlOptions":["http://co-mind-platform-host"],"title":"Chat with knowledge bases (stateless RAG)","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages","knowledgebase_ids"],"properties":{"model":{"type":"string","example":"gpt-4o-mini","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string"},"name":{"type":"string","uniqueKey":"messages.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"knowledgebase_ids":{"type":"array","items":{"type":"string","uniqueKey":"knowledgebase_ids.items.[INDEX]","typeLabel":"string"},"description":"Knowledge base IDs to use for context","example":["kb_abc123","kb_def456"],"isRequired":true,"uniqueKey":"knowledgebase_ids","typeLabel":"string[]"},"temperature":{"type":"number","minimum":0,"maximum":2,"default":1,"uniqueKey":"temperature","typeLabel":"number"},"max_tokens":{"type":"integer","minimum":1,"uniqueKey":"max_tokens","typeLabel":"integer"},"top_p":{"type":"number","minimum":0,"maximum":1,"default":1,"uniqueKey":"top_p","typeLabel":"number"},"stream":{"type":"boolean","default":false,"uniqueKey":"stream","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"gpt-4o-mini","messages":[{"content":"\u003cstring>","name":"\u003cstring>"}],"knowledgebase_ids":["kb_abc123","kb_def456"],"temperature":1,"max_tokens":2,"top_p":1,"stream":false}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"7ab52e62-3e6c-44dd-8058-dfa5ade7dc20":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"chatcmpl-abc123","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","example":"chat.completion","uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string"},"name":{"type":"string","uniqueKey":"choices.items.[INDEX].message.name","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","enum":["stop","length","tool_calls","content_filter"],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"},"knowledge_base_context":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"knowledgebase_id":{"type":"string","uniqueKey":"knowledge_base_context.sources.items.[INDEX].knowledgebase_id","typeLabel":"string"},"document_id":{"type":"string","uniqueKey":"knowledge_base_context.sources.items.[INDEX].document_id","typeLabel":"string"},"title":{"type":"string","uniqueKey":"knowledge_base_context.sources.items.[INDEX].title","typeLabel":"string"},"content":{"type":"string","uniqueKey":"knowledge_base_context.sources.items.[INDEX].content","typeLabel":"string"},"page":{"type":"integer","uniqueKey":"knowledge_base_context.sources.items.[INDEX].page","typeLabel":"integer"},"relevance_score":{"type":"number","uniqueKey":"knowledge_base_context.sources.items.[INDEX].relevance_score","typeLabel":"number"}},"uniqueKey":"knowledge_base_context.sources.items.[INDEX]","typeLabel":"object"},"uniqueKey":"knowledge_base_context.sources","typeLabel":"object[]"}},"uniqueKey":"knowledge_base_context","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"chatcmpl-abc123","object":"chat.completion","created":123,"model":"\u003cstring>","choices":[{"index":123,"message":{"role":"system","content":"\u003cstring>","name":"\u003cstring>"},"finish_reason":"stop"}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123},"knowledge_base_context":{"sources":[{"knowledgebase_id":"\u003cstring>","document_id":"\u003cstring>","title":"\u003cstring>","content":"\u003cstring>","page":123,"relevance_score":123}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"a2302d54-9c6b-4be4-84af-0afdf7cc6422":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","uniqueKey":"error.code","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Invalid request parameters","type":"invalid_request_error","code":"bad_request"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Invalid request parameters","type":"invalid_request_error","code":"bad_request"}}}},"exampleType":"examples"}},"exampleType":"examples"},"74885ff7-9ad4-4828-b944-422954bfd905":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"},"x-ratelimit-limit-requests":{"schema":{"type":"integer"}},"x-ratelimit-remaining-requests":{"schema":{"type":"integer"}},"x-ratelimit-reset-requests":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","uniqueKey":"error.code","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Rate limit exceeded","type":"rate_limit_exceeded","code":"rate_limit_exceeded"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Rate limit exceeded","type":"rate_limit_exceeded","code":"rate_limit_exceeded"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"010d3af1-953c-4139-b880-8393db7db08a":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT or PAT","description":"Bearer token authentication. Supports two token types:\n- **JWT Access Token** — obtained via `POST /v1/auth/login`\n- **Personal Access Token (PAT)** — created via `POST /v1/api-tokens`, format: `cmnd_\u003ctokenId>.\u003csecret>`\n","scopes":[]}}},"servers":{"541e99fe-2d4a-434a-9715-1eb2a45721cc":{"url":"http://co-mind-platform-host","description":"Co-mind.ai AI Platform"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT or PAT","description":"Bearer token authentication. Supports two token types:\n- **JWT Access Token** — obtained via `POST /v1/auth/login`\n- **Personal Access Token (PAT)** — created via `POST /v1/api-tokens`, format: `cmnd_\u003ctokenId>.\u003csecret>`\n","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer token authentication. Supports two token types:\n- **JWT Access Token** — obtained via `POST /v1/auth/login`\n- **Personal Access Token (PAT)** — created via `POST /v1/api-tokens`, format: `cmnd_\u003ctokenId>.\u003csecret>`\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"co-mindai","siteName":"co-mind.ai","title":"Chat with knowledge bases (stateless RAG) - co-mind.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-10T09:27:44.681Z","originalFileLocation":"api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side. For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\">\u003cmeta data-mint-head name=\"application-name\" content=\"co-mind.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat with knowledge bases (stateless RAG) - co-mind.ai\">\u003cmeta data-mint-head property=\"og:description\" content=\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side. For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"co-mind.ai\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://co-mindai.mintlify.app/_mintlify/api/og/v2?division=Knowledge+Base\u0026amp;title=Chat+with+knowledge+bases+%28stateless+RAG%29\u0026amp;description=OpenAI-compatible+chat+endpoint+with+knowledge+base+retrieval-augmented+generation.+**Stateless**+%E2%80%94+the+client+sends+the+full+conversation+history+in+%60messages%5B\u0026amp;theme=66046237ee0d8adc8cb8f088\u0026amp;signature=235107cc93f289e0fbd007f12d1e586ab5826d431fc4afa088c76e3fe51d1933\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat with knowledge bases (stateless RAG) - co-mind.ai\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side. For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://co-mindai.mintlify.app/_mintlify/api/og/v2?division=Knowledge+Base\u0026amp;title=Chat+with+knowledge+bases+%28stateless+RAG%29\u0026amp;description=OpenAI-compatible+chat+endpoint+with+knowledge+base+retrieval-augmented+generation.+**Stateless**+%E2%80%94+the+client+sends+the+full+conversation+history+in+%60messages%5B\u0026amp;theme=66046237ee0d8adc8cb8f088\u0026amp;signature=235107cc93f289e0fbd007f12d1e586ab5826d431fc4afa088c76e3fe51d1933\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/co-mindai/No5Tvo8n-x7m9RRG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"co-mind.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.co-mind.ai/#organization\",\"name\":\"co-mind.ai\",\"url\":\"https://docs.co-mind.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/co-mindai/U0q2IjULpfUdByiO/logo/light.png?fit=max\u0026auto=format\u0026n=U0q2IjULpfUdByiO\u0026q=85\u0026s=03467e2b4fb228b6e1e862020818a9ff\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.co-mind.ai#website\",\"name\":\"co-mind.ai\",\"url\":\"https://docs.co-mind.ai\",\"publisher\":{\"@id\":\"https://docs.co-mind.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag#webpage\",\"url\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag\",\"name\":\"Chat with knowledge bases (stateless RAG)\",\"description\":\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side. For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\",\"dateModified\":\"2026-08-10T09:27:44.681Z\",\"isPartOf\":{\"@id\":\"https://docs.co-mind.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Knowledge Base\",\"item\":\"https://docs.co-mind.ai/api-reference/knowledge-base/list-knowledge-bases\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat with knowledge bases (stateless RAG)\",\"item\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag#apireference\",\"headline\":\"Chat with knowledge bases (stateless RAG)\",\"name\":\"Chat with knowledge bases (stateless RAG)\",\"description\":\"OpenAI-compatible chat endpoint with knowledge base retrieval-augmented generation. Stateless — the client sends the full conversation history in messages[] on every request; the server retrieves relevant chunks from the specified knowledge base(s), injects them as grounding context, and returns the completion. No conversation state is persisted server-side. For stateful, tool-orchestrated chat that spans knowledge bases, research, and other agents, see the Chat Sessions (Preview) endpoints (upcoming release).\",\"url\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag\",\"mainEntityOfPage\":{\"@id\":\"https://docs.co-mind.ai/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag#webpage\"},\"dateModified\":\"2026-08-10T09:27:44.681Z\",\"publisher\":{\"@id\":\"https://docs.co-mind.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.co-mind.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"co-mind.ai\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"co-mind.ai","nav":{"global":null,"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":"/platform/overview"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/installation"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"group":"Admin APIs","pages":[{"title":"Tenant Admin API","href":"/api-reference/tenant-admin"},{"title":"System Admin API","href":"/api-reference/system-admin"}]},{"group":"Authentication","pages":[{"title":"Login","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/login","href":"/api-reference/authentication/login"},{"title":"Refresh access token","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/refresh","href":"/api-reference/authentication/refresh-access-token"},{"title":"Get current user","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/auth/me","href":"/api-reference/authentication/get-current-user"},{"title":"Logout","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/logout","href":"/api-reference/authentication/logout"},{"title":"SSO login","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/sso","href":"/api-reference/authentication/sso-login"},{"title":"Check email registration","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/auth/check-registration","href":"/api-reference/authentication/check-email-registration"},{"title":"Register new user","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/register","href":"/api-reference/authentication/register-new-user"},{"title":"Confirm email","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/confirm","href":"/api-reference/authentication/confirm-email"},{"title":"Change password","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/change-password","href":"/api-reference/authentication/change-password"},{"title":"Request password reset","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/password-reset-request","href":"/api-reference/authentication/request-password-reset"},{"title":"Reset password","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/password-reset","href":"/api-reference/authentication/reset-password"}]},{"group":"API Tokens","pages":[{"title":"List API tokens","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/api-tokens","href":"/api-reference/api-tokens/list-api-tokens"},{"title":"Create API token","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/api-tokens","href":"/api-reference/api-tokens/create-api-token"},{"title":"Revoke API token","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/api-tokens/{id}","href":"/api-reference/api-tokens/revoke-api-token"},{"title":"Rotate API token","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/api-tokens/{id}/rotate","href":"/api-reference/api-tokens/rotate-api-token"},{"title":"List available token scopes","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/api-tokens/scopes","href":"/api-reference/api-tokens/list-available-token-scopes"}]},{"group":"Discovery","pages":[{"title":"List available models","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/models","href":"/api-reference/discovery/list-available-models"}]},{"group":"Completions","pages":[{"title":"Create text completion","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/completions","href":"/api-reference/completions/create-text-completion"}]},{"group":"Chat","pages":[{"title":"Create chat completion (stateless)","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/chat/completions","href":"/api-reference/chat/create-chat-completion-stateless"}]},{"group":"Knowledge Base","pages":[{"title":"List knowledge bases","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/knowledgebases","href":"/api-reference/knowledge-base/list-knowledge-bases"},{"title":"Create knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebases","href":"/api-reference/knowledge-base/create-knowledge-base"},{"title":"Get knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/knowledgebases/{id}","href":"/api-reference/knowledge-base/get-knowledge-base"},{"title":"Delete knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/knowledgebases/{id}","href":"/api-reference/knowledge-base/delete-knowledge-base"},{"title":"List files in knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/knowledgebases/{id}/files","href":"/api-reference/knowledge-base/list-files-in-knowledge-base"},{"title":"Upload file to knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebases/{id}/files","href":"/api-reference/knowledge-base/upload-file-to-knowledge-base"},{"title":"Delete file from knowledge base","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/knowledgebases/{id}/files/{file_id}","href":"/api-reference/knowledge-base/delete-file-from-knowledge-base"},{"title":"Query knowledge bases","description":"Query knowledge bases for relevant context without generating a chat response","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebases/query","href":"/api-reference/knowledge-base/query-knowledge-bases"},{"title":"Chat with knowledge bases (stateless RAG)","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/knowledgebase/chat/completions","href":"/api-reference/knowledge-base/chat-with-knowledge-bases-stateless-rag"}]},{"group":"Chat Sessions (Preview)","pages":[{"title":"List chat sessions","description":"Get all chat sessions for the authenticated user","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/chat/sessions","href":"/api-reference/chat-sessions-preview/list-chat-sessions"},{"title":"Create chat session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/chat/sessions","href":"/api-reference/chat-sessions-preview/create-chat-session"},{"title":"Get chat session","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/chat/sessions/{id}","href":"/api-reference/chat-sessions-preview/get-chat-session"},{"title":"Delete chat session","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/chat/sessions/{id}","href":"/api-reference/chat-sessions-preview/delete-chat-session"},{"title":"Update chat session","deprecated":null,"version":null,"openapi":"/openapi.yaml patch /v1/chat/sessions/{id}","href":"/api-reference/chat-sessions-preview/update-chat-session"},{"title":"Get session message history","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/chat/sessions/{id}/messages","href":"/api-reference/chat-sessions-preview/get-session-message-history"},{"title":"Send message to session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/chat/sessions/{id}/messages","href":"/api-reference/chat-sessions-preview/send-message-to-session"},{"title":"Clear session history","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/chat/sessions/{id}/clear","href":"/api-reference/chat-sessions-preview/clear-session-history"}]},{"group":"Responses","pages":[{"title":"Create response","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/responses","href":"/api-reference/responses/create-response"},{"title":"Continue a prior response","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/responses/{resp_id}/continue","href":"/api-reference/responses/continue-a-prior-response"}]},{"group":"Embeddings","pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Translation","pages":[{"title":"Translate text","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/translate/text","href":"/api-reference/translation/translate-text"}]},{"group":"Quota","pages":[{"title":"Get usage quota","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/quota","href":"/api-reference/quota/get-usage-quota"}]},{"group":"Researcher","pages":[{"title":"Web search","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/search","href":"/api-reference/researcher/web-search"},{"title":"Web search (streaming)","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/search/stream","href":"/api-reference/researcher/web-search-streaming"},{"title":"Scrape URL","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/scrape","href":"/api-reference/researcher/scrape-url"},{"title":"Start research session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/research","href":"/api-reference/researcher/start-research-session"},{"title":"List research sessions","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/sessions","href":"/api-reference/researcher/list-research-sessions"},{"title":"Get research session status","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/sessions/{id}","href":"/api-reference/researcher/get-research-session-status"},{"title":"Delete research session","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/researcher/sessions/{id}","href":"/api-reference/researcher/delete-research-session"},{"title":"Get full session data","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/sessions/{id}/full","href":"/api-reference/researcher/get-full-session-data"},{"title":"Pause research session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/sessions/{id}/pause","href":"/api-reference/researcher/pause-research-session"},{"title":"Resume research session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/sessions/{id}/resume","href":"/api-reference/researcher/resume-research-session"},{"title":"Critique research results","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/sessions/{id}/critique","href":"/api-reference/researcher/critique-research-results"},{"title":"Improve research results","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/sessions/{id}/improve","href":"/api-reference/researcher/improve-research-results"},{"title":"Analyze content","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/analyze","href":"/api-reference/researcher/analyze-content"},{"title":"Synthesize research","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/synthesize","href":"/api-reference/researcher/synthesize-research"},{"title":"Generate grant proposal","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/grant-proposal","href":"/api-reference/researcher/generate-grant-proposal"},{"title":"List credibility configs","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/credibility","href":"/api-reference/researcher/list-credibility-configs"},{"title":"Create credibility config","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/credibility","href":"/api-reference/researcher/create-credibility-config"},{"title":"Get default credibility config","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/credibility/default","href":"/api-reference/researcher/get-default-credibility-config"},{"title":"Get credibility config","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/credibility/{id}","href":"/api-reference/researcher/get-credibility-config"},{"title":"Update credibility config","deprecated":null,"version":null,"openapi":"/openapi.yaml put /v1/researcher/credibility/{id}","href":"/api-reference/researcher/update-credibility-config"},{"title":"Delete credibility config","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/researcher/credibility/{id}","href":"/api-reference/researcher/delete-credibility-config"},{"title":"Set credibility config as default","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/researcher/credibility/{id}/default","href":"/api-reference/researcher/set-credibility-config-as-default"},{"title":"Ping researcher service","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/ping","href":"/api-reference/researcher/ping-researcher-service"},{"title":"Researcher health check","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/health","href":"/api-reference/researcher/researcher-health-check"},{"title":"Detailed researcher health","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/researcher/health/detailed","href":"/api-reference/researcher/detailed-researcher-health"}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/n8n"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/release-notes"}]},{"tab":"Admin","pages":[{"title":"Admin","href":"/admin/tenant-management"}]}]},"basePath":"","title":"Chat with knowledge bases (stateless RAG) - co-mind.ai","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B7XKH4J3.js","utils-lOYzL7z-.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DF6jUUIM.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dpsj5f7C.js","snippetPresets-CYeiDe8v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CUFz1YZ_.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D8H_iLS4.js","shallow-DdluZBHX.js","getApiPlaygroundDisplay-B9922vev.js","CodeSnippet-CMoRNGYs.js","CodeSnippets-DwyrPHuw.js","Page-DSVu9Ucl.js","getPastedJson-G-zIvlHh.js","icon-B03fnEy0.js","MethodPill-CW7teklc.js","DuplicateIcon-CtO8eekd.js","createIcon-DZTKdM_A.js","DynamicMarkdown-D5M2At0B.js","SectionHeading-C_2NaA2U.js","axios-vUo_bRtp.js","Markdown-D7QRHV3m.js","clsx-D1Z-ELXV.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-lvhuD9Du.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CKfC4ywL.js"]}