On this page

How do I test ModelRiver webhooks on my local machine?

Updated

Use the ModelRiver CLI. It receives your webhook events and forwards them to your local server, so you don't need ngrok, a tunnel or a public URL.

What's the quickest way to start?#

Run this, with nothing to install:

npx @modelriver/cli listen --print

It prints every webhook event in your terminal. Add --port 3001 --forward to also send each event to your app on localhost.

How do I set it up for everyday use?#

  1. Install it: npm install -g @modelriver/cli
  2. Run modelriver login once. Enter your API key and the local URL that should receive webhooks, for example http://localhost:3001/webhook/modelriver.
  3. Run modelriver forward whenever you're developing.

Can I trigger a request from the terminal?#

Yes. modelriver trigger sends an async request to a workflow, so you can test the whole flow without clicking through your app. modelriver websocket checks that the WebSocket side works.

How do I test a backend pipeline callback?#

When your backend receives the AI result, it normally calls back to ModelRiver. While developing you can do that step by hand:

modelriver callback --channel-id <channel_id> --data '{"summary":"..."}'

Do test events cost requests?#

Webhook deliveries and callbacks don't count as requests. The AI request that started them does, unless the workflow is in test mode.

Learn more#

Was this article helpful?