Python and JavaScript SDKs

Use the SDKs when you want your own code, like your CRM or your app, to place calls, start campaigns, chat with an agent and collect the results.

Install

Python

pip install woise

Needs Python 3.9 or newer. Add "woise[live]" if you want live audio.

JavaScript

npm install @woise/sdk

Works in Node 18 or newer, Deno, Bun and edge workers, and includes types.

Get a key

Create a key on the MCP page, under Developer, as described in MCP and keys. Keep it on your server and never put it in a web page.

The key decides the region. A key that starts with sk-woise-us- talks to the US cell, and sk-woise-in- talks to India. You don't set anything else.

Place a call

Python

import os
from woise import Woise, Agent

woise = Woise(os.environ["WOISE_API_KEY"])

agent = Agent("Smile Dental", prompt="You are Priya, the receptionist at Smile Dental.")
agent.start("greet", say="Hi, this is Priya from Smile Dental.",
            prompt="Confirm tomorrow's visit.",
            next={"done": "they confirmed or cancelled"})
agent.end("done", say="Thanks, bye.")
saved = woise.agents.save(agent, publish=True)

call = woise.calls.create(agent=saved, to="+14155550123", variables={"first_name": "Ravi"})
print(call.status, call.id)

JavaScript

import { Agent, Woise } from "@woise/sdk";

const woise = new Woise(process.env.WOISE_API_KEY);

const agent = new Agent("Smile Dental", { prompt: "You are Priya, the receptionist at Smile Dental." })
  .start("greet", { say: "Hi, this is Priya from Smile Dental.", prompt: "Confirm tomorrow's visit.", next: { done: "they confirmed or cancelled" } })
  .end("done", { say: "Thanks, bye." });
const saved = await woise.agents.save(agent, { publish: true });

const call = await woise.calls.create({ agent: saved, to: "+14155550123", variables: { first_name: "Ravi" } });
console.log(call.status, call.id);

What else you can do

  • Campaigns: start one from a CSV of contacts, then launch, pause and resume it.
  • Chat: start a chat with an agent and send it messages.
  • Results: list past runs with their transcripts, the answers your agent collected and a link to the recording.
  • Webhooks: get a message at your own address when a call or chat ends, and check that it really came from Woise before you trust it.
  • Live voice: connect a phone system or a browser to an agent in real time. For a browser, your server makes a short-lived token and the page uses that, not your key.

The full list of examples is in the README for each package: Python and JavaScript.