Sunesis Developers
Browse documentation +

Start here

Capabilities

Build with Sunesis

SDKs

API reference

Platform

Manage your account

Changelog
GETTING STARTED

Build with Sunesis

Build real-time characters, expressive voices, and capable agents from one platform.

Sunesis is the character, voice, video, and conversation layer for AI. Every capability is available three ways: in the Studio (no code), through the REST API, and via the official SDKs.

Get your API key

Authenticate every request with a bearer token in the Authorization header. Keys are issued from your dashboard — create a free account to generate one (free tier included, no card required).

Choose your path

Three ways to build

Every capability below is reachable from all three. Pick the one that matches how your team works — you are not locked in, and a character built in Studio is callable from the API the same day.

Browse by capability

Jump straight to it

If you already know what you need, this is the shortest route to it.

Characters

Voice

Video

Conversation

Concepts

Four things worth knowing first

These terms carry the same meaning everywhere in the platform.

Characters
A face, a voice, and a persona bound together. The same definition drives a still avatar, a rendered video, and a live call, so a character stays recognisably itself across surfaces.
Voices
Either a stock voice or a clone you created from consented audio. Clones belong to the workspace that made them and are never shared across accounts.
Agents
A character plus instructions, tools it may call, and the knowledge it may ground answers in. Agents hold conversations; characters only speak.
Credits
One balance across voice, video, and conversation. Requests draw from it as they complete, and a call that would exceed the balance is refused rather than truncated.

Quickstart

Make your first request

Create a key in the dashboard, send one request, and receive audio back. Start with the language your team already uses.

curl https://api.sunesis.ai/v1/voice/generate \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "voice": "aria", "text": "Hello from Sunesis." }'

Character generation

Create the person behind the conversation

A Sunesis character combines a visual presence, a signature voice, and an agent persona. Start from a preset or build a reusable character for your product.

01

Shape the presence

Choose a natural, stylized, or brand-led visual direction for the screen.

02

Give it a voice

Pair the character with a Sunesis voice or a consented voice clone.

03

Connect its mind

Attach an agent persona, memory, and the tools it needs to be useful.

Ready to design your first real-time character?

Open Character Studio

Voice

Speech that sounds human

Synthesize, transcribe, clone, and stream speech, the voice building blocks behind every Sunesis product.

Capability guide

Text to Speech

Generate expressive spoken audio from plain text for narration, product UX, and a character's spoken turn.

What to configure

  • The text to speak and its intended language
  • A voice or approved clone
  • Delivery controls such as pace, expression, and audio format

Implementation flow

  1. 1Create or select a voice in Studio
  2. 2Send text to the voice generation endpoint
  3. 3Stream playback immediately or store the returned audio with your asset

In production

Keep the text you send concise for conversational turns. For long-form work, split at natural sentence boundaries and preserve the order in your own queue. Open product

Capability guide

Speech to Text

Turn recorded or live speech into structured text your product can search, summarize, or route to an agent.

What to configure

  • An audio or video file, or an incoming live audio stream
  • Optional language and vocabulary context
  • Whether your downstream system needs timestamps or speaker turns

Implementation flow

  1. 1Upload audio or connect the stream
  2. 2Request a transcript with the metadata you need
  3. 3Store the transcript alongside the original session or hand it to an agent

In production

Treat transcription as an event in your workflow. Persist segment and speaker metadata so reviews, corrections, and handoffs remain traceable. Open product

Capability guide

Voice Cloning

Create a reusable voice identity from a clearly consented recording for a person, brand, or approved performer.

What to configure

  • A clean, consented recording
  • Voice ownership and usage approval
  • A name and description your workspace can recognize

Implementation flow

  1. 1Collect and verify consent before upload
  2. 2Create the voice in Studio
  3. 3Review a short test script before using the voice in a production flow

In production

Build consent into the product flow, not a later review. Keep the original approval and the clone's intended use attached to the project record. Open product

Capability guide

Realtime Streaming

Use bidirectional streaming to make spoken experiences feel immediate in a call, a live agent, or an on-screen character.

What to configure

  • A client audio source or text stream
  • A selected voice and session context
  • Your interruption, buffering, and reconnect rules

Implementation flow

  1. 1Open a session before the user speaks
  2. 2Send partial input as it arrives
  3. 3Play returned chunks incrementally and stop cleanly when the user interrupts

In production

Design for interruption first. A great real-time experience stops, listens, and recovers without replaying stale audio to the user. Open product

Video

Faces that speak

Turn a script into a talking digital character, generate scenes from a prompt, or train a reusable avatar.

Capability guide

Talking Avatars

Render an on-screen speaker that turns a voice or script into a responsive, lip-synced visual conversation.

What to configure

  • A character or approved visual preset
  • Spoken audio or a script and voice
  • The destination aspect ratio and playback context

Implementation flow

  1. 1Choose a character in Character Studio
  2. 2Connect its voice and agent persona
  3. 3Launch it in your product's call or presentation surface

In production

Match the visual presence to the user's task. High-trust support and training use cases benefit from restrained framing and clear disclosure. Open product

Capability guide

Video Generation

Produce generated video scenes for product storytelling, campaigns, and character-led creative work.

What to configure

  • A scene brief with subject, setting, and action
  • An aspect ratio and delivery format
  • Optional brand, character, or reference direction

Implementation flow

  1. 1Draft the scene in Studio
  2. 2Generate an initial take and review the result
  3. 3Export approved shots or combine them with voice and character layers

In production

Use short, intentional scene briefs. Treat every generated take as a reviewable asset before it reaches a public audience. Open product

Capability guide

Custom Avatars

Create a repeatable visual persona for a specific person or brand instead of selecting a general-purpose preset.

What to configure

  • A properly authorized reference capture
  • A character name and intended product role
  • A review workflow for test conversations

Implementation flow

  1. 1Capture approved reference material
  2. 2Configure the character in Studio
  3. 3Run voice and video previews before assigning the persona to a live agent

In production

Keep custom character access scoped to the people who need it. Establish an approval step for changes to appearance, voice, or knowledge. Open product

Conversation

Agents that listen and reply

Give agents a persona, memory, and tools, then talk to them over text, voice, or video.

Capability guide

Agents

Build an agent that can speak, listen, remember the current session, and take action through the tools you connect.

What to configure

  • A role, operating instructions, and opening message
  • A knowledge source or approved context
  • The functions the agent is allowed to call

Implementation flow

  1. 1Define a persona with a clear job
  2. 2Connect knowledge and tools
  3. 3Test the full conversation path with expected and edge-case questions

In production

Give each agent one clear responsibility. Route complex or sensitive requests to a human instead of expanding a single agent beyond a safe scope. Open product

Capability guide

Memory & Sessions

Maintain useful context between turns so the user does not have to repeat their goal, preferences, or previous answer.

What to configure

  • A session identifier from your application
  • The context that should persist
  • Retention and deletion rules appropriate to the experience

Implementation flow

  1. 1Create a session when a conversation begins
  2. 2Attach relevant context on each turn
  3. 3Close or clear the session according to your product's policy

In production

Store only the context that makes the next response better. Give users a clear path to restart or remove a conversation when that is appropriate. Open product

Capability guide

Tools & Actions

Let an agent move beyond conversation by calling your own verified services, from account lookups to appointment booking.

What to configure

  • A narrowly scoped function schema
  • Validated parameters and a trusted backend
  • A user-facing response for success and failure

Implementation flow

  1. 1Describe the action and its required fields
  2. 2Validate the request on your server
  3. 3Return a concise result the agent can explain to the user

In production

Do not give an agent direct authority over sensitive actions. Put validation, permissions, and audit logging behind every tool call. Open product

Models

The models behind each interaction

Select the right surface for the moment. Sunesis handles the real-time infrastructure underneath.

Sunesis Voice v2Voice

The flagship text-to-speech model, expressive, multilingual, and quick to first byte (~180ms).

Sunesis ScribeVoice

Speech recognition with diarization, timestamps, and strong accuracy on noisy, real-world audio.

Sunesis RenderVideo

Generates talking-head video and trains custom avatars from a short reference clip.

Sunesis ConverseConversation

The reasoning model behind agents, with tool use and memory that persists across sessions.

Sunesis DubVoice + Video

Cross-lingual dubbing that keeps the original speaker's voice, timing, and emotion intact.

Ways to build

Choose the path that fits your team

Use Studio for a fast prototype, then bring the same primitives into your product with the SDKs or API.

Capability guide

Web App

Use Sunesis Studio to prototype a complete voice, video, or character flow before you commit it to code.

What to configure

  • A product goal or conversation brief
  • The voices, characters, or media assets to explore
  • A small test script or scenario

Implementation flow

  1. 1Create the experience in Studio
  2. 2Preview it with real prompts and controls
  3. 3Carry the chosen configuration into your application integration

In production

Use Studio as the shared review space between product, design, and engineering. Ship only the settings your team has tested together. Open product

Capability guide

SDKs

Use the official SDKs when you want typed requests, clear integration patterns, and a straightforward upgrade path.

What to configure

  • A server-side Sunesis API key
  • Your chosen language runtime
  • A place to store generated media or session state

Implementation flow

  1. 1Install the SDK for your runtime
  2. 2Initialize it with a server-held key
  3. 3Call the product primitive and handle the result in your own application

In production

Never place long-lived API keys in a browser bundle. Keep credentials on your server and issue your client only the access it needs. Open product

Capability guide

REST API

Use the REST API when you need direct control over HTTP requests, webhooks, or an integration language without an SDK.

What to configure

  • A bearer token from your workspace
  • A JSON request body for the selected product primitive
  • Your own timeout, retry, and idempotency strategy

Implementation flow

  1. 1Authenticate with a server-side bearer token
  2. 2Send a focused request to the relevant endpoint
  3. 3Persist the result or stream it into the next stage of your workflow

In production

Log request identifiers and outcomes, not sensitive customer content. Add retry behavior only where repeating the operation is safe. Open product

Capability guide

MCP Server

Connect Sunesis capabilities to an MCP-compatible development environment so your team can explore and automate the platform from its tools.

What to configure

  • An approved MCP client
  • A scoped workspace credential
  • A clear set of actions the client is permitted to perform

Implementation flow

  1. 1Add the Sunesis MCP connection
  2. 2Authenticate with a limited-scope credential
  3. 3Use tool calls to inspect, prototype, and document your integration

In production

Use separate credentials for development and production. Review the tools exposed to each environment before granting a team-wide connection. Open product

Reference

Endpoints

Every route is versioned under /v1, accepts and returns JSON, and authenticates with the same bearer token. The scope beside each path is the minimum an API key needs to call it.

Voice

POST/v1/voice/generate

Generate speech

Turn text into spoken audio with a stock voice or one of your workspace's clones. Returns a hosted audio file, or streams PCM frames when you ask for them.

Requires voice:write

Body parameters

voicestringrequired

Voice id or clone id. Clone ids are scoped to the workspace that owns the key.

textstringrequired

The text to speak. Hard limit 5,000 characters per request; split longer copy at sentence boundaries and keep your own ordering.

formatenumdefault mp3

Container for the returned audio. Use pcm16 when you intend to play frames as they arrive.

mp3wavpcm16opus
speednumberdefault 1.0

Playback rate between 0.5 and 2.0. Values outside the range are rejected rather than clamped.

languagestringdefault auto

BCP-47 tag such as en-US or pt-BR. Left on auto, the model infers it from the text.

streambooleandefault false

Return a chunked response that begins before synthesis finishes. First byte is typically ~180ms.

Returns

A generation object carrying the audio url, its duration, and the character count that was billed.

Errors

404voice_not_found

The voice id does not exist, or the clone belongs to another workspace.

422text_too_long

text exceeded 5,000 characters.

curl https://api.sunesis.ai/v1/voice/generate \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice": "aria",
    "text": "Your order is on its way.",
    "format": "mp3",
    "speed": 1.0
  }'
200 OK
{
  "id": "gen_9f2c41ab",
  "object": "voice.generation",
  "created_at": "2026-09-14T10:22:03Z",
  "voice": "aria",
  "audio": {
    "url": "https://cdn.sunesis.ai/gen_9f2c41ab.mp3",
    "format": "mp3",
    "duration_ms": 1840,
    "expires_at": "2026-09-21T10:22:03Z"
  },
  "billed": { "characters": 25 }
}
POST/v1/voice/transcribe

Transcribe audio

Turn recorded speech into structured text with optional word-level timestamps and speaker turns. Accepts a hosted url or a direct multipart upload.

Requires voice:read

Body parameters

audio_urlstringoptional

Publicly reachable url of the source file. Supply this or a multipart audio file, not both.

languagestringdefault auto

BCP-47 hint. Setting it explicitly measurably improves accuracy on short or noisy clips.

diarizebooleandefault false

Split the transcript into speaker turns. Adds roughly 15% to processing time.

timestampsenumdefault segment

Granularity of the returned timing data. Word-level noticeably increases response size.

nonesegmentword
vocabularystring[]optional

Domain terms, product names, or proper nouns to bias recognition toward. Up to 200 entries.

Returns

A transcript object with the full text, per-segment timings, and speaker labels when diarization was requested.

Errors

422unreadable_audio

The file could not be decoded, or the url returned a non-audio content type.

curl https://api.sunesis.ai/v1/voice/transcribe \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://example.com/call.wav",
    "diarize": true,
    "timestamps": "segment"
  }'
200 OK
{
  "id": "txn_4b81de02",
  "object": "voice.transcript",
  "language": "en-US",
  "duration_ms": 12400,
  "text": "Hi, I'm calling about my order. Sure, what's the order number?",
  "segments": [
    { "speaker": "S1", "start_ms": 0,    "end_ms": 2600,  "text": "Hi, I'm calling about my order." },
    { "speaker": "S2", "start_ms": 2900, "end_ms": 5200,  "text": "Sure, what's the order number?" }
  ],
  "billed": { "seconds": 13 }
}
POST/v1/voice/clones

Create a voice clone

Register a reusable voice identity from a consented recording. Consent is a required field, not a checkbox in a dashboard — the API refuses the call without it.

Requires voice:write

Consent is required, not advisory

This endpoint refuses any request without a complete consent object. Capture permission in your own product flow before you reach this call — retrofitting it as a later review step means storing a voice you were never cleared to use.

Body parameters

namestringrequired

Human-readable label shown in Studio and returned on every generation made with this voice.

samplesstring[]required

One to five urls of clean recordings. Thirty seconds of clear speech outperforms five minutes of noisy audio.

consentobjectrequired

Must carry `holder` (who the voice belongs to) and `granted_at` (ISO 8601). Stored with the clone and returned on every read.

descriptionstringoptional

Free text describing the intended use. Surfaces in workspace audit exports.

Returns

A voice object in state `training`. Poll it, or subscribe to the `voice.clone.ready` webhook.

Errors

422consent_missing

The consent object was absent or incomplete. This call never succeeds without it.

409name_in_use

A clone with that name already exists in the workspace.

curl https://api.sunesis.ai/v1/voice/clones \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Northbridge brand voice",
    "samples": ["https://example.com/vo-take-1.wav"],
    "consent": {
      "holder": "Northbridge Media Ltd",
      "granted_at": "2026-09-01T09:00:00Z"
    }
  }'
200 OK
{
  "id": "vc_2d90f7c1",
  "object": "voice.clone",
  "name": "Northbridge brand voice",
  "state": "training",
  "ready_estimate_s": 90,
  "consent": {
    "holder": "Northbridge Media Ltd",
    "granted_at": "2026-09-01T09:00:00Z"
  }
}
GET/v1/voices

List voices

Every stock voice plus the clones your workspace owns. Cursor paginated.

Requires voice:read

Query parameters

typeenumdefault all

Narrow the result to one kind of voice.

allstockclone
limitintegerdefault 20

Page size, 1 to 100.

cursorstringoptional

The `next_cursor` from a previous page. Omit for the first page.

Returns

A paginated list object. See Pagination for how to walk it.

curl "https://api.sunesis.ai/v1/voices?type=clone&limit=20" \
  -H "Authorization: Bearer $SUNESIS_KEY"
200 OK
{
  "object": "list",
  "data": [
    { "id": "vc_2d90f7c1", "name": "Northbridge brand voice", "type": "clone", "state": "ready" },
    { "id": "aria",        "name": "Aria",                    "type": "stock", "state": "ready" }
  ],
  "has_more": true,
  "next_cursor": "eyJvIjoyMH0"
}

Video

POST/v1/video/generate

Generate talking video

Render an avatar speaking your script. This is an asynchronous job: the call returns immediately with a job you poll or subscribe to.

Requires video:write

Body parameters

avatarstringrequired

Avatar id, stock or custom-trained.

textstringoptional

Script to speak. Supply this or `audio_url`, not both.

audio_urlstringoptional

Pre-rendered audio to lip-sync against, when you already generated the voice track.

voicestringoptional

Voice used when `text` is supplied. Ignored if you passed `audio_url`.

resolutionenumdefault 1080p

Output resolution. 4k is available on Scale and Enterprise plans.

720p1080p4k
backgroundstringdefault transparent

Hex colour, image url, or `transparent` for an alpha channel you can composite.

Returns

A job object in state `queued`. Terminal states are `succeeded` and `failed`.

Errors

422missing_script

Neither text nor audio_url was supplied.

402insufficient_credits

The render would exceed the workspace balance.

curl https://api.sunesis.ai/v1/video/generate \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "av_lumen",
    "text": "Here is what changed this week.",
    "voice": "aria",
    "resolution": "1080p"
  }'
200 OK
{
  "id": "job_7ac3f01b",
  "object": "video.job",
  "state": "queued",
  "progress": 0,
  "eta_s": 42,
  "output": null
}

Agents

POST/v1/agents

Create an agent

Define a reusable agent: its persona, the tools it may call, and the knowledge it is allowed to ground answers in.

Requires agents:write

Body parameters

namestringrequired

Identifier shown in transcripts and handoff summaries.

instructionsstringrequired

System prompt establishing the agent's role, tone, and limits.

voicestringoptional

Voice used for spoken sessions. Text-only agents can omit it.

toolsobject[]optional

Function schemas the agent may call. Each needs `name`, `description`, and a JSON Schema `parameters`.

knowledgestring[]optional

Collection ids the agent may ground answers in. Anything outside them is out of scope by construction.

memoryenumdefault session

`session` forgets at hangup; `persistent` carries context across conversations with the same end user.

nonesessionpersistent

Returns

An agent object you can open sessions against.

curl https://api.sunesis.ai/v1/agents \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Lumen",
    "instructions": "You are a calm customer care guide. Offer a next step, never a ticket number.",
    "voice": "aria",
    "memory": "persistent"
  }'
200 OK
{
  "id": "ag_51c7b3de",
  "object": "agent",
  "name": "Lumen",
  "voice": "aria",
  "memory": "persistent",
  "tools": [],
  "created_at": "2026-09-14T10:31:07Z"
}
POST/v1/agents/{agent_id}/sessions

Open a session

Start a conversation. Returns a short-lived token your browser or device exchanges for a realtime connection — mint it server-side and never ship your API key to a client.

Requires agents:write

Mint this server-side

Your API key must never reach a browser or a mobile binary. Call this from your own backend and hand the short-lived client_token to the device — that token is scoped to one session and expires in seconds, so a leak costs you one conversation rather than your whole workspace.

Path parameters

agent_idstringrequired

Path parameter. The agent to converse with.

Body parameters

end_user_idstringoptional

Your stable identifier for the person. Required for `persistent` memory to bind to the right history.

modalityenumdefault voice

How the session is conducted.

voicetextvoice+video
ttl_sintegerdefault 60

Lifetime of the returned client token, 30 to 600 seconds. Keep it short; it is a bearer credential.

Returns

A session object with a `client_token` and the realtime url to connect to.

Errors

404agent_not_found

No agent with that id in this workspace.

curl https://api.sunesis.ai/v1/agents/ag_51c7b3de/sessions \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "end_user_id": "user_8821", "modality": "voice" }'
200 OK
{
  "id": "sess_0be49a17",
  "object": "agent.session",
  "agent_id": "ag_51c7b3de",
  "client_token": "cst_live_9c81…",
  "realtime_url": "wss://rt.sunesis.ai/v1/realtime?session=sess_0be49a17",
  "expires_at": "2026-09-14T10:33:07Z"
}
WSS/v1/realtime

Realtime connection

The bidirectional channel behind live voice and video. The client connects with the session token, streams microphone frames up, and receives audio, transcript, and tool events back as they happen.

Requires client token

Handle barge-in from the start

Send response.cancel the moment the user speaks over the agent. Designing interruption in later is far harder than building it in now, and an agent that talks through its user reads as broken however good the voice is.

Events you send

input.audiobinaryoptional

PCM16 mono frames at 24kHz. Send continuously; the server handles turn detection.

input.texteventoptional

Inject a typed message into a voice session, for a chat box alongside the call.

response.canceleventoptional

Barge-in. Stops the current spoken reply immediately so the user can interrupt.

tool.resulteventoptional

Return the output of a tool the agent called. The turn stays open until you do.

Returns

A stream of server events: `transcript.delta`, `audio.delta`, `tool.call`, `turn.done`, `error`.

# Realtime is a WebSocket, not a REST call. Inspect it with wscat:
wscat -c "wss://rt.sunesis.ai/v1/realtime?session=sess_0be49a17" \
  -H "Authorization: Bearer $CLIENT_TOKEN"
Server events
// Server → client, one JSON frame per event
{ "type": "transcript.delta", "role": "user",  "text": "where is my order" }
{ "type": "tool.call", "id": "tc_1", "name": "lookup_order",
  "arguments": { "order_id": "8821" } }
{ "type": "transcript.delta", "role": "agent", "text": "It's out for delivery." }
{ "type": "turn.done", "latency_ms": 184 }

Platform

Rules that apply everywhere

Errors, limits, retries, and delivery behave identically across every endpoint above. Build these once and every future capability inherits them.

Errors

Every failure returns the same envelope with a machine-readable code, the offending field where one applies, and a request id worth logging.

Error envelope
{
  "error": {
    "type": "validation_failed",
    "code": "text_too_long",
    "message": "text must be 5000 characters or fewer (received 6431).",
    "field": "text",
    "request_id": "req_1f8ac902"
  }
}
StatusCodeMeaningWhat to do
400malformed_requestThe body was not valid JSON, or a field had the wrong type.Fix the payload. Retrying an identical request will fail identically.
401invalid_keyThe key is missing, revoked, or not a bearer token.Check the Authorization header reads `Bearer sk_live_…`. Rotate if the key leaked.
403insufficient_scopeThe key is valid but lacks the scope this route requires.Issue a key carrying the scope listed on the endpoint.
404not_foundNo such resource, or it belongs to another workspace.Resource ids are workspace-scoped. Confirm the key and the id come from the same workspace.
402insufficient_creditsThe request would exceed the workspace balance.Top up, or catch this and degrade gracefully rather than retrying.
409conflictThe resource already exists, or is in a state that forbids the change.Read the current resource before retrying.
422validation_failedThe shape was right but a value was not accepted.Read `error.field` — it names the offending parameter. Not retryable unchanged.
429rate_limitedToo many requests, or too many concurrent jobs.Honour `Retry-After`. Back off exponentially with jitter; never retry in a tight loop.
500internal_errorSomething broke on our side.Safe to retry with backoff. Include `x-request-id` if you open a support ticket.
503capacityA model is briefly saturated.Retry with backoff. Sustained 503s are reported on the status page.

Rate limits

Limits are per workspace, not per key, and are reported on every response so you can back off before you are told to.

PlanReq/minConcurrentBurst
Free602 jobs10
Build60010 jobs60
Scale3,00050 jobs300
EnterpriseNegotiatedNegotiatedNegotiated
Response headers
x-ratelimit-limit: 600
x-ratelimit-remaining: 574
x-ratelimit-reset: 41        # seconds until the window rolls
retry-after: 12              # present only on a 429

Pagination

List endpoints are cursor paginated, never offset paginated. Read `next_cursor` from each page and pass it back as `cursor`; a null cursor means you reached the end. Cursors stay stable while new records are inserted, so you cannot skip or double-read a row mid-walk.

Walking every page
let cursor: string | undefined;

do {
  const page = await sunesis.voices.list({ limit: 100, cursor });
  for (const voice of page.data) process(voice);
  cursor = page.next_cursor;   // null on the final page
} while (cursor);

Idempotency

Any POST that costs credits accepts an Idempotency-Key. Send one and a retried request returns the original result instead of doing the work twice.

Safe retries
curl https://api.sunesis.ai/v1/video/generate \
  -H "Authorization: Bearer $SUNESIS_KEY" \
  -H "Idempotency-Key: 9f2c-41ab-order-8821" \
  -H "Content-Type: application/json" \
  -d '{ "avatar": "av_lumen", "text": "Here is what changed." }'

# Replaying the same key within 24h returns the ORIGINAL job
# instead of queueing a second render.

Webhooks

Long-running work reports completion by webhook rather than asking you to poll. Every delivery is signed; verify it before you trust it.

Events

  • voice.clone.ready

    A clone finished training and can be used for generation.

  • video.job.succeeded

    A render finished. The payload carries the output url.

  • video.job.failed

    A render failed permanently. The payload carries the error object.

  • agent.session.ended

    A conversation closed, with duration and a transcript url.

  • agent.handoff.requested

    An agent decided a person should take over.

Verifying a delivery
import crypto from "node:crypto";

// Signature header: t=<unix>,v1=<hex>. Sign the raw body, never the parsed
// object — re-serialising JSON changes the bytes and breaks the comparison.
export function verify(rawBody: string, header: string, secret: string) {
  const parts = Object.fromEntries(
    header.split(",").map((kv) => kv.split("=") as [string, string]),
  );

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");

  // Reject replays older than five minutes.
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;

  return crypto.timingSafeEqual(
    Buffer.from(expected),
    Buffer.from(parts.v1),
  );
}

Key scopes

Keys carry explicit scopes. Issue the narrowest set a service needs, so a leaked key from one surface cannot reach another.

voice:readList voices, read clones, read transcripts.
voice:writeGenerate speech, transcribe audio, create and delete clones.
video:writeTrain avatars and submit render jobs.
agents:readRead agents, sessions, and transcripts.
agents:writeCreate agents and mint session tokens.

Operations

Run Sunesis with confidence

Controls for the team that owns the integration: keys, usage visibility, and enterprise safeguards.

Usage & credits

Keep generation spend visible

See workspace credits, compare production needs, and choose the plan that matches your character, voice, and agent volume.

View pricing
Security & enterprise

Scale with clear controls

Give teams the access and operational support they need when real-time AI becomes part of a customer-facing workflow.

Explore enterprise

Next steps

Continue building

Was this guide helpful?

Your feedback helps us improve the docs.

Sunesis Labs | AI Voice, Character & Conversation Agents