Your AI needs your data. Not your database.
Build multi-step AI workflows that call your backend APIs and business logic at each step, with live updates to your users. Your application keeps control of data, permissions, and actions.
For developers adding AI to existing applications.
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.
How a backend pipeline runs
- Your application Your backend starts the workflow with
POST /v1/ai/asyncand gets a channel back. - ModelRiver ModelRiver runs the AI step.
- ModelRiver ModelRiver sends a signed webhook to your backend.
- Your application Your code fetches only the fields needed, applies your business rules, and calls back.
- ModelRiver ModelRiver runs the next step and sends live progress to the browser.
- Your application Your app receives the final result and decides any consequential action.
// 1. Your backend starts the workflow, then sends the channel to the browser
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 } }) });
});
// 3. Your frontend gets live updates (@modelriver/client/react)
const { connect, steps, response } = useModelRiver();
connect({ channelId: job.channel_id, wsToken: job.ws_token,
websocketUrl: job.websocket_url, websocketChannel: job.websocket_channel });- Up to 6 stepsSteps run in order. Each one is a backend step or an AI step.
- Signed webhooksCheck the
x-modelriver-signatureheader. Deliveries are retried up to 3 times. - 10-minute callback windowAcknowledge the webhook right away, then call back within 10 minutes.
Your application stays responsible for authorization, validation, and business rules. ModelRiver does not replace them.
How backend pipelines workBuild 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, 133 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, 133 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 $9 a month. You pay AI providers directly with your own keys. See pricing.
GitHub Client SDK on npm Changelog Status Security Founders' note