Your AI needs your data. Not your database.
For developers adding AI to existing apps: multi-step workflows that call your backend at each step, while your app keeps control of the data.
Free plan · No credit card · Test mode runs without provider keys
AI features get complicated after the first model call.
ModelRiver is a backend AI workflow orchestration platform that runs multi-step AI workflows and calls your application's backend at each step.
A model call turns into a workflow as soon as it needs your app's data, several API calls, your business rules, validation, retries, or live progress in the UI.
- Model call
- Needs your data and actions
- Now you are building a queue, webhooks, retries, and a WebSocket service
ModelRiver runs that layer. Your backend keeps the logic.
From one request to a backend pipeline
Start with one request. Add a session and it becomes a chatbot that remembers. When a step needs your data, your backend joins in.
Start simple: a chatbot
Send each new message with the session ID from the first reply. ModelRiver keeps the conversation, so you have no chat history to store.
How sessions work// First turn: ModelRiver starts a session
{ "workflow": "my_chatbot",
"messages": [{ "role": "user", "content": "My order is 1234" }] }
// Next turn: same session, new message only
{ "workflow": "my_chatbot", "session_id": "9f8c…",
"messages": [{ "role": "user", "content": "Cancel it please" }] }When a step needs your data, add your backend
You start it
Your backend starts the workflow with
POST /v1/ai/asyncand gets a channel back.ModelRiver runs the AI
Steps run in order, up to 6 in a workflow, with backup models if a provider fails.
Your backend answers
A signed webhook asks for your data. Your code applies your rules and calls back.
Users see it live
ModelRiver runs the next step and sends live progress to the browser.
// 1. Your backend starts the workflow
const headers = { "Content-Type": "application/json",
Authorization: `Bearer ${process.env.MODELRIVER_API_KEY}` };
const job = await fetch("https://api.modelriver.com/v1/ai/async", {
method: "POST", headers,
body: JSON.stringify({ workflow: "support_reply", messages }),
}).then((r) => r.json()); // channel_id, ws_token, websocket_url, ...
// 2. ModelRiver calls your webhook. Verify x-modelriver-signature first.
app.post("/modelriver/webhook", async (req, res) => {
res.sendStatus(200); // acknowledge first, then do the work
const { ai_response, callback_url } = req.body.data;
const order = await db.orders.find(ai_response.data.order_id);
await fetch(callback_url, { method: "POST", headers,
body: JSON.stringify({ data: { status: order.status, eta: order.eta } }) });
});Build the orchestration layer, or use one.
Here is what you would otherwise build and run yourself.
Build it yourself
- A job queue and workers for long AI calls
- Retry and fallback logic for each provider
- Glue code that fetches data for the model at each step
- A WebSocket service to push results to your users
- Request logs you can search when something breaks
With ModelRiver
POST /v1/ai/asyncreturns a channel right away- Failover to up to two backup models, plus webhook delivery retries
- A signed webhook to your backend at each backend step, up to 6 steps
- A hosted WebSocket channel per request, with a one-time token
- Request, webhook, and callback logs in the console
Why not give an agent direct access?
Agents tend to work best with broad access to your systems and data. With ModelRiver, your backend decides exactly what each AI step receives and which actions run.
Start with a working backend pipeline.
Each template is a ready backend pipeline you can import into a project and adapt.
Refund request triage
Classifies a refund request and suggests eligibility, amount, and a reply, then hands the result to your backend.
Built into sign-up. Runs in test mode on sample data, so no provider key is needed.
Run it freeSupport ticket triage
Classifies each ticket by category, priority, and sentiment, flags tickets that need a person, then drafts a first reply.
Needs a provider key. You can turn on test mode after import.
View templateOrder status assistant
Classifies an order question, your backend looks up the order, then it drafts a reply with next steps.
Needs a provider key. You can turn on test mode after import.
View templateEverything around the workflow.
The parts a production AI feature needs once the pipeline works.
Provider failover
Falls back to up to two backup models when the first AI call fails.
Structured outputs
Define a JSON schema and get responses checked against it.
Request logs
Every request, webhook delivery, and callback is logged in the console.
Spend limits
Set budgets per model so AI spending stays within the limit you choose.
Test mode
Run workflows on sample data, with no provider call and no provider key.
Caching
Identical repeated requests are served from cache.
Sessions
Keep conversation memory across requests with a session ID.
Providers and models
13 AI providers, 139 models, with your own API keys.
Frequently asked questions
How is this different from calling the OpenAI or Anthropic SDK directly?
The SDKs make one model call. ModelRiver runs the workflow around it: async requests your frontend can follow, a signed webhook to your backend at each backend step, failover to backup models, and logs for every request, webhook, and callback. You still use your own provider keys.
How is this different from an AI gateway?
An AI gateway sits between your app and model providers and routes each call. ModelRiver also connects to providers, but it is built around the workflow: it pauses for your backend, waits for your callback, carries the result to the next step, and sends progress to your users.
Does ModelRiver get access to my database?
No. ModelRiver never connects to your database. Your backend reads it and sends back only the fields the next step needs. Those fields are stored in your request logs and passed to later steps.
Which providers and models are supported?
ModelRiver supports 13 AI providers, 139 models in total, including OpenAI, Anthropic, Google, xAI, Mistral AI, Azure OpenAI, and Amazon Bedrock. You connect your own API keys. See the full list.
What does it cost?
The Free plan includes 25,000 requests a month. Paid plans start at $49 a month for 500,000 requests. You pay AI providers directly with your own keys. See pricing.
GitHub Client SDK on npm Changelog Status Security Founders' note