Prompt

How do I add a chatbot API to my app without training a model?

Artificial Intelligence / AI Platforms1 observationLast seen Sep 30, 2026

Latest observation

Sep 30, 2026OpenAI APIWeb search: off

You can add a chatbot to your app without training your own model by using an existing AI API (hosted model) and wrapping it in your app’s backend.

Typical approach

1. Pick an API provider

Common options:

  • OpenAI API
  • Anthropic API
  • Google Gemini API
  • Azure OpenAI
  • Cohere
  • Open-source hosted providers like Groq, Together, Fireworks

These give you access to a pretrained model, so you don’t need to train anything.

2. Build a small backend

Don’t call the AI API directly from your frontend if you can avoid it, because that exposes your secret API key.

Your backend should:

  • receive user messages from your app
  • send them to the chatbot API
  • return the AI response to the client

3. Send conversation context

To make it feel like a real chatbot, include:

  • system instructions
  • conversation history
  • optional user profile or app data

Example structure:

{
  "messages": [
    {"role": "system", "content": "You are a helpful support assistant."},
    {"role": "user", "content": "How do I reset my password?"}
  ]
}

4. Add optional app data

If you want the bot to answer based on your own content, you can use:

  • retrieval-augmented generation (RAG)
  • a vector database
  • document search
  • function calling / tool use

This lets the chatbot use your data without model training.


Simple example

Backend example in Node.js

import express from "express";
import OpenAI from "openai";

const app = express();
app.use(express.json());

const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

app.post("/chat", async (req, res) => {
  const { message, history = [] } = req.body;

  const response = await client.chat.completions.create({
    model: "gpt-4o-mini",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      ...history,
      { role: "user", content: message }
    ]
  });

  res.json({ reply: response.choices[0].message.content });
});

app.listen(3000, () => console.log("Server running on port 3000"));

Frontend call

const res = await fetch("/chat", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ message: "Hello!" })
});

const data = await res.json();
console.log(data.reply);

What to watch out for

  • API key security: keep keys on the server
  • costs: chat APIs are usually pay-per-token
  • latency: responses may take a second or two
  • moderation/safety: add guardrails if your app needs them
  • conversation memory: store history in your database if needed

If you want your bot to use your own docs

Use one of these:

  • upload docs into a vector database
  • search relevant passages first
  • include those passages in the prompt
  • or use a provider’s built-in file search / retrieval tools

This is usually better than fine-tuning for support bots and knowledge assistants.


Recommended architecture

Frontend → Your backend → AI API → Your backend → Frontend

If you want, I can show you:

  1. a React + Node chatbot example
  2. a Python/FastAPI version
  3. how to connect it to your own documents without training the model

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.