Build and interact with AI agents programmatically.
Quick Start
Template Agent
typescript
1import { inference } from '@inferencesh/sdk';23const client = inference({ apiKey: 'inf_your_key' });45const agent = client.agent('my-team/support-agent@latest');67const response = await agent.sendMessage('How can I reset my password?');8console.log(response.text);Ad-hoc Agent
typescript
1import { inference, tool, string } from '@inferencesh/sdk';23const calculator = tool('calculator')4 .describe('Perform math calculations')5 .param('expression', string('Math expression'))6 .handler(args => String(eval(args.expression)))7 .build();89const client = inference({ apiKey: 'inf_your_key' });1011const agent = client.agent({12 core_app: { ref: 'infsh/claude-sonnet-4@latest' },13 system_prompt: 'You are a helpful math assistant.',14 tools: [calculator]15});1617const response = await agent.sendMessage('What is 42 * 17?');18console.log(response.text);Features
- Template agents — Use agents from your workspace
- Ad-hoc agents — Create agents on-the-fly
- Custom tools — Define tools with fluent API
- Streaming — Real-time message updates
- Multi-turn — Automatic conversation state