From 3a740172b0f30a80ea967c77839653350bd25183 Mon Sep 17 00:00:00 2001 From: luke-speechify <289678208+luke-speechify@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:10:13 +0100 Subject: [PATCH] chore: bump speechify SDK to v3.0.1 across recipes and rename api_key -> token speechify-api v3.0.0 renamed the constructor kwarg from api_key/apiKey to token, so every recipe that constructed the client needed updating. Also bumps the pnpm catalog + all pyproject pins so the recipes actually install v3.0.1. - pnpm-workspace.yaml catalog: @speechify/api 2.0.0 -> 3.0.1 - recipes/audio/python/sdk/{quickstart,streaming,ssml-emotion,speech-marks,voice-cloning}/pyproject.toml and templates/python/recipe/pyproject.toml + agents/python-recipes.md: speechify-api>=2.0.0 -> >=3.0.1 - Python SDK recipes: rename api_key -> token everywhere (env var lookup, guard, Speechify(token=...)) - Python native recipes: rename api_key -> token for symmetry with the TS native recipes that already used `const token = ...` - TypeScript SDK recipes + template: new SpeechifyClient({ apiKey }) -> new SpeechifyClient({ token }) - recipes/audio/typescript/sdk/voice-cloning: voices.delete({ id }) is now voices.delete({ voice_id }) in v3.0.0 (unrelated to the rename but blocks tsc against v3 SDK) - Markdown recipe pages (agents/{python-recipes,typescript-recipes,speechify-tts}.md): code samples updated to match --- agents/python-recipes.md | 8 ++++---- agents/speechify-tts.md | 8 ++++---- agents/typescript-recipes.md | 2 +- pnpm-lock.yaml | 20 +++++++++---------- pnpm-workspace.yaml | 2 +- .../audio/python/native/quickstart/main.py | 6 +++--- .../audio/python/native/speech-marks/main.py | 6 +++--- .../audio/python/native/ssml-emotion/main.py | 6 +++--- recipes/audio/python/native/streaming/main.py | 6 +++--- .../audio/python/native/voice-cloning/main.py | 6 +++--- recipes/audio/python/sdk/quickstart/main.py | 6 +++--- .../python/sdk/quickstart/pyproject.toml | 2 +- recipes/audio/python/sdk/quickstart/uv.lock | 8 ++++---- recipes/audio/python/sdk/speech-marks/main.py | 6 +++--- .../python/sdk/speech-marks/pyproject.toml | 2 +- recipes/audio/python/sdk/speech-marks/uv.lock | 8 ++++---- recipes/audio/python/sdk/ssml-emotion/main.py | 6 +++--- .../python/sdk/ssml-emotion/pyproject.toml | 2 +- recipes/audio/python/sdk/ssml-emotion/uv.lock | 8 ++++---- recipes/audio/python/sdk/streaming/main.py | 6 +++--- .../audio/python/sdk/streaming/pyproject.toml | 2 +- recipes/audio/python/sdk/streaming/uv.lock | 8 ++++---- .../audio/python/sdk/voice-cloning/main.py | 6 +++--- .../python/sdk/voice-cloning/pyproject.toml | 2 +- .../audio/python/sdk/voice-cloning/uv.lock | 8 ++++---- .../typescript/sdk/quickstart/src/index.ts | 2 +- .../typescript/sdk/speech-marks/src/index.ts | 2 +- .../typescript/sdk/ssml-emotion/src/index.ts | 2 +- .../typescript/sdk/streaming/src/index.ts | 2 +- .../typescript/sdk/voice-cloning/src/index.ts | 4 ++-- templates/python/recipe/pyproject.toml | 2 +- templates/typescript/recipe/src/index.ts | 2 +- 32 files changed, 83 insertions(+), 83 deletions(-) diff --git a/agents/python-recipes.md b/agents/python-recipes.md index 7a14783..866ab2a 100644 --- a/agents/python-recipes.md +++ b/agents/python-recipes.md @@ -21,7 +21,7 @@ name = "audio-python-quickstart" version = "0.1.0" requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] ``` @@ -43,11 +43,11 @@ from speechify import Speechify load_dotenv() -api_key = os.environ.get("SPEECHIFY_API_KEY") -if not api_key: +token = os.environ.get("SPEECHIFY_API_KEY") +if not token: raise SystemExit("Set SPEECHIFY_API_KEY (see .env.example).") -client = Speechify(api_key=api_key) +client = Speechify(token=token) ``` An async variant is available as `AsyncSpeechify` with identical method signatures. diff --git a/agents/speechify-tts.md b/agents/speechify-tts.md index 4f5f69f..af3d44d 100644 --- a/agents/speechify-tts.md +++ b/agents/speechify-tts.md @@ -15,12 +15,12 @@ Both SDKs read `SPEECHIFY_API_KEY` from the environment. The deprecated ## Synthesize speech -**TypeScript** (`@speechify/api` v2) +**TypeScript** (`@speechify/api` v3) ```ts import { SpeechifyClient } from "@speechify/api"; -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY! }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY! }); const response = await client.audio.speech({ input: "Hello! This is the Speechify text-to-speech API.", @@ -34,12 +34,12 @@ import fs from "node:fs"; fs.writeFileSync("output.mp3", Buffer.from(response.audio_data, "base64")); ``` -**Python** (`speechify-api` v2) +**Python** (`speechify-api` v3) ```python from speechify import Speechify -client = Speechify(api_key=api_key) +client = Speechify(token=token) response = client.audio.speech( input="Hello! This is the Speechify text-to-speech API.", diff --git a/agents/typescript-recipes.md b/agents/typescript-recipes.md index 7dbd454..68514f9 100644 --- a/agents/typescript-recipes.md +++ b/agents/typescript-recipes.md @@ -64,7 +64,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (see .env.example)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); ``` ## Style diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9428a3..320214f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,8 +7,8 @@ settings: catalogs: default: '@speechify/api': - specifier: 2.0.0 - version: 2.0.0 + specifier: 3.0.1 + version: 3.0.1 '@types/node': specifier: ^22.10.2 version: 22.20.0 @@ -114,7 +114,7 @@ importers: dependencies: '@speechify/api': specifier: 'catalog:' - version: 2.0.0 + version: 3.0.1 dotenv: specifier: 'catalog:' version: 16.6.1 @@ -133,7 +133,7 @@ importers: dependencies: '@speechify/api': specifier: 'catalog:' - version: 2.0.0 + version: 3.0.1 dotenv: specifier: 'catalog:' version: 16.6.1 @@ -152,7 +152,7 @@ importers: dependencies: '@speechify/api': specifier: 'catalog:' - version: 2.0.0 + version: 3.0.1 dotenv: specifier: 'catalog:' version: 16.6.1 @@ -171,7 +171,7 @@ importers: dependencies: '@speechify/api': specifier: 'catalog:' - version: 2.0.0 + version: 3.0.1 dotenv: specifier: 'catalog:' version: 16.6.1 @@ -190,7 +190,7 @@ importers: dependencies: '@speechify/api': specifier: 'catalog:' - version: 2.0.0 + version: 3.0.1 dotenv: specifier: 'catalog:' version: 16.6.1 @@ -363,8 +363,8 @@ packages: cpu: [x64] os: [win32] - '@speechify/api@2.0.0': - resolution: {integrity: sha512-GYIYO/B0bRArg9e4ljLxHL/ZG27p7X68UGu6bvEqBk0I8CSpqPKHO+rsGGJR+oIRzXZpR5LVNcS6RPN0ljnvNw==} + '@speechify/api@3.0.1': + resolution: {integrity: sha512-bEqbyvwGW0A/cgq+ZsQJVP3Hm4/0Bm1sniVtPLBh7vDNG2f/YY8y8sweWojoUnhIeIAL6bHBde43+VZLA2MYpA==} engines: {node: '>=18.0.0'} '@types/node@22.20.0': @@ -482,7 +482,7 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@speechify/api@2.0.0': {} + '@speechify/api@3.0.1': {} '@types/node@22.20.0': dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a3107b9..fc5bfcb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,7 +9,7 @@ packages: # Single source of truth for shared dependency versions. # Recipes reference these with "catalog:" instead of pinning their own. catalog: - "@speechify/api": 2.0.0 + "@speechify/api": 3.0.1 tsx: ^4.19.2 typescript: ^5.7.2 "@types/node": ^22.10.2 diff --git a/recipes/audio/python/native/quickstart/main.py b/recipes/audio/python/native/quickstart/main.py index 96f20b6..f71161a 100644 --- a/recipes/audio/python/native/quickstart/main.py +++ b/recipes/audio/python/native/quickstart/main.py @@ -12,14 +12,14 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") resp = requests.post( "https://api.speechify.ai/v1/audio/speech", headers={ - "Authorization": f"Bearer {api_key}", + "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ diff --git a/recipes/audio/python/native/speech-marks/main.py b/recipes/audio/python/native/speech-marks/main.py index 68ba213..d6f61b5 100644 --- a/recipes/audio/python/native/speech-marks/main.py +++ b/recipes/audio/python/native/speech-marks/main.py @@ -19,14 +19,14 @@ def vtt_time(ms: int) -> str: def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") resp = requests.post( "https://api.speechify.ai/v1/audio/speech", headers={ - "Authorization": f"Bearer {api_key}", + "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ diff --git a/recipes/audio/python/native/ssml-emotion/main.py b/recipes/audio/python/native/ssml-emotion/main.py index 647fb49..52a8828 100644 --- a/recipes/audio/python/native/ssml-emotion/main.py +++ b/recipes/audio/python/native/ssml-emotion/main.py @@ -25,14 +25,14 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") resp = requests.post( "https://api.speechify.ai/v1/audio/speech", headers={ - "Authorization": f"Bearer {api_key}", + "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ diff --git a/recipes/audio/python/native/streaming/main.py b/recipes/audio/python/native/streaming/main.py index a1cb7d6..d730df0 100644 --- a/recipes/audio/python/native/streaming/main.py +++ b/recipes/audio/python/native/streaming/main.py @@ -10,8 +10,8 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") # POST /v1/audio/stream returns raw audio bytes (HTTP chunked) instead of @@ -20,7 +20,7 @@ def main() -> None: with requests.post( "https://api.speechify.ai/v1/audio/stream", headers={ - "Authorization": f"Bearer {api_key}", + "Authorization": f"Bearer {token}", "Content-Type": "application/json", "Accept": "audio/mpeg", }, diff --git a/recipes/audio/python/native/voice-cloning/main.py b/recipes/audio/python/native/voice-cloning/main.py index 064094c..491dde2 100644 --- a/recipes/audio/python/native/voice-cloning/main.py +++ b/recipes/audio/python/native/voice-cloning/main.py @@ -18,11 +18,11 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - auth = {"Authorization": f"Bearer {api_key}"} + auth = {"Authorization": f"Bearer {token}"} # 1. Clone a voice from an audio sample (10-30s of clean speech works well). # POST /v1/voices is multipart/form-data — pass `files=` to requests and it diff --git a/recipes/audio/python/sdk/quickstart/main.py b/recipes/audio/python/sdk/quickstart/main.py index d8945aa..516bdf9 100644 --- a/recipes/audio/python/sdk/quickstart/main.py +++ b/recipes/audio/python/sdk/quickstart/main.py @@ -8,11 +8,11 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - client = Speechify(api_key=api_key) + client = Speechify(token=token) response = client.audio.speech( input="Hello! This is the Speechify text-to-speech API.", diff --git a/recipes/audio/python/sdk/quickstart/pyproject.toml b/recipes/audio/python/sdk/quickstart/pyproject.toml index c0963e4..95f77ba 100644 --- a/recipes/audio/python/sdk/quickstart/pyproject.toml +++ b/recipes/audio/python/sdk/quickstart/pyproject.toml @@ -4,6 +4,6 @@ version = "0.1.0" description = "Synthesize speech to an MP3 file with the Speechify TTS API." requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/recipes/audio/python/sdk/quickstart/uv.lock b/recipes/audio/python/sdk/quickstart/uv.lock index 68ad38d..da30115 100644 --- a/recipes/audio/python/sdk/quickstart/uv.lock +++ b/recipes/audio/python/sdk/quickstart/uv.lock @@ -37,7 +37,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.0" }, - { name = "speechify-api", specifier = ">=2.0.0" }, + { name = "speechify-api", specifier = ">=3.0.1" }, ] [[package]] @@ -249,7 +249,7 @@ wheels = [ [[package]] name = "speechify-api" -version = "2.0.0" +version = "3.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -257,9 +257,9 @@ dependencies = [ { name = "pydantic-core" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/36/43/920c889dfb4d859c690d28fb628764e4732035655344172c2d2210835b82/speechify_api-2.0.0.tar.gz", hash = "sha256:d132e6585f8c0f50deeffeac53c6c52d35895071eb9e8463f5917531c2dd944b", size = 42682, upload-time = "2026-06-23T08:20:49.206Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/67/961acfbf3355c73b85c9a85e7d2ca4c38a9f14261c845ba9c804940969de/speechify_api-3.0.1.tar.gz", hash = "sha256:e73a084fd6845cb2f92bff2e4dfa6d58052ff97e8112b38dc67ebbf47610aa1a", size = 48230, upload-time = "2026-07-10T19:41:34.679Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/b0/a9717769b4c3fdc0bcb15e961f9a65ecb1ce104205d13126c225e1d25448/speechify_api-2.0.0-py3-none-any.whl", hash = "sha256:fafadb28c88e917c9c95ab302f45a6576a8f0260b248040184083ae0eb11f9fa", size = 70499, upload-time = "2026-06-23T08:20:50.524Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7d/52daedb2aa7e1df49f39a03b0d87ea25cd281588102f4231cffbcbf32038/speechify_api-3.0.1-py3-none-any.whl", hash = "sha256:7e09d09bee792a348a5dbfe0e07a806152ba2797c70b399b6e5544b320808cf8", size = 75381, upload-time = "2026-07-10T19:41:33.749Z" }, ] [[package]] diff --git a/recipes/audio/python/sdk/speech-marks/main.py b/recipes/audio/python/sdk/speech-marks/main.py index 7419a03..fcc35d0 100644 --- a/recipes/audio/python/sdk/speech-marks/main.py +++ b/recipes/audio/python/sdk/speech-marks/main.py @@ -16,11 +16,11 @@ def vtt_time(ms: int) -> str: def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - client = Speechify(api_key=api_key) + client = Speechify(token=token) response = client.audio.speech( input="The quick brown fox jumps over the lazy dog.", diff --git a/recipes/audio/python/sdk/speech-marks/pyproject.toml b/recipes/audio/python/sdk/speech-marks/pyproject.toml index ea1e183..a208a9f 100644 --- a/recipes/audio/python/sdk/speech-marks/pyproject.toml +++ b/recipes/audio/python/sdk/speech-marks/pyproject.toml @@ -4,6 +4,6 @@ version = "0.1.0" description = "Generate WebVTT captions from word-level speech marks with the Speechify TTS API." requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/recipes/audio/python/sdk/speech-marks/uv.lock b/recipes/audio/python/sdk/speech-marks/uv.lock index 2b45339..9e4a77b 100644 --- a/recipes/audio/python/sdk/speech-marks/uv.lock +++ b/recipes/audio/python/sdk/speech-marks/uv.lock @@ -37,7 +37,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.0" }, - { name = "speechify-api", specifier = ">=2.0.0" }, + { name = "speechify-api", specifier = ">=3.0.1" }, ] [[package]] @@ -249,7 +249,7 @@ wheels = [ [[package]] name = "speechify-api" -version = "2.0.0" +version = "3.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -257,9 +257,9 @@ dependencies = [ { name = "pydantic-core" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/36/43/920c889dfb4d859c690d28fb628764e4732035655344172c2d2210835b82/speechify_api-2.0.0.tar.gz", hash = "sha256:d132e6585f8c0f50deeffeac53c6c52d35895071eb9e8463f5917531c2dd944b", size = 42682, upload-time = "2026-06-23T08:20:49.206Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/67/961acfbf3355c73b85c9a85e7d2ca4c38a9f14261c845ba9c804940969de/speechify_api-3.0.1.tar.gz", hash = "sha256:e73a084fd6845cb2f92bff2e4dfa6d58052ff97e8112b38dc67ebbf47610aa1a", size = 48230, upload-time = "2026-07-10T19:41:34.679Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/b0/a9717769b4c3fdc0bcb15e961f9a65ecb1ce104205d13126c225e1d25448/speechify_api-2.0.0-py3-none-any.whl", hash = "sha256:fafadb28c88e917c9c95ab302f45a6576a8f0260b248040184083ae0eb11f9fa", size = 70499, upload-time = "2026-06-23T08:20:50.524Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7d/52daedb2aa7e1df49f39a03b0d87ea25cd281588102f4231cffbcbf32038/speechify_api-3.0.1-py3-none-any.whl", hash = "sha256:7e09d09bee792a348a5dbfe0e07a806152ba2797c70b399b6e5544b320808cf8", size = 75381, upload-time = "2026-07-10T19:41:33.749Z" }, ] [[package]] diff --git a/recipes/audio/python/sdk/ssml-emotion/main.py b/recipes/audio/python/sdk/ssml-emotion/main.py index 10dcc7f..3e4accb 100644 --- a/recipes/audio/python/sdk/ssml-emotion/main.py +++ b/recipes/audio/python/sdk/ssml-emotion/main.py @@ -22,11 +22,11 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - client = Speechify(api_key=api_key) + client = Speechify(token=token) response = client.audio.speech( input=SSML, diff --git a/recipes/audio/python/sdk/ssml-emotion/pyproject.toml b/recipes/audio/python/sdk/ssml-emotion/pyproject.toml index 6916a06..068fdcb 100644 --- a/recipes/audio/python/sdk/ssml-emotion/pyproject.toml +++ b/recipes/audio/python/sdk/ssml-emotion/pyproject.toml @@ -4,6 +4,6 @@ version = "0.1.0" description = "Control emotion, pitch, rate, pauses & emphasis via SSML with the Speechify TTS API." requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/recipes/audio/python/sdk/ssml-emotion/uv.lock b/recipes/audio/python/sdk/ssml-emotion/uv.lock index fd57177..c2a7deb 100644 --- a/recipes/audio/python/sdk/ssml-emotion/uv.lock +++ b/recipes/audio/python/sdk/ssml-emotion/uv.lock @@ -37,7 +37,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.0" }, - { name = "speechify-api", specifier = ">=2.0.0" }, + { name = "speechify-api", specifier = ">=3.0.1" }, ] [[package]] @@ -249,7 +249,7 @@ wheels = [ [[package]] name = "speechify-api" -version = "2.0.0" +version = "3.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -257,9 +257,9 @@ dependencies = [ { name = "pydantic-core" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/36/43/920c889dfb4d859c690d28fb628764e4732035655344172c2d2210835b82/speechify_api-2.0.0.tar.gz", hash = "sha256:d132e6585f8c0f50deeffeac53c6c52d35895071eb9e8463f5917531c2dd944b", size = 42682, upload-time = "2026-06-23T08:20:49.206Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/67/961acfbf3355c73b85c9a85e7d2ca4c38a9f14261c845ba9c804940969de/speechify_api-3.0.1.tar.gz", hash = "sha256:e73a084fd6845cb2f92bff2e4dfa6d58052ff97e8112b38dc67ebbf47610aa1a", size = 48230, upload-time = "2026-07-10T19:41:34.679Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/b0/a9717769b4c3fdc0bcb15e961f9a65ecb1ce104205d13126c225e1d25448/speechify_api-2.0.0-py3-none-any.whl", hash = "sha256:fafadb28c88e917c9c95ab302f45a6576a8f0260b248040184083ae0eb11f9fa", size = 70499, upload-time = "2026-06-23T08:20:50.524Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7d/52daedb2aa7e1df49f39a03b0d87ea25cd281588102f4231cffbcbf32038/speechify_api-3.0.1-py3-none-any.whl", hash = "sha256:7e09d09bee792a348a5dbfe0e07a806152ba2797c70b399b6e5544b320808cf8", size = 75381, upload-time = "2026-07-10T19:41:33.749Z" }, ] [[package]] diff --git a/recipes/audio/python/sdk/streaming/main.py b/recipes/audio/python/sdk/streaming/main.py index 2b152d9..303316b 100644 --- a/recipes/audio/python/sdk/streaming/main.py +++ b/recipes/audio/python/sdk/streaming/main.py @@ -7,11 +7,11 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - client = Speechify(api_key=api_key) + client = Speechify(token=token) # `audio.stream` yields audio chunks (bytes) as they are synthesized — useful for # long inputs and low time-to-first-byte playback. diff --git a/recipes/audio/python/sdk/streaming/pyproject.toml b/recipes/audio/python/sdk/streaming/pyproject.toml index ed12365..e88111c 100644 --- a/recipes/audio/python/sdk/streaming/pyproject.toml +++ b/recipes/audio/python/sdk/streaming/pyproject.toml @@ -4,6 +4,6 @@ version = "0.1.0" description = "Stream synthesized audio to a file as it is generated with the Speechify TTS API." requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/recipes/audio/python/sdk/streaming/uv.lock b/recipes/audio/python/sdk/streaming/uv.lock index e19cf8c..392f096 100644 --- a/recipes/audio/python/sdk/streaming/uv.lock +++ b/recipes/audio/python/sdk/streaming/uv.lock @@ -37,7 +37,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.0" }, - { name = "speechify-api", specifier = ">=2.0.0" }, + { name = "speechify-api", specifier = ">=3.0.1" }, ] [[package]] @@ -249,7 +249,7 @@ wheels = [ [[package]] name = "speechify-api" -version = "2.0.0" +version = "3.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -257,9 +257,9 @@ dependencies = [ { name = "pydantic-core" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/36/43/920c889dfb4d859c690d28fb628764e4732035655344172c2d2210835b82/speechify_api-2.0.0.tar.gz", hash = "sha256:d132e6585f8c0f50deeffeac53c6c52d35895071eb9e8463f5917531c2dd944b", size = 42682, upload-time = "2026-06-23T08:20:49.206Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/67/961acfbf3355c73b85c9a85e7d2ca4c38a9f14261c845ba9c804940969de/speechify_api-3.0.1.tar.gz", hash = "sha256:e73a084fd6845cb2f92bff2e4dfa6d58052ff97e8112b38dc67ebbf47610aa1a", size = 48230, upload-time = "2026-07-10T19:41:34.679Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/b0/a9717769b4c3fdc0bcb15e961f9a65ecb1ce104205d13126c225e1d25448/speechify_api-2.0.0-py3-none-any.whl", hash = "sha256:fafadb28c88e917c9c95ab302f45a6576a8f0260b248040184083ae0eb11f9fa", size = 70499, upload-time = "2026-06-23T08:20:50.524Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7d/52daedb2aa7e1df49f39a03b0d87ea25cd281588102f4231cffbcbf32038/speechify_api-3.0.1-py3-none-any.whl", hash = "sha256:7e09d09bee792a348a5dbfe0e07a806152ba2797c70b399b6e5544b320808cf8", size = 75381, upload-time = "2026-07-10T19:41:33.749Z" }, ] [[package]] diff --git a/recipes/audio/python/sdk/voice-cloning/main.py b/recipes/audio/python/sdk/voice-cloning/main.py index a576220..1be6f2f 100644 --- a/recipes/audio/python/sdk/voice-cloning/main.py +++ b/recipes/audio/python/sdk/voice-cloning/main.py @@ -13,11 +13,11 @@ def main() -> None: load_dotenv() - api_key = os.environ.get("SPEECHIFY_API_KEY") - if not api_key: + token = os.environ.get("SPEECHIFY_API_KEY") + if not token: raise SystemExit("Set SPEECHIFY_API_KEY (copy .env.example to .env).") - client = Speechify(api_key=api_key) + client = Speechify(token=token) # 1. Clone a voice from an audio sample (10-30s of clean speech works well). # `consent` is REQUIRED: a JSON string attesting you have the speaker's diff --git a/recipes/audio/python/sdk/voice-cloning/pyproject.toml b/recipes/audio/python/sdk/voice-cloning/pyproject.toml index 55f63c3..30f972f 100644 --- a/recipes/audio/python/sdk/voice-cloning/pyproject.toml +++ b/recipes/audio/python/sdk/voice-cloning/pyproject.toml @@ -4,6 +4,6 @@ version = "0.1.0" description = "Clone a voice from an audio sample, synthesize with it, then delete it (Speechify TTS API)." requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/recipes/audio/python/sdk/voice-cloning/uv.lock b/recipes/audio/python/sdk/voice-cloning/uv.lock index cf8d2ee..458db63 100644 --- a/recipes/audio/python/sdk/voice-cloning/uv.lock +++ b/recipes/audio/python/sdk/voice-cloning/uv.lock @@ -37,7 +37,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.0" }, - { name = "speechify-api", specifier = ">=2.0.0" }, + { name = "speechify-api", specifier = ">=3.0.1" }, ] [[package]] @@ -249,7 +249,7 @@ wheels = [ [[package]] name = "speechify-api" -version = "2.0.0" +version = "3.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -257,9 +257,9 @@ dependencies = [ { name = "pydantic-core" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/36/43/920c889dfb4d859c690d28fb628764e4732035655344172c2d2210835b82/speechify_api-2.0.0.tar.gz", hash = "sha256:d132e6585f8c0f50deeffeac53c6c52d35895071eb9e8463f5917531c2dd944b", size = 42682, upload-time = "2026-06-23T08:20:49.206Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/67/961acfbf3355c73b85c9a85e7d2ca4c38a9f14261c845ba9c804940969de/speechify_api-3.0.1.tar.gz", hash = "sha256:e73a084fd6845cb2f92bff2e4dfa6d58052ff97e8112b38dc67ebbf47610aa1a", size = 48230, upload-time = "2026-07-10T19:41:34.679Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/b0/a9717769b4c3fdc0bcb15e961f9a65ecb1ce104205d13126c225e1d25448/speechify_api-2.0.0-py3-none-any.whl", hash = "sha256:fafadb28c88e917c9c95ab302f45a6576a8f0260b248040184083ae0eb11f9fa", size = 70499, upload-time = "2026-06-23T08:20:50.524Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7d/52daedb2aa7e1df49f39a03b0d87ea25cd281588102f4231cffbcbf32038/speechify_api-3.0.1-py3-none-any.whl", hash = "sha256:7e09d09bee792a348a5dbfe0e07a806152ba2797c70b399b6e5544b320808cf8", size = 75381, upload-time = "2026-07-10T19:41:33.749Z" }, ] [[package]] diff --git a/recipes/audio/typescript/sdk/quickstart/src/index.ts b/recipes/audio/typescript/sdk/quickstart/src/index.ts index f712bac..373714d 100644 --- a/recipes/audio/typescript/sdk/quickstart/src/index.ts +++ b/recipes/audio/typescript/sdk/quickstart/src/index.ts @@ -6,7 +6,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); async function main() { const response = await client.audio.speech({ diff --git a/recipes/audio/typescript/sdk/speech-marks/src/index.ts b/recipes/audio/typescript/sdk/speech-marks/src/index.ts index d33deee..a1703ff 100644 --- a/recipes/audio/typescript/sdk/speech-marks/src/index.ts +++ b/recipes/audio/typescript/sdk/speech-marks/src/index.ts @@ -6,7 +6,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); /** Format a time in milliseconds as a WebVTT timestamp: HH:MM:SS.mmm */ function vttTime(ms: number): string { diff --git a/recipes/audio/typescript/sdk/ssml-emotion/src/index.ts b/recipes/audio/typescript/sdk/ssml-emotion/src/index.ts index 54bf63f..7fce43d 100644 --- a/recipes/audio/typescript/sdk/ssml-emotion/src/index.ts +++ b/recipes/audio/typescript/sdk/ssml-emotion/src/index.ts @@ -6,7 +6,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); // SSML input must have a single root. Speechify supports standard SSML // (prosody / break / emphasis) plus the tag. diff --git a/recipes/audio/typescript/sdk/streaming/src/index.ts b/recipes/audio/typescript/sdk/streaming/src/index.ts index 4d33f23..24d7a4a 100644 --- a/recipes/audio/typescript/sdk/streaming/src/index.ts +++ b/recipes/audio/typescript/sdk/streaming/src/index.ts @@ -8,7 +8,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); async function main() { // `audio.stream` returns a BinaryResponse — consume it as a Web ReadableStream, diff --git a/recipes/audio/typescript/sdk/voice-cloning/src/index.ts b/recipes/audio/typescript/sdk/voice-cloning/src/index.ts index e0a7596..52a5e5b 100644 --- a/recipes/audio/typescript/sdk/voice-cloning/src/index.ts +++ b/recipes/audio/typescript/sdk/voice-cloning/src/index.ts @@ -7,7 +7,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); // Bundled sample: ~26s of NASA ISS spacewalk audio (public domain). const samplePath = path.resolve(import.meta.dirname, "../fixtures/spacewalk.wav"); @@ -50,7 +50,7 @@ async function main() { } finally { // 3. Clean up so cloned voices don't accumulate on your account. // Remove this to keep the voice and reuse it later via voice.id. - await client.voices.delete({ id: voice.id }); + await client.voices.delete({ voice_id: voice.id }); console.log(`Deleted cloned voice ${voice.id}`); } } diff --git a/templates/python/recipe/pyproject.toml b/templates/python/recipe/pyproject.toml index 5245763..aa430c4 100644 --- a/templates/python/recipe/pyproject.toml +++ b/templates/python/recipe/pyproject.toml @@ -3,6 +3,6 @@ name = "change-me-python-recipe" version = "0.1.0" requires-python = ">=3.10" dependencies = [ - "speechify-api>=2.0.0", + "speechify-api>=3.0.1", "python-dotenv>=1.0.0", ] diff --git a/templates/typescript/recipe/src/index.ts b/templates/typescript/recipe/src/index.ts index 6b3efae..27c07eb 100644 --- a/templates/typescript/recipe/src/index.ts +++ b/templates/typescript/recipe/src/index.ts @@ -5,7 +5,7 @@ if (!process.env.SPEECHIFY_API_KEY) { throw new Error("Set SPEECHIFY_API_KEY (copy .env.example to .env)."); } -const client = new SpeechifyClient({ apiKey: process.env.SPEECHIFY_API_KEY }); +const client = new SpeechifyClient({ token: process.env.SPEECHIFY_API_KEY }); async function main() { // TODO: write your recipe here. See agents/speechify-tts.md for the API surface.