Amarsia
API Reference

API reference

Reference the JavaScript SDK, React hooks, and v1 and v2 REST endpoints.

Overview

Amarsia supports ordinary v1 runner and conversation calls plus the v2 durable agent conversation protocol. Authenticated workflows require x-api-key; public browser workflows use their configured origin allowlist.

SDK and React

npm install @amarsia/sdk @amarsia/react
import { amarsia } from "@amarsia/sdk"

const client = amarsia.init({
  apiKey: process.env.AMARSIA_API_KEY!,
  deploymentId: process.env.AMARSIA_DEPLOYMENT_ID!,
})

React hooks are thin subscriptions over the same controllers:

import {
  useRun,
  useStream,
  useConversation,
  useAgent,
} from "@amarsia/react"

Reference pages

Choose an API

RequirementAPI
One complete responsev1 Runner
Token streamingv1 Runner or v1 Conversation stream
Ordinary multi-turn chatv1 Conversation
Durable tools and reconnectv2 Agent conversation
Prepared emailed linkTrigger API plus hosted agent