Skip to content

Latest commit

Β 

History

History
6536 lines (4501 loc) Β· 71.5 KB

File metadata and controls

6536 lines (4501 loc) Β· 71.5 KB

Reference

Tts Audio

client.tts.audio.speech({ ...params }) -> Speechify.GetSpeechResponse

πŸ“ Description

Gets the speech data for the given input

πŸ”Œ Usage

await client.tts.audio.speech({
    input: "input",
    voiceId: "voice_id",
});

βš™οΈ Parameters

request: Speechify.tts.GetSpeechRequest

requestOptions: Audio.RequestOptions

client.tts.audio.stream({ ...params }) -> stream.Readable

πŸ“ Description

Gets the stream speech for the given input

πŸ”Œ Usage

await client.tts.audio.stream({
    accept: "audio/mpeg",
    input: "input",
    language: undefined,
    model: undefined,
    options: undefined,
    voiceId: "voice_id",
});

βš™οΈ Parameters

request: Speechify.tts.GetStreamRequest

requestOptions: Audio.RequestOptions

Tts Auth

client.tts.auth.createAccessToken({ ...params }) -> Speechify.AccessToken

πŸ“ Description

WARNING: This endpoint is deprecated. Create a new API token for the logged in user.

πŸ”Œ Usage

await client.tts.auth.createAccessToken({
    grantType: "client_credentials",
});

βš™οΈ Parameters

request: Speechify.tts.CreateAccessTokenRequest

requestOptions: Auth.RequestOptions

Tts Voices

client.tts.voices.list() -> Speechify.GetVoice[]

πŸ“ Description

Gets the list of voices available for the user

πŸ”Œ Usage

await client.tts.voices.list();

βš™οΈ Parameters

requestOptions: Voices.RequestOptions

client.tts.voices.create({ ...params }) -> Speechify.CreatedVoice

πŸ“ Description

Create a personal (cloned) voice for the user

πŸ”Œ Usage

await client.tts.voices.create({
    sample: fs.createReadStream("/path/to/your/file"),
    name: "name",
    gender: "male",
    consent: "consent",
});

βš™οΈ Parameters

request: Speechify.tts.CreateVoicesRequest

requestOptions: Voices.RequestOptions

client.tts.voices.delete(id, { ...params }) -> void

πŸ“ Description

Delete a personal (cloned) voice

πŸ”Œ Usage

await client.tts.voices.delete("id");

βš™οΈ Parameters

id: string β€” The ID of the voice to delete

request: Speechify.tts.DeleteVoicesRequest

requestOptions: Voices.RequestOptions

client.tts.voices.downloadSample(id, { ...params }) -> stream.Readable

πŸ“ Description

Download a personal (cloned) voice sample

πŸ”Œ Usage

await client.tts.voices.downloadSample("id");

βš™οΈ Parameters

id: string β€” The ID of the voice to download sample for

request: Speechify.tts.DownloadSampleVoicesRequest

requestOptions: Voices.RequestOptions

Tts Agents

client.tts.agents.list() -> Speechify.ListAgentsResponse

πŸ“ Description

List voice agents owned by the caller.

πŸ”Œ Usage

await client.tts.agents.list();

βš™οΈ Parameters

requestOptions: Agents.RequestOptions

client.tts.agents.create({ ...params }) -> Speechify.Agent

πŸ“ Description

Create a voice agent.

πŸ”Œ Usage

await client.tts.agents.create({
    name: "name",
    voiceId: "voice_id",
});

βš™οΈ Parameters

request: Speechify.tts.CreateAgentRequest

requestOptions: Agents.RequestOptions

client.tts.agents.get(id, { ...params }) -> Speechify.Agent

πŸ“ Description

Retrieve a voice agent by ID.

πŸ”Œ Usage

await client.tts.agents.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.delete(id, { ...params }) -> void

πŸ“ Description

Delete a voice agent. Conversations and attached tools remain.

πŸ”Œ Usage

await client.tts.agents.delete("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.update(id, { ...params }) -> Speechify.Agent

πŸ“ Description

Update a voice agent. Only fields present on the request body are changed.

πŸ”Œ Usage

await client.tts.agents.update("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateAgentRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listTools(id, { ...params }) -> Speechify.ListToolsResponse

πŸ“ Description

List tools currently attached to the agent.

πŸ”Œ Usage

await client.tts.agents.listTools("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListToolsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.attachTool(id, toolId, { ...params }) -> void

πŸ“ Description

Attach an existing tool to the agent so the LLM can call it.

πŸ”Œ Usage

await client.tts.agents.attachTool("id", "toolId");

βš™οΈ Parameters

id: string

toolId: string

request: Speechify.tts.AttachToolAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.detachTool(id, toolId, { ...params }) -> void

πŸ“ Description

Detach a tool from the agent.

πŸ”Œ Usage

await client.tts.agents.detachTool("id", "toolId");

βš™οΈ Parameters

id: string

toolId: string

request: Speechify.tts.DetachToolAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.getEvaluationConfig(id, { ...params }) -> Speechify.EvaluationConfig

πŸ“ Description

Retrieve the agent's post-call evaluation criteria + data-collection config.

πŸ”Œ Usage

await client.tts.agents.getEvaluationConfig("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetEvaluationConfigAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.updateEvaluationConfig(id, { ...params }) -> Speechify.EvaluationConfig

πŸ“ Description

Replace the agent's evaluation criteria + data-collection fields.

πŸ”Œ Usage

await client.tts.agents.updateEvaluationConfig("id", {
    criteria: [
        {
            id: "id",
            name: "name",
            description: "description",
        },
    ],
    dataCollection: [
        {
            key: "key",
            description: "description",
            type: "string",
        },
    ],
});

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateEvaluationConfigRequest

requestOptions: Agents.RequestOptions

client.tts.agents.getDynamicVariables(id, { ...params }) -> Speechify.ListDynamicVariablesResponse

πŸ“ Description

Retrieve the agent's customer-scope dynamic variables and the read-only catalogue of reserved system__* keys. The system variables list is provided so editor UIs can render the reference list without maintaining a client-side copy of the catalogue.

πŸ”Œ Usage

await client.tts.agents.getDynamicVariables("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetDynamicVariablesAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.updateDynamicVariables(id, { ...params }) -> Speechify.ListDynamicVariablesResponse

πŸ“ Description

Replace the agent's customer-scope dynamic variable definitions. The supplied list overwrites the stored list wholesale (same semantics as updateEvaluationConfig). Pass an empty array to clear all variables. Up to 20 variables per agent. Keys must match [a-zA-Z0-9_]+ and must not start with the reserved system__ prefix.

πŸ”Œ Usage

await client.tts.agents.updateDynamicVariables("id", {
    variables: [
        {
            key: "product_name",
            type: "string",
            default: "Speechify",
            description: "Product the agent is supporting.",
        },
        {
            key: "support_tier",
            type: "number",
            default: 1,
        },
        {
            key: "account_metadata",
            type: "json",
            description: "Arbitrary account context injected into tool bodies.",
        },
    ],
});

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateDynamicVariablesRequest

requestOptions: Agents.RequestOptions

client.tts.agents.createConversation(id, { ...params }) -> Speechify.CreateConversationResponse

πŸ“ Description

Start a new voice conversation with the agent. Returns a realtime voice session + short-lived client token so the caller can connect the audio pipeline directly. The agent is dispatched server-side; no additional client action required.

Pass dynamic_variables to supply per-session values that override the agent's stored variable defaults for this one conversation. Keys in the system__ namespace are rejected at this boundary.

πŸ”Œ Usage

await client.tts.agents.createConversation("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.CreateConversationRequest

requestOptions: Agents.RequestOptions

client.tts.agents.createSession(id, { ...params }) -> Speechify.CreateConversationResponse

πŸ“ Description

Mint a realtime voice session for the given agent. Widget-friendly counterpart to createConversation β€” same response shape, dual authentication:

  • Authenticated (Bearer): works for any agent the caller owns. Typical server-to-server flow where the embedding site's backend mints a token and hands it to the browser so the API key never reaches the client.
  • Unauthenticated: works only when agent.is_public = true AND the request's Origin header matches agent.allowed_origins (or that list is empty). When agent.hostname_allowlist is non-empty, the Origin hostname must additionally be a member of that list. Used directly by the <speechify-agent> web component.

Responds with the same CreateConversationResponse as createConversation.

πŸ”Œ Usage

await client.tts.agents.createSession("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.CreateSessionRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listAgentKnowledgeBases(id, { ...params }) -> Speechify.ListKnowledgeBasesResponse

πŸ“ Description

List knowledge bases attached to an agent.

πŸ”Œ Usage

await client.tts.agents.listAgentKnowledgeBases("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListAgentKnowledgeBasesAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.attachKnowledgeBase(id, kbId, { ...params }) -> void

πŸ“ Description

Attach a knowledge base to an agent. The search_knowledge tool is auto-registered on the next conversation and can only query the attached knowledge bases.

πŸ”Œ Usage

await client.tts.agents.attachKnowledgeBase("id", "kbId");

βš™οΈ Parameters

id: string

kbId: string

request: Speechify.tts.AttachKnowledgeBaseAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.detachKnowledgeBase(id, kbId, { ...params }) -> void

πŸ“ Description

Detach a knowledge base from an agent.

πŸ”Œ Usage

await client.tts.agents.detachKnowledgeBase("id", "kbId");

βš™οΈ Parameters

id: string

kbId: string

request: Speechify.tts.DetachKnowledgeBaseAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listMemories(id, { ...params }) -> Speechify.ListMemoriesResponse

πŸ“ Description

List per-caller memories extracted for an agent. Memories are written post-call by the built-in extractor when memory_enabled is true on the agent; the list is sorted newest-first.

πŸ”Œ Usage

await client.tts.agents.listMemories("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListMemoriesAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.deleteMemoriesByCaller(id, { ...params }) -> Speechify.DeleteMemoriesByCallerResponse

πŸ“ Description

Delete every memory ever extracted for a specific caller on this agent. Privacy / GDPR surface. Returns the count of rows soft-deleted; rows become permanently unreachable immediately and are hard-deleted by the retention job after the tenant's configured retention window.

πŸ”Œ Usage

await client.tts.agents.deleteMemoriesByCaller("id", {
    agentId: "agent_id",
    callerIdentity: "caller_identity",
});

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteMemoriesByCallerRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listTests(id, { ...params }) -> Speechify.ListAgentTestsResponse

πŸ“ Description

List all tests configured for the agent. Each entry includes the most recent run so the console can render pass/fail badges without an extra round-trip.

πŸ”Œ Usage

await client.tts.agents.listTests("id");

βš™οΈ Parameters

id: string β€” Agent ID.

request: Speechify.tts.ListTestsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.createTest(id, { ...params }) -> Speechify.AgentTest

πŸ“ Description

Create a new test for the agent.

πŸ”Œ Usage

await client.tts.agents.createTest("id", {
    name: "Greet the caller by name",
    description: "Agent should greet the caller using their name when provided.",
    type: "scenario",
    config: {
        context: "The caller says: Hi, I'm Alice.",
        successCriteria: "The agent greets Alice by name.",
        successExamples: ["Hi Alice! How can I help you today?"],
        failureExamples: ["Hello! How can I help you?"],
    },
});

βš™οΈ Parameters

id: string β€” Agent ID.

request: Speechify.tts.CreateAgentTestRequest

requestOptions: Agents.RequestOptions

client.tts.agents.runAllTests(id, { ...params }) -> Speechify.RunAgentTestsResponse

πŸ“ Description

Enqueue runs for every test on the agent concurrently. Up to 50 tests are dispatched in one call. Each returned run starts in queued status; poll GET /v1/test-runs/{id} for the terminal result.

πŸ”Œ Usage

await client.tts.agents.runAllTests("id");

βš™οΈ Parameters

id: string β€” Agent ID.

request: Speechify.tts.RunAllTestsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.getTest(id, { ...params }) -> Speechify.AgentTest

πŸ“ Description

Retrieve a test by ID.

πŸ”Œ Usage

await client.tts.agents.getTest("id");

βš™οΈ Parameters

id: string β€” Test ID.

request: Speechify.tts.GetTestAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.deleteTest(id, { ...params }) -> void

πŸ“ Description

Delete a test and all its run history.

πŸ”Œ Usage

await client.tts.agents.deleteTest("id");

βš™οΈ Parameters

id: string β€” Test ID.

request: Speechify.tts.DeleteTestAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.updateTest(id, { ...params }) -> Speechify.AgentTest

πŸ“ Description

Update a test. Only fields present on the request body are changed.

πŸ”Œ Usage

await client.tts.agents.updateTest("id");

βš™οΈ Parameters

id: string β€” Test ID.

request: Speechify.tts.UpdateAgentTestRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listTestRuns(id, { ...params }) -> Speechify.ListAgentTestRunsResponse

πŸ“ Description

List the run history for a test, newest first.

πŸ”Œ Usage

await client.tts.agents.listTestRuns("id");

βš™οΈ Parameters

id: string β€” Test ID.

request: Speechify.tts.ListTestRunsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.runTest(id, { ...params }) -> Speechify.AgentTestRun

πŸ“ Description

Enqueue a single run of the test. The returned run starts in queued status. Poll GET /v1/test-runs/{id} until the status reaches a terminal state (passed, failed, or error).

πŸ”Œ Usage

await client.tts.agents.runTest("id");

βš™οΈ Parameters

id: string β€” Test ID.

request: Speechify.tts.RunTestAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.getTestRun(id, { ...params }) -> Speechify.AgentTestRun

πŸ“ Description

Retrieve a single test run by ID. Poll this endpoint until status reaches a terminal state (passed, failed, or error). The result field is populated on terminal states.

πŸ”Œ Usage

await client.tts.agents.getTestRun("id");

βš™οΈ Parameters

id: string β€” Test run ID.

request: Speechify.tts.GetTestRunAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listAllTests({ ...params }) -> Speechify.ListTestsResponse

πŸ“ Description

Workspace-wide list of tests across every agent the caller owns. Supports filters (agent, type, last-run status, folder), full-text search on name/description, and cursor pagination. Each row carries its newest run and attached agent IDs so the list renders without N+1 round-trips.

πŸ”Œ Usage

await client.tts.agents.listAllTests();

βš™οΈ Parameters

request: Speechify.tts.ListAllTestsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.getTestStats({ ...params }) -> Speechify.TestStats

πŸ“ Description

Aggregate pass-rate metrics over the last N days. Returns dense daily buckets (one entry per day, zero-filled) plus totals and a per-type breakdown. Powers the header chart on the global tests page. Default window is 30 days, max 90.

πŸ”Œ Usage

await client.tts.agents.getTestStats();

βš™οΈ Parameters

request: Speechify.tts.GetTestStatsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.runTestsBatch({ ...params }) -> Speechify.RunBatchResponse

πŸ“ Description

Queue runs for every (test, agent) pair in the body. Entries without an agent_id fan out to every agent the test is attached to. Total expanded runs are capped at 100 per call. Each entry in the response is a queued run; poll GET /v1/test-runs/{id} for each.

πŸ”Œ Usage

await client.tts.agents.runTestsBatch({
    entries: [
        {
            testId: "test_id",
        },
    ],
});

βš™οΈ Parameters

request: Speechify.tts.RunBatchRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listTestAttachments(id, { ...params }) -> Speechify.ListAgentTestAttachmentsResponse

πŸ“ Description

List every agent a test is attached to.

πŸ”Œ Usage

await client.tts.agents.listTestAttachments("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListTestAttachmentsAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.attachTest(id, agentId, { ...params }) -> void

πŸ“ Description

Attach a test to an additional agent. After this call, the test will also run as part of that agent's regression suite (and against its prompt + tool config when invoked with agent_id = {agentId}). Idempotent.

πŸ”Œ Usage

await client.tts.agents.attachTest("id", "agentId");

βš™οΈ Parameters

id: string

agentId: string

request: Speechify.tts.AttachTestAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.detachTest(id, agentId, { ...params }) -> void

πŸ“ Description

Detach a test from an agent. The owner agent (the agent the test was authored against) cannot be detached; delete the test instead.

πŸ”Œ Usage

await client.tts.agents.detachTest("id", "agentId");

βš™οΈ Parameters

id: string

agentId: string

request: Speechify.tts.DetachTestAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.moveTest(id, { ...params }) -> void

πŸ“ Description

Move a test into a folder. Pass folder_id: null for root.

πŸ”Œ Usage

await client.tts.agents.moveTest("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.MoveAgentTestRequest

requestOptions: Agents.RequestOptions

client.tts.agents.listTestFolders() -> Speechify.ListAgentTestFoldersResponse

πŸ“ Description

List every test folder the caller owns. Flat list; build the tree client-side.

πŸ”Œ Usage

await client.tts.agents.listTestFolders();

βš™οΈ Parameters

requestOptions: Agents.RequestOptions

client.tts.agents.createTestFolder({ ...params }) -> Speechify.AgentTestFolder

πŸ“ Description

Create a test folder. Max depth is 3.

πŸ”Œ Usage

await client.tts.agents.createTestFolder({
    name: "name",
});

βš™οΈ Parameters

request: Speechify.tts.CreateAgentTestFolderRequest

requestOptions: Agents.RequestOptions

client.tts.agents.deleteTestFolder(id, { ...params }) -> void

πŸ“ Description

Soft-delete a folder. Child tests drop back to root.

πŸ”Œ Usage

await client.tts.agents.deleteTestFolder("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteTestFolderAgentsRequest

requestOptions: Agents.RequestOptions

client.tts.agents.updateTestFolder(id, { ...params }) -> Speechify.AgentTestFolder

πŸ“ Description

Rename or reparent a test folder. Cycles are rejected.

πŸ”Œ Usage

await client.tts.agents.updateTestFolder("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateAgentTestFolderRequest

requestOptions: Agents.RequestOptions

Tts Tools

client.tts.tools.list() -> Speechify.ListToolsResponse

πŸ“ Description

List tools owned by the caller.

πŸ”Œ Usage

await client.tts.tools.list();

βš™οΈ Parameters

requestOptions: Tools.RequestOptions

client.tts.tools.create({ ...params }) -> Speechify.Tool

πŸ“ Description

Create a tool. For webhook tools, the response includes the HMAC webhook_secret exactly once β€” store it immediately; subsequent reads return a masked placeholder.

πŸ”Œ Usage

await client.tts.tools.create({
    name: "name",
    description: "description",
    kind: "system",
    config: {
        builtin: "end_call",
    },
});

βš™οΈ Parameters

request: Speechify.tts.CreateToolRequest

requestOptions: Tools.RequestOptions

client.tts.tools.get(id, { ...params }) -> Speechify.Tool

πŸ“ Description

Retrieve a tool by ID. Webhook secrets are always masked here.

πŸ”Œ Usage

await client.tts.tools.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetToolsRequest

requestOptions: Tools.RequestOptions

client.tts.tools.delete(id, { ...params }) -> void

πŸ“ Description

Delete a tool. Agents that had it attached get a soft-detach.

πŸ”Œ Usage

await client.tts.tools.delete("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteToolsRequest

requestOptions: Tools.RequestOptions

client.tts.tools.update(id, { ...params }) -> Speechify.Tool

πŸ“ Description

Update a tool. Tool kind is immutable β€” create a new tool to change it.

πŸ”Œ Usage

await client.tts.tools.update("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateToolRequest

requestOptions: Tools.RequestOptions

Tts Conversations

client.tts.conversations.list() -> Speechify.ListConversationsResponse

πŸ“ Description

List conversations owned by the caller, ordered by most recent.

πŸ”Œ Usage

await client.tts.conversations.list();

βš™οΈ Parameters

requestOptions: Conversations.RequestOptions

client.tts.conversations.stats() -> Speechify.ConversationStats

πŸ“ Description

Aggregated counts and averages over the caller's conversations, scoped by the same filters as the list endpoint.

πŸ”Œ Usage

await client.tts.conversations.stats();

βš™οΈ Parameters

requestOptions: Conversations.RequestOptions

client.tts.conversations.get(id, { ...params }) -> Speechify.Conversation

πŸ“ Description

Retrieve a conversation by ID.

πŸ”Œ Usage

await client.tts.conversations.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetConversationsRequest

requestOptions: Conversations.RequestOptions

client.tts.conversations.listMessages(id, { ...params }) -> Speechify.ListMessagesResponse

πŸ“ Description

Retrieve the full transcript for a conversation, in order.

πŸ”Œ Usage

await client.tts.conversations.listMessages("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListMessagesConversationsRequest

requestOptions: Conversations.RequestOptions

client.tts.conversations.listEvaluations(id, { ...params }) -> Speechify.ListEvaluationsResponse

πŸ“ Description

Retrieve post-call evaluation results for a conversation.

πŸ”Œ Usage

await client.tts.conversations.listEvaluations("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListEvaluationsConversationsRequest

requestOptions: Conversations.RequestOptions

client.tts.conversations.listMemories(id, { ...params }) -> Speechify.ListMemoriesResponse

πŸ“ Description

List memories extracted from a specific conversation.

πŸ”Œ Usage

await client.tts.conversations.listMemories("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListMemoriesConversationsRequest

requestOptions: Conversations.RequestOptions

Tts KnowledgeBases

client.tts.knowledgeBases.list() -> Speechify.ListKnowledgeBasesResponse

πŸ“ Description

List knowledge bases owned by the caller.

πŸ”Œ Usage

await client.tts.knowledgeBases.list();

βš™οΈ Parameters

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.create({ ...params }) -> Speechify.KnowledgeBase

πŸ“ Description

Create a new knowledge base.

πŸ”Œ Usage

await client.tts.knowledgeBases.create({
    name: "name",
});

βš™οΈ Parameters

request: Speechify.tts.CreateKnowledgeBaseRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.get(id, { ...params }) -> Speechify.KnowledgeBase

πŸ“ Description

Retrieve a knowledge base by ID.

πŸ”Œ Usage

await client.tts.knowledgeBases.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.delete(id, { ...params }) -> void

πŸ“ Description

Soft-delete a knowledge base. Documents and chunks are cascaded.

πŸ”Œ Usage

await client.tts.knowledgeBases.delete("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.update(id, { ...params }) -> Speechify.KnowledgeBase

πŸ“ Description

Update a knowledge base.

πŸ”Œ Usage

await client.tts.knowledgeBases.update("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdateKnowledgeBaseRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.listDocuments(id, { ...params }) -> Speechify.ListKnowledgeBaseDocumentsResponse

πŸ“ Description

List documents ingested into a knowledge base.

πŸ”Œ Usage

await client.tts.knowledgeBases.listDocuments("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.ListDocumentsKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.uploadDocument(id, { ...params }) -> Speechify.KnowledgeBaseDocument

πŸ“ Description

Upload a document (PDF, plain text, markdown, or HTML) to a knowledge base. The document is extracted, chunked, embedded, and indexed synchronously; expect a few seconds per MB of input. Maximum 10 MB per upload.

πŸ”Œ Usage

await client.tts.knowledgeBases.uploadDocument("id", {
    file: fs.createReadStream("/path/to/your/file"),
});

βš™οΈ Parameters

id: string

request: Speechify.tts.UploadDocumentKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.getDocument(docId, { ...params }) -> Speechify.KnowledgeBaseDocument

πŸ“ Description

Retrieve a document by ID.

πŸ”Œ Usage

await client.tts.knowledgeBases.getDocument("docId");

βš™οΈ Parameters

docId: string

request: Speechify.tts.GetDocumentKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.deleteDocument(docId, { ...params }) -> void

πŸ“ Description

Delete a document and all its chunks.

πŸ”Œ Usage

await client.tts.knowledgeBases.deleteDocument("docId");

βš™οΈ Parameters

docId: string

request: Speechify.tts.DeleteDocumentKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.listChunks(docId, { ...params }) -> Speechify.ListKnowledgeBaseChunksResponse

πŸ“ Description

List the chunks for a document.

πŸ”Œ Usage

await client.tts.knowledgeBases.listChunks("docId");

βš™οΈ Parameters

docId: string

request: Speechify.tts.ListChunksKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

client.tts.knowledgeBases.search({ ...params }) -> Speechify.SearchKnowledgeBasesResponse

πŸ“ Description

Semantic search across a caller-owned list of knowledge bases. Returns ranked chunks with source filename and a cosine-similarity score. Limited to 50 results per request.

πŸ”Œ Usage

await client.tts.knowledgeBases.search({
    query: "query",
    kbIds: ["kb_ids"],
});

βš™οΈ Parameters

request: Speechify.tts.SearchKnowledgeBasesRequest

requestOptions: KnowledgeBases.RequestOptions

Tts Memories

client.tts.memories.delete(memoryId, { ...params }) -> void

πŸ“ Description

Soft-delete one memory row.

πŸ”Œ Usage

await client.tts.memories.delete("memoryId");

βš™οΈ Parameters

memoryId: string

request: Speechify.tts.DeleteMemoriesRequest

requestOptions: Memories.RequestOptions

Tts PhoneNumbers

client.tts.phoneNumbers.list() -> unknown

πŸ“ Description

List all phone numbers in the caller's workspace.

πŸ”Œ Usage

await client.tts.phoneNumbers.list();

βš™οΈ Parameters

requestOptions: PhoneNumbers.RequestOptions

client.tts.phoneNumbers.import({ ...params }) -> unknown

πŸ“ Description

Import a phone number into the workspace. The source field determines the provisioning path:

  • livekit - LiveKit purchases the number on your behalf. US inbound only. Quickest path for local testing.
  • twilio - Provide your Twilio Account SID, Auth Token, and the E.164 number you already own. We provision an Elastic SIP Trunk on your Twilio account automatically.
  • byoc - Provide an existing SIP trunk ID. The number is registered against that trunk.

Returns 402 when the workspace has reached the 100-number cap.

πŸ”Œ Usage

await client.tts.phoneNumbers.import({
    key: "value",
});

βš™οΈ Parameters

request: unknown

requestOptions: PhoneNumbers.RequestOptions

client.tts.phoneNumbers.get(id, { ...params }) -> unknown

πŸ“ Description

Retrieve a phone number by ID.

πŸ”Œ Usage

await client.tts.phoneNumbers.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetPhoneNumbersRequest

requestOptions: PhoneNumbers.RequestOptions

client.tts.phoneNumbers.delete(id, { ...params }) -> void

πŸ“ Description

Delete a phone number from the workspace. For Twilio and LiveKit numbers this also deprovisions the backing SIP trunk and dispatch rule on LiveKit Cloud.

πŸ”Œ Usage

await client.tts.phoneNumbers.delete("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeletePhoneNumbersRequest

requestOptions: PhoneNumbers.RequestOptions

client.tts.phoneNumbers.update(id, { ...params }) -> unknown

πŸ“ Description

Update a phone number. Only label and agent_id are mutable; source and e164 are immutable after import. Pass null for agent_id to unbind the number from its current agent.

πŸ”Œ Usage

await client.tts.phoneNumbers.update("id", {
    body: {
        key: "value",
    },
});

βš™οΈ Parameters

id: string

request: Speechify.tts.UpdatePhoneNumbersRequest

requestOptions: PhoneNumbers.RequestOptions

Tts SipTrunks

client.tts.sipTrunks.list() -> unknown

πŸ“ Description

List all SIP trunks in the caller's workspace.

πŸ”Œ Usage

await client.tts.sipTrunks.list();

βš™οΈ Parameters

requestOptions: SipTrunks.RequestOptions

client.tts.sipTrunks.create({ ...params }) -> unknown

πŸ“ Description

Create a SIP trunk. For kind=byoc supply sip_address plus optional digest credentials and IP allowlist. For kind=twilio use ImportPhoneNumber with a twilio spec instead - trunk creation is handled automatically. Returns 402 when the workspace has reached the 20-trunk cap.

πŸ”Œ Usage

await client.tts.sipTrunks.create({
    key: "value",
});

βš™οΈ Parameters

request: unknown

requestOptions: SipTrunks.RequestOptions

client.tts.sipTrunks.get(id, { ...params }) -> unknown

πŸ“ Description

Retrieve a SIP trunk by ID.

πŸ”Œ Usage

await client.tts.sipTrunks.get("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.GetSipTrunksRequest

requestOptions: SipTrunks.RequestOptions

client.tts.sipTrunks.delete(id, { ...params }) -> void

πŸ“ Description

Delete a SIP trunk. This also removes the backing LiveKit inbound trunk, outbound trunk, and dispatch rule if they were provisioned by us. Phone numbers attached to this trunk are left in place but become non-functional until rebound to a new trunk.

πŸ”Œ Usage

await client.tts.sipTrunks.delete("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.DeleteSipTrunksRequest

requestOptions: SipTrunks.RequestOptions

Tts OutboundCalls

client.tts.outboundCalls.create({ ...params }) -> unknown

πŸ“ Description

Place an outbound call from an agent to a phone number. LiveKit originates the SIP INVITE through the outbound trunk bound to the agent's workspace; the agent worker is dispatched into the room automatically.

The response is returned as soon as LiveKit accepts the INVITE. Poll GET /v1/conversations/{conversation_id} for status transitions: pending β†’ active (answered) β†’ completed.

Requires a Twilio or BYOC trunk. LiveKit-native numbers are inbound-only.

πŸ”Œ Usage

await client.tts.outboundCalls.create({
    key: "value",
});

βš™οΈ Parameters

request: unknown

requestOptions: OutboundCalls.RequestOptions

Tts Workspaces

client.tts.workspaces.list() -> Speechify.TenantsListResponse

πŸ“ Description

List every workspace the authenticated user belongs to. Powers the workspace switcher.

πŸ”Œ Usage

await client.tts.workspaces.list();

βš™οΈ Parameters

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.create({ ...params }) -> Speechify.Tenant

πŸ“ Description

Create a new workspace with the authenticated user as owner. The caller must switch their active workspace client-side via the X-Tenant-ID header to act on the new tenant.

πŸ”Œ Usage

await client.tts.workspaces.create();

βš™οΈ Parameters

request: Speechify.tts.CreateWorkspaceRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.getCurrent() -> Speechify.Tenant

πŸ“ Description

Retrieve the workspace currently selected by the caller (via X-Tenant-ID or auto-resolved).

πŸ”Œ Usage

await client.tts.workspaces.getCurrent();

βš™οΈ Parameters

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.updateCurrent({ ...params }) -> Speechify.Tenant

πŸ“ Description

Rename the current workspace. Owner or admin only.

πŸ”Œ Usage

await client.tts.workspaces.updateCurrent({
    name: "name",
});

βš™οΈ Parameters

request: Speechify.tts.UpdateWorkspaceRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.listMembers() -> Speechify.MembersListResponse

πŸ“ Description

List every member of the current workspace. Any member may call this.

πŸ”Œ Usage

await client.tts.workspaces.listMembers();

βš™οΈ Parameters

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.leave() -> void

πŸ“ Description

Remove the authenticated caller from the current workspace. Refused with 409 when the caller is the last owner β€” promote another member to owner first.

πŸ”Œ Usage

await client.tts.workspaces.leave();

βš™οΈ Parameters

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.removeMember(userUid, { ...params }) -> void

πŸ“ Description

Remove a member from the current workspace. Owner or admin only. The caller cannot remove themselves β€” use POST /v1/tenants/current/members/leave instead.

πŸ”Œ Usage

await client.tts.workspaces.removeMember("user_uid");

βš™οΈ Parameters

userUid: string

request: Speechify.tts.RemoveMemberWorkspacesRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.updateMemberRole(userUid, { ...params }) -> Speechify.Member

πŸ“ Description

Change a member's role. Owner only β€” admins may add or remove members but may not change roles. Refused with 409 when demoting the last remaining owner.

πŸ”Œ Usage

await client.tts.workspaces.updateMemberRole("user_uid", {
    role: "owner",
});

βš™οΈ Parameters

userUid: string

request: Speechify.tts.UpdateMemberRoleRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.listInvites() -> Speechify.InvitesListResponse

πŸ“ Description

List outstanding invites for the current workspace. Invite tokens are redacted.

πŸ”Œ Usage

await client.tts.workspaces.listInvites();

βš™οΈ Parameters

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.createInvite({ ...params }) -> Speechify.Invite

πŸ“ Description

Create an invite to the current workspace. Owner or admin only. The response contains the invite token ONCE β€” subsequent list calls redact it.

πŸ”Œ Usage

await client.tts.workspaces.createInvite({
    email: "email",
});

βš™οΈ Parameters

request: Speechify.tts.CreateInviteRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.revokeInvite(id, { ...params }) -> void

πŸ“ Description

Revoke an outstanding invite. Owner or admin only. Idempotent.

πŸ”Œ Usage

await client.tts.workspaces.revokeInvite("id");

βš™οΈ Parameters

id: string

request: Speechify.tts.RevokeInviteWorkspacesRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.acceptInvite(token, { ...params }) -> Speechify.Tenant

πŸ“ Description

Accept a workspace invite. The authenticated caller is joined to the invite's workspace as a member. Expired, revoked, or already-accepted tokens return 404 to avoid token enumeration.

πŸ”Œ Usage

await client.tts.workspaces.acceptInvite("token");

βš™οΈ Parameters

token: string

request: Speechify.tts.AcceptInviteWorkspacesRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.previewInvite(token, { ...params }) -> Speechify.InvitePreview

πŸ“ Description

Preview a workspace invite without authenticating. Returns the workspace name, inviter details, and expiry so the /join/{token} page can render before the recipient signs in. Anyone with the token can already accept, so this endpoint deliberately surfaces the same information a caller would see after accepting. Invalid tokens (unknown, expired, revoked, already-accepted, or pointing at a soft-deleted workspace) collapse to a single 404 to prevent enumeration.

πŸ”Œ Usage

await client.tts.workspaces.previewInvite("token");

βš™οΈ Parameters

token: string

request: Speechify.tts.PreviewInviteWorkspacesRequest

requestOptions: Workspaces.RequestOptions

client.tts.workspaces.transferWorkspaceOwner({ ...params }) -> void

πŸ“ Description

Transfer ownership of the current workspace atomically. Promotes the target member to owner and demotes the caller to admin in a single transaction. Owner-only; admins cannot hand off a role they were never granted. Prefer this over two PATCH calls to /v1/tenants/current/members/{user_uid}: a sole-owner caller cannot demote themselves first without tripping the last-owner guard, which this endpoint sidesteps by promoting before demoting.

πŸ”Œ Usage

await client.tts.workspaces.transferWorkspaceOwner({
    userUid: "user_uid",
});

βš™οΈ Parameters

request: Speechify.tts.TransferOwnershipRequest

requestOptions: Workspaces.RequestOptions