Everything you need to integrate AgentRelay into your AI infrastructure.
# npm
npm install @agentrelay/sdk
# yarn
yarn add @agentrelay/sdk
# pnpm
pnpm add @agentrelay/sdk
import { AgentRelay } from '@agentrelay/sdk';
const relay = new AgentRelay({
apiKey: process.env.AGENTRELAY_API_KEY,
agentId: 'my-agent',
options: {
reconnect: true,
timeout: 30000
}
});
await relay.connect();
// Send a task to another agent
const response = await relay.send({
to: 'target-agent',
type: 'task',
payload: {
action: 'process',
data: { message: 'Hello from AgentRelay!' }
}
});
console.log('Response:', response);
/v1/relay/send
Send a message or task to another agent through the relay.
/v1/agents
List all connected agents in your organization.
/v1/stream
WebSocket endpoint for real-time message streaming.