Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/spitch-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/spitch-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/spitch-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'spi-tch/spitch-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.41.2"
".": "1.42.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babs-technologies%2Fspitch-b384c3db1a21cd96c342e397f623e66793d5da64a726644609f7803ef6b5886a.yml
openapi_spec_hash: eab054bdfec2c83b963ea3f120bf4109
config_hash: 5945e27bb7f451aa23c0fe256740d398
configured_endpoints: 10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babs-technologies%2Fspitch-9caec45089fb23c139a076c7f6a62fdf1397b3384d3d450e5fcefdc840e7eafc.yml
openapi_spec_hash: 9b85c4aaecd7073df4e7e94a1887475b
config_hash: f3bd776604dfca42c23f55d275b73bd0
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 1.42.0 (2026-01-21)

Full Changelog: [v1.41.2...v1.42.0](https://github.com/spi-tch/spitch-python/compare/v1.41.2...v1.42.0)

### Features

* **api:** manual updates ([12f75ef](https://github.com/spi-tch/spitch-python/commit/12f75eff7f034196f0f453dfb4b4c800234d9198))
* **client:** add support for binary request streaming ([0c96451](https://github.com/spi-tch/spitch-python/commit/0c96451d56e5897221e1a5e628c557f8d47df911))
* **files:** add support for string alternative to file upload type ([7c71520](https://github.com/spi-tch/spitch-python/commit/7c7152096acff1ab2777e88ea6edf8e74762a366))


### Bug Fixes

* ensure streams are always closed ([2eaa7db](https://github.com/spi-tch/spitch-python/commit/2eaa7dbb883d8ae3ecf90da45dce26252a996f62))
* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([49b3944](https://github.com/spi-tch/spitch-python/commit/49b39447feb57724b18dbabd08da07ff6fe10164))
* use async_to_httpx_files in patch method ([d6681dc](https://github.com/spi-tch/spitch-python/commit/d6681dc12cb59df8843b6adbe09095efde66548b))


### Chores

* add missing docstrings ([5706a11](https://github.com/spi-tch/spitch-python/commit/5706a112946f0c294388455c32cf5c1e1bad270a))
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([ebbc73f](https://github.com/spi-tch/spitch-python/commit/ebbc73f41c762dc2adcbb3013ea695fdb3c50e2d))
* **docs:** use environment variables for authentication in code snippets ([e74350e](https://github.com/spi-tch/spitch-python/commit/e74350e037dc2136577aa758e493e0261ce70166))
* **internal:** add `--fix` argument to lint script ([697bfd0](https://github.com/spi-tch/spitch-python/commit/697bfd03e8bc2c855e36fbfcc23f6ecf7d740652))
* **internal:** add missing files argument to base client ([d52ec35](https://github.com/spi-tch/spitch-python/commit/d52ec358ed429f302ff0c035d1b8b94cbe24e3e0))
* **internal:** codegen related update ([d11c298](https://github.com/spi-tch/spitch-python/commit/d11c2988b89fde8ef890fe072869caf1692fe56a))
* **internal:** update `actions/checkout` version ([9dfcb50](https://github.com/spi-tch/spitch-python/commit/9dfcb509c7bed5382e2de4663838fc0583774bc2))
* speedup initial import ([8b385df](https://github.com/spi-tch/spitch-python/commit/8b385dffc6d34d7cbda6ba197d08637c98a6af37))
* update lockfile ([442785c](https://github.com/spi-tch/spitch-python/commit/442785c97d9cb3ccee5403666a4cdbbf00338cea))

## 1.41.2 (2025-11-25)

Full Changelog: [v1.41.1...v1.41.2](https://github.com/spi-tch/spitch-python/compare/v1.41.1...v1.41.2)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Spitch
Copyright 2026 Spitch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ pip install spitch[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from spitch import DefaultAioHttpClient
from spitch import AsyncSpitch


async def main() -> None:
async with AsyncSpitch(
api_key="My API Key",
api_key=os.environ.get("SPITCH_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
response = await client.speech.generate(
Expand Down
23 changes: 5 additions & 18 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Types:

```python
from spitch.types import Transcription
from spitch.types import Segment, SpeechTranscribeResponse
```

Methods:

- <code title="post /v1/speech">client.speech.<a href="./src/spitch/resources/speech.py">generate</a>(\*\*<a href="src/spitch/types/speech_generate_params.py">params</a>) -> BinaryAPIResponse</code>
- <code title="post /v1/transcriptions">client.speech.<a href="./src/spitch/resources/speech.py">transcribe</a>(\*\*<a href="src/spitch/types/speech_transcribe_params.py">params</a>) -> <a href="./src/spitch/types/transcription.py">Transcription</a></code>
- <code title="post /v1/transcriptions">client.speech.<a href="./src/spitch/resources/speech.py">transcribe</a>(\*\*<a href="src/spitch/types/speech_transcribe_params.py">params</a>) -> <a href="./src/spitch/types/speech_transcribe_response.py">SpeechTranscribeResponse</a></code>

# Text

Expand All @@ -29,27 +29,14 @@ Methods:
Types:

```python
from spitch.types import File, FileUsage, Files, FileDownloadResponse
from spitch.types import File, FileUsage, Files, FileDeleteResponse
```

Methods:

- <code title="get /v1/files">client.files.<a href="./src/spitch/resources/files.py">list</a>(\*\*<a href="src/spitch/types/file_list_params.py">params</a>) -> <a href="./src/spitch/types/file.py">SyncFilesCursor[File]</a></code>
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/spitch/resources/files.py">delete</a>(file_id) -> object</code>
- <code title="get /v1/files/{file_id}/url">client.files.<a href="./src/spitch/resources/files.py">download</a>(file_id, \*\*<a href="src/spitch/types/file_download_params.py">params</a>) -> <a href="./src/spitch/types/file_download_response.py">FileDownloadResponse</a></code>
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/spitch/resources/files.py">delete</a>(file_id) -> <a href="./src/spitch/types/file_delete_response.py">FileDeleteResponse</a></code>
- <code title="get /v1/files/{file_id}/url">client.files.<a href="./src/spitch/resources/files.py">download</a>(file_id, \*\*<a href="src/spitch/types/file_download_params.py">params</a>) -> object</code>
- <code title="get /v1/files/{file_id}">client.files.<a href="./src/spitch/resources/files.py">get</a>(file_id) -> <a href="./src/spitch/types/file.py">File</a></code>
- <code title="post /v1/files">client.files.<a href="./src/spitch/resources/files.py">upload</a>(\*\*<a href="src/spitch/types/file_upload_params.py">params</a>) -> <a href="./src/spitch/types/file.py">File</a></code>
- <code title="get /v1/files:usage">client.files.<a href="./src/spitch/resources/files.py">usage</a>() -> <a href="./src/spitch/types/file_usage.py">FileUsage</a></code>

# Jobs

Types:

```python
from spitch.types import Job, Jobs
```

Methods:

- <code title="get /v1/jobs">client.jobs.<a href="./src/spitch/resources/jobs.py">list</a>(\*\*<a href="src/spitch/types/job_list_params.py">params</a>) -> <a href="./src/spitch/types/job.py">SyncFilesCursor[Job]</a></code>
- <code title="get /v1/jobs/{job_id}">client.jobs.<a href="./src/spitch/resources/jobs.py">get</a>(job_id) -> <a href="./src/spitch/types/job.py">Job</a></code>
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[project]
name = "spitch"
version = "1.41.2"
version = "1.42.0"
description = "The official Python library for the spitch API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Spitch", email = "developer@spitch.app" },
]

dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.7, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"cached-property; python_version < '3.8'",
]

requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
Expand Down Expand Up @@ -47,7 +49,7 @@ managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright==1.1.399",
"mypy",
"mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
Expand Down
113 changes: 62 additions & 51 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,45 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.13
aiohttp==3.13.2
# via httpx-aiohttp
# via spitch
aiosignal==1.3.2
aiosignal==1.4.0
# via aiohttp
annotated-types==0.6.0
annotated-types==0.7.0
# via pydantic
anyio==4.4.0
anyio==4.12.0
# via httpx
# via spitch
argcomplete==3.1.2
argcomplete==3.6.3
# via nox
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
attrs==25.4.0
# via aiohttp
certifi==2023.7.22
# via nox
backports-asyncio-runner==1.2.0
# via pytest-asyncio
certifi==2025.11.12
# via httpcore
# via httpx
colorlog==6.7.0
colorlog==6.10.1
# via nox
dependency-groups==1.3.1
# via nox
dirty-equals==0.6.0
distlib==0.3.7
dirty-equals==0.11
distlib==0.4.0
# via virtualenv
distro==1.8.0
distro==1.9.0
# via spitch
exceptiongroup==1.2.2
exceptiongroup==1.3.1
# via anyio
# via pytest
execnet==2.1.1
execnet==2.1.2
# via pytest-xdist
filelock==3.12.4
filelock==3.19.1
# via virtualenv
frozenlist==1.7.0
frozenlist==1.8.0
# via aiohttp
# via aiosignal
h11==0.16.0
Expand All @@ -58,81 +63,87 @@ httpx==0.27.2
# via spitch
httpx-aiohttp==0.1.9
# via spitch
idna==3.4
humanize==4.13.0
# via nox
idna==3.11
# via anyio
# via httpx
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
importlib-metadata==8.7.0
iniconfig==2.1.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.5.0
multidict==6.7.0
# via aiohttp
# via yarl
mypy==1.14.1
mypy-extensions==1.0.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
nodeenv==1.8.0
nodeenv==1.9.1
# via pyright
nox==2023.4.22
packaging==23.2
nox==2025.11.12
packaging==25.0
# via dependency-groups
# via nox
# via pytest
platformdirs==3.11.0
pathspec==0.12.1
# via mypy
platformdirs==4.4.0
# via virtualenv
pluggy==1.5.0
pluggy==1.6.0
# via pytest
propcache==0.3.2
propcache==0.4.1
# via aiohttp
# via yarl
pydantic==2.11.9
pydantic==2.12.5
# via spitch
pydantic-core==2.33.2
pydantic-core==2.41.5
# via pydantic
pygments==2.18.0
pygments==2.19.2
# via pytest
# via rich
pyright==1.1.399
pytest==8.3.3
pytest==8.4.2
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
pytest-asyncio==1.2.0
pytest-xdist==3.8.0
python-dateutil==2.9.0.post0
# via time-machine
pytz==2023.3.post1
# via dirty-equals
respx==0.22.0
rich==13.7.1
ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
rich==14.2.0
ruff==0.14.7
six==1.17.0
# via python-dateutil
sniffio==1.3.0
# via anyio
# via httpx
sniffio==1.3.1
# via spitch
time-machine==2.9.0
tomli==2.0.2
time-machine==2.19.0
tomli==2.3.0
# via dependency-groups
# via mypy
# via nox
# via pytest
typing-extensions==4.12.2
typing-extensions==4.15.0
# via aiosignal
# via anyio
# via exceptiongroup
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
# via pytest-asyncio
# via spitch
# via typing-inspection
typing-inspection==0.4.1
# via virtualenv
typing-inspection==0.4.2
# via pydantic
virtualenv==20.24.5
virtualenv==20.35.4
# via nox
yarl==1.20.1
yarl==1.22.0
# via aiohttp
zipp==3.17.0
zipp==3.23.0
# via importlib-metadata
Loading
Loading