Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"cliVersion": "5.64.0",
"cliVersion": "5.128.0",
"generatorName": "fernapi/fern-typescript-sdk",
"generatorVersion": "3.70.1",
"generatorConfig": {
"inlineFileProperties": true,
"skipResponseValidation": true,
"namespaceExport": "Speechify"
},
"originGitCommit": "d18d0fff37ec3446bf44071a930fcad840b961e6",
"originGitCommit": "14383dab6762a97b9dab9778796ac2b4c41cdd6d",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github",
"sdkVersion": "4.0.1"
"sdkVersion": "4.0.2"
}
16 changes: 16 additions & 0 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,6 @@ reference.md

# License file — not generated by Fern; keep listed so regen never deletes it.
LICENSE
.fern/replay.lock
.fern/replay.yml
.gitattributes
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.fern/replay.lock linguist-generated=true
58 changes: 57 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@speechify/api",
"version": "4.0.1",
"version": "4.0.2",
"private": false,
"repository": {
"type": "git",
"url": "git+https://github.com/Speechify-AI/sdk-typescript.git"
},
"license": "MIT",
"type": "commonjs",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
Expand Down Expand Up @@ -55,6 +56,39 @@
},
"default": "./dist/cjs/api/resources/voices/exports.js"
},
"./projects": {
"import": {
"types": "./dist/esm/api/resources/projects/exports.d.mts",
"default": "./dist/esm/api/resources/projects/exports.mjs"
},
"require": {
"types": "./dist/cjs/api/resources/projects/exports.d.ts",
"default": "./dist/cjs/api/resources/projects/exports.js"
},
"default": "./dist/cjs/api/resources/projects/exports.js"
},
"./workspaces": {
"import": {
"types": "./dist/esm/api/resources/workspaces/exports.d.mts",
"default": "./dist/esm/api/resources/workspaces/exports.mjs"
},
"require": {
"types": "./dist/cjs/api/resources/workspaces/exports.d.ts",
"default": "./dist/cjs/api/resources/workspaces/exports.js"
},
"default": "./dist/cjs/api/resources/workspaces/exports.js"
},
"./audio/watermark": {
"import": {
"types": "./dist/esm/api/resources/audio/resources/watermark/exports.d.mts",
"default": "./dist/esm/api/resources/audio/resources/watermark/exports.mjs"
},
"require": {
"types": "./dist/cjs/api/resources/audio/resources/watermark/exports.d.ts",
"default": "./dist/cjs/api/resources/audio/resources/watermark/exports.js"
},
"default": "./dist/cjs/api/resources/audio/resources/watermark/exports.js"
},
"./voices/consentChallenges": {
"import": {
"types": "./dist/esm/api/resources/voices/resources/consentChallenges/exports.d.mts",
Expand All @@ -66,6 +100,28 @@
},
"default": "./dist/cjs/api/resources/voices/resources/consentChallenges/exports.js"
},
"./webhooks": {
"import": {
"types": "./dist/esm/api/resources/webhooks/exports.d.mts",
"default": "./dist/esm/api/resources/webhooks/exports.mjs"
},
"require": {
"types": "./dist/cjs/api/resources/webhooks/exports.d.ts",
"default": "./dist/cjs/api/resources/webhooks/exports.js"
},
"default": "./dist/cjs/api/resources/webhooks/exports.js"
},
"./webhooks/endpoints": {
"import": {
"types": "./dist/esm/api/resources/webhooks/resources/endpoints/exports.d.mts",
"default": "./dist/esm/api/resources/webhooks/resources/endpoints/exports.mjs"
},
"require": {
"types": "./dist/cjs/api/resources/webhooks/resources/endpoints/exports.d.ts",
"default": "./dist/cjs/api/resources/webhooks/resources/endpoints/exports.js"
},
"default": "./dist/cjs/api/resources/webhooks/resources/endpoints/exports.js"
},
"./package.json": "./package.json"
},
"files": [
Expand Down
8 changes: 4 additions & 4 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type AuthOption =
| BearerAuthProvider.AuthOptions;

export type BaseClientOptions = {
environment?: core.Supplier<environments.SpeechifyEnvironment | string>;
environment?: core.Supplier<environments.SpeechifyEnvironment | environments.SpeechifyEnvironmentUrls>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
/** Override the Speechify-Version header */
Expand Down Expand Up @@ -63,11 +63,11 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@speechify/api",
"X-Fern-SDK-Version": "4.0.1",
"User-Agent": "@speechify/api/4.0.1",
"X-Fern-SDK-Version": "4.0.2",
"User-Agent": "@speechify/api/4.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
"Speechify-Version": options?.version ?? "2026-09-13",
"Speechify-Version": options?.version ?? "2026-09-30",
},
options?.headers,
);
Expand Down
28 changes: 27 additions & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

import { AudioClient } from "./api/resources/audio/client/Client.js";
import { ModelsClient } from "./api/resources/models/client/Client.js";
import { ProjectsClient } from "./api/resources/projects/client/Client.js";
import { VoicesClient } from "./api/resources/voices/client/Client.js";
import { WebhooksClient } from "./api/resources/webhooks/client/Client.js";
import { WorkspacesClient } from "./api/resources/workspaces/client/Client.js";
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js";
import * as core from "./core/index.js";
import * as environments from "./environments.js";

export declare namespace SpeechifyClient {
export type Options = BaseClientOptions;
Expand All @@ -18,6 +22,9 @@ export class SpeechifyClient {
protected _audio: AudioClient | undefined;
protected _models: ModelsClient | undefined;
protected _voices: VoicesClient | undefined;
protected _projects: ProjectsClient | undefined;
protected _workspaces: WorkspacesClient | undefined;
protected _webhooks: WebhooksClient | undefined;

constructor(options: SpeechifyClient.Options = {}) {
this._options = normalizeClientOptionsWithAuth(options);
Expand All @@ -35,6 +42,18 @@ export class SpeechifyClient {
return (this._voices ??= new VoicesClient(this._options));
}

public get projects(): ProjectsClient {
return (this._projects ??= new ProjectsClient(this._options));
}

public get workspaces(): WorkspacesClient {
return (this._workspaces ??= new WorkspacesClient(this._options));
}

public get webhooks(): WebhooksClient {
return (this._webhooks ??= new WebhooksClient(this._options));
}

/**
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
* This is useful for making requests to endpoints not yet supported in the SDK.
Expand All @@ -54,7 +73,14 @@ export class SpeechifyClient {
input,
init,
{
baseUrl: this._options.baseUrl ?? this._options.environment,
baseUrl:
this._options.baseUrl ??
(async () => {
const env = await core.Supplier.get(this._options.environment);
return typeof env === "string"
? env
: ((env as Record<string, string>)?.base ?? environments.SpeechifyEnvironment.Default.base);
}),
headers: this._options.headers,
timeoutInSeconds: this._options.timeoutInSeconds,
maxRetries: this._options.maxRetries,
Expand Down
31 changes: 20 additions & 11 deletions src/api/resources/audio/client/requests/GetSpeechRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,28 @@ export interface GetSpeechRequest {
audio_format?: GetSpeechRequest.AudioFormat;
/**
* Plain text or SSML to be synthesized to speech.
* Up to 2,000 characters of spoken text, the characters the request is billed for: SSML tags do not count. The input as sent, markup included, may be up to 20,000 characters.
* Refer to https://docs.speechify.ai/docs/api-limits for the input size limits.
* Emotion, Pitch and Speed Rate are configured in the ssml input, please refer to the ssml documentation for more information: https://docs.speechify.ai/docs/ssml#prosody
* SSML sets pauses (`<break>`), speaking rate, pitch and volume (`<prosody>`) and pronunciation (`<sub alias>`): see https://docs.speechify.ai/build/guides/text-to-speech/ssml for each tag. Emotion styles and emphasis are applied only by the Simba 1.6 models, until 2026-11-21; `simba-3.0`, `simba-3.2` and `simba-3.5` accept those tags without applying them.
*/
input: string;
/**
* Language of the input. Follow the format of an ISO 639-1 language code and an ISO 3166-1 region code, separated by a hyphen, e.g. en-US.
* Please refer to the list of the supported languages and recommendations regarding this parameter: https://docs.speechify.ai/docs/language-support.
*/
language?: string;
/** Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity, and the recommended Simba 3 model; it is English only, so a non-English voice returns 400. `simba-english` and `simba-multilingual` are the legacy Simba 1.6 models, kept for compatibility. */
/**
* Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity; it is English only, so a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included.
*
* The legacy Simba 1.6 models `simba-english` and `simba-multilingual` are retired from API version `2026-09-21`: naming one returns 400 `model_retired`. Pinning your API version to a date before `2026-09-21` keeps them on their Simba 1.6 training until **2026-11-21**; from then both ids are served by our current models on every API version that can still name them. Migrate to `simba-3.2` (English), `simba-3.0` or `simba-3.5` before then; call GET /v1/audio/models to see the set your workspace can select today.
*/
model?: GetSpeechRequest.Model;
options?: Speechify.GetSpeechOptionsRequest;
/** The output audio format as a `codec_sampleRate_bitrate` string. Takes precedence over `audio_format` when set. */
output_format?: Speechify.AudioOutputFormat;
pronunciations?: Speechify.Pronunciations;
/** Optional. A stable, opaque identifier for the end user this request is made for: a hash of your own user id or an opaque id, never an email address or other personal data. It is recorded with the request even under zero data retention, and your workspace can be given per-end-user limits and a block list keyed on it. See https://docs.speechify.ai/build/guides/concepts/safety-identifiers. */
safety_identifier?: Speechify.SafetyIdentifier;
/** Id of the voice to be used for synthesizing speech. Refer to /v1/voices endpoint for available voices */
voice_id: string;
}
Expand All @@ -44,20 +52,21 @@ export namespace GetSpeechRequest {
Pcm: "pcm",
} as const;
export type AudioFormat = (typeof AudioFormat)[keyof typeof AudioFormat];
/** Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity, and the recommended Simba 3 model; it is English only, so a non-English voice returns 400. `simba-english` and `simba-multilingual` are the legacy Simba 1.6 models, kept for compatibility. */
/**
* Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity; it is English only, so a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included.
*
* The legacy Simba 1.6 models `simba-english` and `simba-multilingual` are retired from API version `2026-09-21`: naming one returns 400 `model_retired`. Pinning your API version to a date before `2026-09-21` keeps them on their Simba 1.6 training until **2026-11-21**; from then both ids are served by our current models on every API version that can still name them. Migrate to `simba-3.2` (English), `simba-3.0` or `simba-3.5` before then; call GET /v1/audio/models to see the set your workspace can select today.
*/
export const Model = {
/**
* simba-english is the legacy Simba 1.6 English model. It accepts cloned voices self-serve; prefer simba-3.2 for new integrations. */
SimbaEnglish: "simba-english",
/**
* simba-multilingual is the legacy Simba 1.6 multilingual model, covering the full 30+ locale set and mixed-language input. Prefer simba-3.0 for the languages it supports. */
SimbaMultilingual: "simba-multilingual",
/**
* simba-3.0 is the streaming-native multilingual model, and the default when `model` is omitted. Officially supports English plus de-DE, es-ES, es-MX, fr-FR, it-IT and pt-BR; the request language (or the voice's locale when it is omitted) selects the English or the multilingual training. Prefer simba-3.2 for English-only integrations. Cloned/personal voices work self-serve on simba-3.0. */
* simba-3.0 is the streaming-native multilingual model, and the default when `model` is omitted. Officially supports English plus de-DE, es-ES, es-MX, fr-FR, it-IT and pt-BR; the request language (or the voice's locale when it is omitted) selects the English or the multilingual training. Prefer simba-3.5 for new integrations. Cloned/personal voices work self-serve on simba-3.0. */
Simba30: "simba-3.0",
/**
* simba-3.2 is the streaming-native model with the lowest TTFB and richest expressivity. English only; a non-English voice returns 400 - use simba-3.0 for the other supported languages. Cloned voices are supported on simba-3.2 alongside the curated stock roster, currently as a limited release enabled per workspace - contact Speechify to have it enabled for yours. */
* simba-3.2 is the streaming-native model with the lowest TTFB and richest expressivity. English only; a non-English voice returns 400 - use simba-3.0 for the other supported languages. Every English voice in the catalog is supported, cloned voices included. */
Simba32: "simba-3.2",
/**
* simba-3.5 is the recommended streaming-native model, covering 48 languages under one id, English included; the request language (or the voice's locale when it is omitted) selects the English or the multilingual training. Every voice in the catalog is supported, cloned voices included. */
Simba35: "simba-3.5",
} as const;
export type Model = (typeof Model)[keyof typeof Model];
}
1 change: 1 addition & 0 deletions src/api/resources/audio/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

export { AudioClient } from "./client/Client.js";
export * from "./client/index.js";
export * from "./resources/index.js";
1 change: 1 addition & 0 deletions src/api/resources/audio/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./client/index.js";
export * from "./resources/index.js";
export * from "./types/index.js";
2 changes: 2 additions & 0 deletions src/api/resources/audio/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./watermark/client/requests/index.js";
export * as watermark from "./watermark/index.js";
Loading
Loading