Quick start

This guide takes you from nothing to a working AI response in roughly five minutes. We'll authenticate, create a customized session, and send a message.

Prerequisites

  • A user account on a platform registered with the agent's OAuth provider, and a JWT from completing the OAuth flow.
  • A way to make HTTP requests (curl, Postman, or fetch).
  • The base URL for your environment:
    • Development: https://inference.dev.ai.rfsmart.com
    • Test: https://inference.test.ai.rfsmart.com
    • Production: provisioned per deployment
Tip

For local development, the server exposes Swagger UI at /swagger — useful for poking around interactively before writing code.

Make your first call

Authenticate

Every request carries an OAuth-issued JWT as a Bearer token (or as an Authorization cookie if the caller is an in-app surface with SSO):

# Set these for all subsequent requests
export BASE_URL=https://inference.dev.ai.rfsmart.com
export TOKEN=your-oauth-jwt-here
Note

Don't have a token yet? Follow the OAuth flow — it hands one back via /v1/oauth/callback.

Create a customized session

Every conversation lives inside a session. The recommended starting point is to explicitly pick an agent when you create one, even if you're just naming the default. Send a customizations object with an agentId:

curl -X POST "$BASE_URL/v1/sessions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customizations": {
      "agentId": "RfsAgent",
      "extensions": {}
    }
  }'
Info

If you create a session without a customizations body, the backend falls back to the default agent (DEFAULT_AGENT_ID, which ships as RfsAgent — the Warehouse Smart Agent) when you send the first message. Naming it explicitly makes the behavior obvious to the next person reading your code, and gives you a hook to attach extensions (tools, RAG, MCP providers) without changing the call shape.

Save the returned sessionId — you'll use it for every subsequent message and tool call.

Send a message

Post the user's message into the session. The default endpoint returns the full assistant reply once it's ready. Use the /stream variant for token-by-token delivery — see the Messages reference.

curl -X POST "$BASE_URL/v1/messages/$SESSION_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Hello — can you help me draft a release note?" }'

You should get back the full message list, with the new assistant reply at the end. If the agent decided to call a tool, the reply will include a pending tool request you need to fulfill — see Tools for that flow.

Where to go next