Failover, rate limiting, webhooks, websockets, and structured data. Everything you need.
$ curl https://api.modelriver.com/v1/ai/async \
-H "Authorization: Bearer YOUR_MR_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Explain AI"}],
"workflow": "book_review"
}'
Production-grade features built in
Automatic provider switching when rate limits or errors occur. Zero downtime.
Per-user, per-IP, and per-project rate limiting. Protect your API from abuse.
WebSocket live updates for real-time responses. Instant feedback as content generates.
Background jobs with automatic retry. Process AI requests asynchronously.
JSON schema validation for consistent outputs. Define once, enforce everywhere.
Real-time dashboards with request logs, token usage, and performance metrics.
One request. Infinite possibilities.
{
"messages": [
{
"role": "user",
"content": "Explain AI"
}
],
"workflow": "book_review",
"task_id": "task_789",
"user_id": "user_456"
}
{
"message": "success",
"status": "IN_PROGRESS",
"channel_id": "abc-123",
"customer_data": {
"task_id": "task_789",
"user_id": "user_456"
},
"ws_token": "token-xyz",
"websocket_url": "wss://..."
}
{
"message": "success",
"status": "SUCCESS",
"channel_id": "abc-123",
"customer_data": {
"task_id": "task_789",
"user_id": "user_456"
},
"data": {
"choices": [...]
},
"meta": {
"workflow": "book_review",
"duration_ms": 1234
}
}