Skip to content
Open
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
45 changes: 2 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -44,7 +44,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Expand All @@ -61,44 +61,3 @@ jobs:

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/runwayml-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: |-
github.repository == 'stainless-sdks/runwayml-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

test:
timeout-minutes: 10
name: test
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test
8 changes: 2 additions & 6 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/runwayml/sdk-python/actions/workflows/publish-pypi.yml
# workflow for re-running publishing to PyPI in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/runwayml/sdk-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
PYPI_TOKEN: ${{ secrets.RUNWAYML_PYPI_TOKEN || secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.15.0"
".": "5.16.0"
}
3 changes: 0 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
configured_endpoints: 63
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-673462285f9cc77f80b538a726a55a7d003ce89b0dd5aeacf45b3901459abfa7.yml
openapi_spec_hash: 130cf273e4489beb3b7e2922f1ff26ae
config_hash: 8bd51a43d85b7a841080e78e6f673b63
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
# Changelog

## 5.16.0 (2026-08-20)

Full Changelog: [v5.15.0...v5.16.0](https://github.com/runwayml/sdk-python/compare/v5.15.0...v5.16.0)

### Features

* **api:** stlc build onto staging next ([7449a94](https://github.com/runwayml/sdk-python/commit/7449a949278146acc7e9a3780a4aaa1ee2f6f205))


### Bug Fixes

* **client:** drop duplicate generate/routers properties ([499c3c8](https://github.com/runwayml/sdk-python/commit/499c3c8f1c8ad3ef1033d55c8b7128c96c1e4cef))
* **client:** restore Client/AsyncClient aliases ([a45e3af](https://github.com/runwayml/sdk-python/commit/a45e3aff6bf892cf442b0ba78a5e8f846bdf6d2e))


### Chores

* **internal:** allow the mock server port to be set with STAINLESS_MOCK_PORT ([4046920](https://github.com/runwayml/sdk-python/commit/40469209ce682ca9a70b9f9eda52a8c0843c5764))
* local reseal after client.uploads + generate/routers fix ([3929658](https://github.com/runwayml/sdk-python/commit/3929658bd55493e866cde357c26f399aa2b24e48))


### Documentation

* expand 5.15.0 changelog with customer-facing API surface ([dca7f1b](https://github.com/runwayml/sdk-python/commit/dca7f1beb9b76c96be39ff3aec10eae586baf451))

## 5.15.0 (2026-08-18)

Full Changelog: [v5.14.0...v5.15.0](https://github.com/runwayml/sdk-python/compare/v5.14.0...v5.15.0)

### Features

* **api:** Seedance 2.5 1080p, Grok Imagine Video 1.5, Grok Imagine Image 2 ([46f53db](https://github.com/runwayml/sdk-python/commit/46f53dbc5ea2a643bacaf4a702974c5baebd45a0))
* **api:** add 1080p on seedance2_5 (text/image/video-to-video) ([46f53db](https://github.com/runwayml/sdk-python/commit/46f53dbc5ea2a643bacaf4a702974c5baebd45a0))
* **api:** add grok_imagine_1_5 (text/image-to-video) ([46f53db](https://github.com/runwayml/sdk-python/commit/46f53dbc5ea2a643bacaf4a702974c5baebd45a0))
* **api:** add grok_imagine_image_2 (text-to-image) ([46f53db](https://github.com/runwayml/sdk-python/commit/46f53dbc5ea2a643bacaf4a702974c5baebd45a0))


### Bug Fixes
Expand Down
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ

Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.

from datetime import datetime

## Pagination

List methods in the RunwayML API are paginated.
Expand All @@ -132,14 +134,16 @@ from runwayml import RunwayML

client = RunwayML()

all_routers = []
all_webapps = []
# Automatically fetches more pages as needed.
for router in client.routers.list(
for webapp in client.organization.webapp.list_usage(
from_=datetime.fromisoformat("2019-12-27T18:11:19.117"),
limit=1,
to=datetime.fromisoformat("2019-12-27T18:11:19.117"),
):
# Do something with router here
all_routers.append(router)
print(all_routers)
# Do something with webapp here
all_webapps.append(webapp)
print(all_webapps)
```

Or, asynchronously:
Expand All @@ -152,13 +156,15 @@ client = AsyncRunwayML()


async def main() -> None:
all_routers = []
all_webapps = []
# Iterate through items across all pages, issuing requests as needed.
async for router in client.routers.list(
async for webapp in client.organization.webapp.list_usage(
from_=datetime.fromisoformat("2019-12-27T18:11:19.117"),
limit=1,
to=datetime.fromisoformat("2019-12-27T18:11:19.117"),
):
all_routers.append(router)
print(all_routers)
all_webapps.append(webapp)
print(all_webapps)


asyncio.run(main())
Expand All @@ -167,8 +173,10 @@ asyncio.run(main())
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:

```python
first_page = await client.routers.list(
first_page = await client.organization.webapp.list_usage(
from_=datetime.fromisoformat("2019-12-27T18:11:19.117"),
limit=1,
to=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)
if first_page.has_next_page():
print(f"will fetch next page using these details: {first_page.next_page_info()}")
Expand All @@ -181,13 +189,15 @@ if first_page.has_next_page():
Or just work directly with the returned data:

```python
first_page = await client.routers.list(
first_page = await client.organization.webapp.list_usage(
from_=datetime.fromisoformat("2019-12-27T18:11:19.117"),
limit=1,
to=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)

print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
for router in first_page.data:
print(router.id)
for webapp in first_page.data:
print(webapp.credits)

# Remove `await` for non-async usage.
```
Expand All @@ -201,13 +211,15 @@ from runwayml import RunwayML

client = RunwayML()

text_to_image = client.text_to_image.create(
image_to_video = client.image_to_video.create(
duration=2,
model="gen4_image",
prompt_text="promptText",
ratio="1920:1080",
model="gen4.5",
prompt_image="https://example.com/image.jpg",
prompt_text="x",
ratio="1280:720",
content_moderation={},
)
print(text_to_image.id)
print(image_to_video.content_moderation)
```

## Handling errors
Expand Down
61 changes: 61 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,64 @@ from runwayml.types import WorkflowInvocationRetrieveResponse
Methods:

- <code title="get /v1/workflow_invocations/{id}">client.workflow_invocations.<a href="./src/runwayml/resources/workflow_invocations.py">retrieve</a>(id) -> <a href="./src/runwayml/types/workflow_invocation_retrieve_response.py">WorkflowInvocationRetrieveResponse</a></code>

# Generate

## Video

Types:

```python
from runwayml.types.generate import VideoCreateResponse
```

Methods:

- <code title="post /v1/generate/video">client.generate.video.<a href="./src/runwayml/resources/generate/video.py">create</a>(\*\*<a href="src/runwayml/types/generate/video_create_params.py">params</a>) -> <a href="./src/runwayml/types/generate/video_create_response.py">VideoCreateResponse</a></code>

## Image

Types:

```python
from runwayml.types.generate import ImageCreateResponse
```

Methods:

- <code title="post /v1/generate/image">client.generate.image.<a href="./src/runwayml/resources/generate/image.py">create</a>(\*\*<a href="src/runwayml/types/generate/image_create_params.py">params</a>) -> <a href="./src/runwayml/types/generate/image_create_response.py">ImageCreateResponse</a></code>

## Audio

Types:

```python
from runwayml.types.generate import ReferenceVoice, ReferenceAudio, AudioCreateResponse
```

Methods:

- <code title="post /v1/generate/audio">client.generate.audio.<a href="./src/runwayml/resources/generate/audio.py">create</a>(\*\*<a href="src/runwayml/types/generate/audio_create_params.py">params</a>) -> <a href="./src/runwayml/types/generate/audio_create_response.py">AudioCreateResponse</a></code>

# Routers

Types:

```python
from runwayml.types import (
RouterCreateResponse,
RouterRetrieveResponse,
RouterUpdateResponse,
RouterListResponse,
RouterListRequestsResponse,
)
```

Methods:

- <code title="post /v1/routers">client.routers.<a href="./src/runwayml/resources/routers.py">create</a>(\*\*<a href="src/runwayml/types/router_create_params.py">params</a>) -> <a href="./src/runwayml/types/router_create_response.py">RouterCreateResponse</a></code>
- <code title="get /v1/routers/{id}">client.routers.<a href="./src/runwayml/resources/routers.py">retrieve</a>(id) -> <a href="./src/runwayml/types/router_retrieve_response.py">RouterRetrieveResponse</a></code>
- <code title="patch /v1/routers/{id}">client.routers.<a href="./src/runwayml/resources/routers.py">update</a>(id, \*\*<a href="src/runwayml/types/router_update_params.py">params</a>) -> <a href="./src/runwayml/types/router_update_response.py">RouterUpdateResponse</a></code>
- <code title="get /v1/routers">client.routers.<a href="./src/runwayml/resources/routers.py">list</a>(\*\*<a href="src/runwayml/types/router_list_params.py">params</a>) -> <a href="./src/runwayml/types/router_list_response.py">SyncCursorPage[RouterListResponse]</a></code>
- <code title="delete /v1/routers/{id}">client.routers.<a href="./src/runwayml/resources/routers.py">delete</a>(id) -> None</code>
- <code title="get /v1/routers/{id}/requests">client.routers.<a href="./src/runwayml/resources/routers.py">list_requests</a>(id, \*\*<a href="src/runwayml/types/router_list_requests_params.py">params</a>) -> <a href="./src/runwayml/types/router_list_requests_response.py">SyncCursorPage[RouterListRequestsResponse]</a></code>
4 changes: 4 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

errors=()

if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
fi

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runwayml"
version = "5.15.0"
version = "5.16.0"
description = "The official Python library for the runwayml API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
Expand Down
15 changes: 8 additions & 7 deletions scripts/mock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/runwayml/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runwayml"
__version__ = "5.15.0" # x-release-please-version
__version__ = "5.16.0" # x-release-please-version
Loading
Loading