---
title: "OpenAI Agents SDK Voice Agent in Node.js | Micdrop"
description: "Give a voice to an agent of the OpenAI Agents SDK for TypeScript: its tools, guardrails and handoffs answer a live call through any speech to text and voice."
url: "https://micdrop.dev/docs/agents/openai-agents"
---

# OpenAI Agents SDK Voice Agent in Node.js

`@micdrop/openai-agents` answers a call with an agent of the [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/), in a pipeline with the speech to text and the voice of your choice. It keeps everything the agent already has: its instructions, model, tools, guardrails and handoffs.

## Installation

```bash
npm install @micdrop/openai-agents @openai/agents
```

## Usage

```typescript
import { Agent } from '@openai/agents'
import { OpenaiAgentsAgent } from '@micdrop/openai-agents'
import { endCallTool, MicdropServer } from '@micdrop/server'

const billing = new Agent({
  name: 'Billing',
  instructions:
    'You answer questions about invoices, in short spoken sentences.',
})

const triage = new Agent({
  name: 'Triage',
  instructions: 'You greet the caller and route them.',
  handoffs: [billing],
})

new MicdropServer(socket, {
  stt,
  tts,
  agent: new OpenaiAgentsAgent({
    agent: triage,
    tools: [endCallTool()],
  }),
})
```

The answer reaches the voice as the agent writes it. The SDK keeps its own history between turns, reasoning and handoffs included, and the tools and handoffs it runs are recorded in the conversation of the call.

## Handoffs

After a handoff of the SDK, the agent it handed over to answers the next turns. `currentAgent` returns it. The tools of the call, such as `endCallTool()`, are added to whichever agent answers.

Micdrop’s own [`handoffTool()`](/docs/agents/handoff) works too, to hand the call over to an agent of another kind, a Mistral or Mastra agent for instance.

## Options

Option

Type

Description

`agent`

`Agent` of the SDK

The agent answering first

`systemPrompt`

`string`

Goes before its instructions for this call

`runOptions`

options of `run()`

Any other option, such as `context` or `maxTurns`

`tools`

`Tool[]`

Tools of the call, added to the agent’s own

`transforms`

`AnswerTransform[]`

Rework the answers, see [extract](/docs/server/extract)

A spoken answer starts sooner with reasoning off, through the `modelSettings` of the SDK agent, as its model accepts.
