Quickstart
Run your first tool as a real user.
1. Install the SDK
The SDK is the remote client for the Dexby API.
terminal
bun add @dexby.ai/sdk
2. Create an API key
Create a key under API keys in the dashboard and store it as DEXBY_API_KEY. It is shown once; Dexby keeps only a hash.
terminal
export DEXBY_API_KEY=dx_…
3. Execute a tool
Every call carries a user ID. The runtime resolves that user’s credential at call time, or the call fails.
execute.ts
import { Dexby } from '@dexby.ai/sdk'
const dexby = new Dexby()
const result = await dexby.execute({
toolId: 'slack_post_message',
input: { channel: 'general', text: 'Alert triggered' },
userId: 'user_123'
})4. Open a session
session() returns immediately and hydrates in the background. tools() and execute() wait for that work.
session.ts
const session = dexby.session({
userId: 'user_123',
sessionId: 'thread_abc123',
tools: ['slack_post_message']
})
const tools = await session.tools()
const result = await session.execute('slack_post_message', {
channel: 'general',
text: 'Hello from agent!'
})5. Use your framework
The default provider is OpenAI function calling. Other adapters are subpath exports.
providers.ts
import { AiSdkProvider } from '@dexby.ai/sdk/providers/ai-sdk'
import { MastraProvider } from '@dexby.ai/sdk/providers/mastra'
const dexby = new Dexby({ provider: new AiSdkProvider() })Connect accounts for your users from the dashboard, then call any tool in the catalog.