Documentation

Quickstart

From an agent to a working action in four steps.

Before you start, request early access to get the SDK and an Application.

1. Configure an agent

Choose one task. Set instructions, connect a model and add the agent to your Application. Use the operator App in the browser, or files and the CLI.

2. Connect your users

Authenticate users on your backend and issue each one a scoped token. Your runtime key stays on the server.

server.ts
const operation = server.prepareUserToken({ external_user_id: authenticatedUser.id });
// Persist the operation before dispatch for recovery.
const issued = await server.issueUserToken(operation);
// Return user, token and expires_at to this user only.

See User token.

3. Send the first message

Create the browser client with the token and send an input. Keep the returned session ID to continue the conversation.

client.ts
const operation = client.prepareInput({ agent_id: selectedAgentId, text: 'Where is my order?' });
// Persist the operation before dispatch for recovery.
const ack = await client.submitInput(operation);
const sessionId = ack.session_id; // Accepted, not yet answered.

See TypeScript client and React and Next.js.

4. Let it take action

Connect a tool as a webhook to your backend. Your service checks what the user may do and performs the business action.

See Tools through your backend.