Answer: Use the Embeddings and Chat Completions APIs together: create document embeddings for your knowledge base, embed the user's question to find the most relevant sections, then use that context to prompt the Chat Completions endpoint to generate an answer. Status: Confirmed Entry: tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions Revision: 1 Digest: sha256:0bd4f7da3aba2548 (changes whenever the content changes) Timeline: Created: 2026-11-20T11:54:57Z Last changed: 2026-11-20T11:54:57Z Last verified: 2026-11-20T11:54:57Z Next check: 2026-11-21T11:54:57Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of APIs to use | Embeddings and Chat Completions APIs | [1] | 2026-11-20 Step 1 | Use our Embeddings endpoint to make document embeddings for each section. | [1] | 2026-11-20 Step 2 | turn it into a query embedding and use it to find the most relevant sections from your knowledge base | [1] | 2026-11-20 Step 3 | create a prompt for the Chat Completions endpoint | [1] | 2026-11-20 Update date | May 21 2025 | [1] | 2026-11-20 Sources: [1] OpenAI. "How to use the OpenAI API for Q&A or to build a chatbot?". https://help.openai.com/en/articles/6643167-how-to-use-the-openai-api-for-qa-or-to-build-a-chatbot Role: primary. Accessed: 2026-11-20T11:54:59Z Retrieved via: DeepSeek Fetch API (Markdown conversion; the original server response was not captured) Quote: "The Embeddings and Chat Completions APIs are a great combination to use when building a question-answering or chatbot application." (Supports: APIs to use) Quote: "Use our Embeddings endpoint to make document embeddings for each section." (Supports: Step 1) Quote: "turn it into a query embedding and use it to find the most relevant sections from your knowledge base." (Supports: Step 2) Quote: "Use the relevant context from your knowledge base to create a prompt for the Chat Completions endpoint, which can generate an answer for your user." (Supports: Step 3) Quote: "As of May 21 2025, we’ve added new built-in tools to the Responses API" (Supports: Update date) Snapshot SHA-256: ff7abe398ed14b3de21167c30cbad6c3ff2e0ffe5de28d84d7c945ec82a8912b (captured 2026-11-20T11:54:59Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. [1] was retrieved through the DeepSeek Fetch API because a direct request did not return usable content. Cross-check: not-available at 2026-11-20T11:54:57Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:54:57Z Last attempt: 2026-11-20T11:54:57Z Notes and limitations: Extracted automatically from a single official source (section "How to use the OpenAI API for Q&A or to build a chatbot?"). Related: https://latestn.com/tool/chatgpt/agents-and-automation/change-team-task-future-runs How do I change what a ChatGPT team task does in future runs? https://latestn.com/tool/chatgpt/agents-and-automation/convert-gpt-to-plugin How do I convert my custom GPT into a plugin and test it before sharing? https://latestn.com/tool/chatgpt/agents-and-automation/create-plugin-from-scratch How do I create a plugin in ChatGPT from scratch? https://latestn.com/tool/chatgpt/admin-and-enterprise/workspace-roles What workspace roles are available in ChatGPT Enterprise and Edu? https://latestn.com/tool/chatgpt/agents-and-automation/ask-agents-for-help-in-space How do I ask ChatGPT or a dot for help with a page in Space? https://latestn.com/tool/chatgpt/agents-and-automation/background-thread-locations Where can I find and continue threads my ChatGPT dot created in the background? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T11:54:57Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions POST: https://latestn.com/dispute/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I build a question-answering or chatbot application with the OpenAI API? Revision 1, last verified 2026-11-20T11:54:57Z. https://latestn.com/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions (accessed 2026-11-21T10:05:52Z). @misc{LatestN_tool_chatgpt_agents_and_automation_build_qa_chatbot_with_embeddings_and_chat_completions_r1, title = {How do I build a question-answering or chatbot application with the OpenAI API?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions}}, note = {Revision 1; digest sha256:0bd4f7da3aba2548; last verified 2026-11-20T11:54:57Z; accessed 2026-11-21T10:05:52Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/chatgpt/agents-and-automation/build-qa-chatbot-with-embeddings-and-chat-completions