Skip to content
RSFlowHub
  1. Home
  2. APIs
  3. Conversational AI
  4. AI Conversational Chat API
Conversational AI API

AI Conversational Chat API

Conversational text completion and multi-turn chat API for building intelligent assistants and interactive web apps.

POST https://rsflowhub.com/api/v1/ai/chat
  • 1 credit per call
  • X-API-Key header
  • JSON in, JSON out
POST /api/v1/ai/chat
{
    "message": "What is the capital of France?",
    "conversation": [
        {
            "role": "user",
            "content": "Hello AI."
        },
        {
            "role": "assistant",
            "content": "Hello! How can I help you?"
        }
    ],
    "system_prompt": "You are a helpful geography expert."
}
200 OK response.json
{
    "result": {
        "message": "Here are three ideas: 1) PocketPlan, 2) CampusCash, 3) SemesterSaver."
    }
}
Definition

What is the AI Conversational Chat API?

AI Conversational Chat API is a REST API on RSFlowHub for web, mobile and AI agent applications. Send a JSON request to POST /api/v1/ai/chat with your API key; RSFlowHub runs it on a tuned AI model, falls back to a backup provider if needed, and returns a structured JSON result, usually within 1 to 3 seconds.

Endpoint
POST /api/v1/ai/chat
Authentication
X-API-Key header
Price
1 credit per call
Rate limit
10 to 120 requests / minute by plan
Typical response
1 to 3 seconds
Format
JSON, UTF-8

Request parameters

Send these fields as a JSON body. An invalid or missing field returns a 422 error that names the field.

FieldTypeRequiredDescription
message string Required The latest message from the user (Max: 15,000 chars)
conversation array of objects Optional Previous chat history to maintain context. Each object must have "role" (system, user, assistant) and "content" (string).
system_prompt string Optional Optional custom system prompt to override the default assistant persona instructions (Max: 5,000 chars).
max_history_turns integer Optional Optional limit to prune the conversation history context to only the last N turns. Prevents token inflation (1 to 20).
safe_mode boolean Optional Optional. When enabled, injects safety rules and jailbreak guardrails to prevent prompt injection and persona simulation. Default is false.

Code examples

Copy, replace rfh_your_api_key with your key and run. Prefer a client library? See the official SDKs.

request.sh
curl -X POST "https://rsflowhub.com/api/v1/ai/chat" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: rfh_your_api_key" \
  -d '{"message":"What is the capital of France?","conversation":[{"role":"user","content":"Hello AI."},{"role":"assistant","content":"Hello! How can I help you?"}],"system_prompt":"You are a helpful geography expert."}'

Response

Every RSFlowHub endpoint uses the same envelope, so one parser handles all of them. Failed calls are not charged.

response.json
{
    "success": true,
    "request_id": "req_3f9a2c7e-5b1d-4e8a-9c2f-7d6e1a0b4c8d",
    "data": {
        "result": {
            "message": "Here are three ideas: 1) PocketPlan, 2) CampusCash, 3) SemesterSaver."
        }
    },
    "meta": {
        "version": "v1",
        "timestamp": "2026-10-05T09:30:00Z"
    }
}
Envelope fields
FieldTypeMeaning
successbooleantrue when the call worked, false on any error.
request_idstringUnique id for this call. Quote it when you contact support.
data.resultobjectThe result of this endpoint (see the example).
errorobjectOnly on failure: code, message and details per field.
metaobjectAPI version and server timestamp.

All error codes: Errors reference

Features

Multi-Turn Conversation History

Preserves multi-turn chat message arrays with user, assistant, and system roles for contextual continuity.

Custom System Instructions

Control assistant persona, business guardrails, and system grounding rules via system prompts.

Fast, Predictable Responses

High-throughput infrastructure optimized for real-time chat widgets and web application backends.

Uniform Developer Envelope

Returns structured JSON envelopes with status code, execution metrics, and clean response payload.

Use cases

How teams use the AI Conversational Chat API in production.

Customer Support

In-App Customer Support Assistant

Deploy intelligent in-app chat assistants to answer common customer inquiries 24/7.

Input
What are your business operating hours?
Output
Our support team is available Monday through Friday from 9 AM to 6 PM EST.

Answers routine customer inquiries automatically so agents focus on complex cases.

EdTech

Interactive Educational Tutors

Build interactive learning bots that guide students step-by-step through complex subjects.

Input
Explain photosynthesis in simple terms.
Output
Photosynthesis is how plants turn sunlight, water, and air into food and oxygen!

Delivers personalized 1-on-1 tutoring at unlimited scale.

SaaS & Web Apps

SaaS Product Assistant

Embed conversational prompts inside SaaS dashboards to help users perform complex actions.

Input
How do I export my monthly invoice report?
Output
Go to Billing > Invoices, then click the "Download Monthly PDF" button.

Accelerates user onboarding and boosts feature adoption.

AI chatbot

Build a custom AI chatbot with the chat API

If you want full control of the chat experience, the chat API gives your own app a conversational reply from a single endpoint, with provider fallback and one bill. Combine it with a knowledge base so replies are grounded in your content.

How it works in a chatbot

  1. Your app sends the conversation so far
  2. API returns: the next assistant reply
  3. Your UI shows it in your own chat window

Your design, your rules

Build the chat interface yourself and keep the system prompt and tone under your control.

One key for every model

No separate OpenAI, Gemini or DeepSeek accounts to manage.

Or skip the build

The RSFlowHub chat widget gives you a finished chatbot with leads, tickets and auto replies from one script tag.

Want a chatbot without building one? The RSFlowHub AI chatbot for your website is live in about 5 minutes with one script tag: it answers from your documents, captures leads and creates support tickets. Read the chat widget guide, try the live chatbot demo, see chatbot pricing, or build your own with the chatbots API.

AI Conversational Chat API vs building it yourself

The same job done three ways.

TopicRSFlowHub APIRaw LLM promptsRules / regex
Output Validated JSON fieldsFree text you have to parseFixed patterns only
Setup One POST request, no promptsWrite and maintain prompts and parsingWrite and maintain rule lists
Provider outage Automatic fallback to a backup modelYou build retries and a second vendorNot applicable
Pricing 1 credit per call, failed calls freePer token, per vendorYour own servers and upkeep
Understands context Yes, AI modelYes, AI modelNo, keywords only

Frequently asked questions

Which programming languages are supported?
RSFlowHub Chat API is a standard RESTful endpoint. You can integrate it using cURL, PHP (Laravel), Node.js / JavaScript, Python, Go, Java, or any HTTP client.
Can I pass multi-turn conversation history?
Yes! Simply include the "conversation" array containing previous user and assistant turns to maintain contextual continuity.
How do system prompts work?
System prompts allow you to define the AI assistant persona, tone, knowledge boundaries, and operational instructions prior to processing the user message.
How many credits does each request consume?
Standard AI Chat API calls consume 1 base credit per request.
Is conversation data stored on RSFlowHub servers?
No. All payload data is processed securely in memory and never stored or retained for public model training.

Start using the AI Conversational Chat API

Free plan with 100 credits/month + 1,000 bonus credits when you sign in before 23 Nov. Test it in the playground first, no code needed.

RSFlowHub

Sign in to continue

You'll come straight back to this page.

Forgot password?

New to RSFlowHub? Create a free account