Introduction
rfs-ai is a common backend API for building agentic AI experiences. It handles the boring, repetitive parts of running an agent — sessions, streaming, tool orchestration, prompt resolution, quotas — so you can focus on the part your product cares about: the tools, the prompts, and the surface where users meet the agent.
What it is
A versioned REST API at /v1/* that:
- Persists sessions and messages across turns so your client doesn't have to manage state.
- Streams responses as a chunked JSON wire format when latency matters — not SSE.
- Orchestrates tool calls with explicit lifecycle and heartbeats. Server-side (MCP-routed) tools survive client disconnects; client-supplied tools heartbeat from the device and stop if it drops.
- Resolves prompts hierarchically by product, tenant, and user so the same model behaves correctly for different consumers.
- Tracks per-account quotas in cents, so cost can't run away from you.
- Speaks to foundation models on AWS Bedrock — Claude 4.5 family across the board (Sonnet, Opus, and Haiku variants).
This documentation describes the v1 API. Endpoints are versioned by
path prefix — breaking changes will go in a future /v2.
What you can build
- Chat surfaces with token-by-token streaming over a platform-defined
chunked-JSON wire format (
{ sessionId, events: [...] }, with native Bedrock conversation events inside). - In-app agents that call back into your application via tools, with heartbeats keeping long-running operations alive.
- Quick-prompt menus whose contents are resolved per product, per tenant, and per user.
- Generative-UI flows that emit structured objects (not just text) to render in your client.
The platform doesn't care whether the surface is a NetSuite extension, a web app, a mobile client, or a backend job — it just exposes the same HTTP endpoints to everyone.
Designed to be pluggable
Every part of the platform that interacts with the outside world is configurable:
- Auth — OAuth flow is delegated to a pluggable provider library; the
JWT claims (
userPrincipal,accountDiscriminator) are platform-neutral. - Tools — plug an MCP provider into the platform's MCP gateway and reuse it across all your agents. NetSuite is the only provider open today; the registry is extensible but additional providers haven't been opened up yet.
- Models — each model is a factory function that bundles a system prompt, tool set, and inference params. Add your own.
- Products —
/v1/prompts/:product,/v1/quickprompts/:product, and friends accept any product key registered in your config.
NetSuite happens to be the first registered consumer (and you'll see it appear in examples), but nothing about the API requires it.
What's next
Three short stops will get you from zero to a working request:
- The quick start walks through obtaining a token, creating a session, and sending your first message.
- Authentication explains the JWT model and how OAuth providers are plugged in.
- Concepts introduces the domain — sessions, messages, tools — so the API reference reads naturally.