runwayml 3.6.5__tar.gz → 3.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. runwayml-3.7.0/.release-please-manifest.json +3 -0
  2. {runwayml-3.6.5 → runwayml-3.7.0}/CHANGELOG.md +15 -0
  3. {runwayml-3.6.5 → runwayml-3.7.0}/PKG-INFO +2 -3
  4. {runwayml-3.6.5 → runwayml-3.7.0}/README.md +1 -2
  5. {runwayml-3.6.5 → runwayml-3.7.0}/api.md +14 -1
  6. {runwayml-3.6.5 → runwayml-3.7.0}/examples/generate_image.py +1 -1
  7. {runwayml-3.6.5 → runwayml-3.7.0}/pyproject.toml +1 -1
  8. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_client.py +17 -1
  9. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_version.py +1 -1
  10. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/__init__.py +14 -0
  11. runwayml-3.7.0/src/runwayml/resources/character_performance.py +251 -0
  12. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/organization.py +116 -0
  13. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/__init__.py +6 -0
  14. runwayml-3.7.0/src/runwayml/types/character_performance_create_params.py +103 -0
  15. runwayml-3.7.0/src/runwayml/types/character_performance_create_response.py +10 -0
  16. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/organization_retrieve_response.py +21 -0
  17. runwayml-3.7.0/src/runwayml/types/organization_retrieve_usage_params.py +27 -0
  18. runwayml-3.7.0/src/runwayml/types/organization_retrieve_usage_response.py +37 -0
  19. runwayml-3.7.0/tests/api_resources/test_character_performance.py +180 -0
  20. runwayml-3.7.0/tests/api_resources/test_organization.py +144 -0
  21. runwayml-3.6.5/.release-please-manifest.json +0 -3
  22. runwayml-3.6.5/tests/api_resources/test_organization.py +0 -74
  23. {runwayml-3.6.5 → runwayml-3.7.0}/.gitignore +0 -0
  24. {runwayml-3.6.5 → runwayml-3.7.0}/CONTRIBUTING.md +0 -0
  25. {runwayml-3.6.5 → runwayml-3.7.0}/LICENSE +0 -0
  26. {runwayml-3.6.5 → runwayml-3.7.0}/SECURITY.md +0 -0
  27. {runwayml-3.6.5 → runwayml-3.7.0}/bin/check-release-environment +0 -0
  28. {runwayml-3.6.5 → runwayml-3.7.0}/bin/publish-pypi +0 -0
  29. {runwayml-3.6.5 → runwayml-3.7.0}/examples/.keep +0 -0
  30. {runwayml-3.6.5 → runwayml-3.7.0}/mypy.ini +0 -0
  31. {runwayml-3.6.5 → runwayml-3.7.0}/noxfile.py +0 -0
  32. {runwayml-3.6.5 → runwayml-3.7.0}/release-please-config.json +0 -0
  33. {runwayml-3.6.5 → runwayml-3.7.0}/requirements-dev.lock +0 -0
  34. {runwayml-3.6.5 → runwayml-3.7.0}/requirements.lock +0 -0
  35. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/__init__.py +0 -0
  36. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_base_client.py +0 -0
  37. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_compat.py +0 -0
  38. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_constants.py +0 -0
  39. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_exceptions.py +0 -0
  40. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_files.py +0 -0
  41. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_models.py +0 -0
  42. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_qs.py +0 -0
  43. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_resource.py +0 -0
  44. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_response.py +0 -0
  45. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_streaming.py +0 -0
  46. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_types.py +0 -0
  47. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/__init__.py +0 -0
  48. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_logs.py +0 -0
  49. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_proxy.py +0 -0
  50. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_reflection.py +0 -0
  51. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_resources_proxy.py +0 -0
  52. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_streams.py +0 -0
  53. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_sync.py +0 -0
  54. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_transform.py +0 -0
  55. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_typing.py +0 -0
  56. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/_utils/_utils.py +0 -0
  57. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/lib/.keep +0 -0
  58. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/lib/polling.py +0 -0
  59. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/py.typed +0 -0
  60. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/image_to_video.py +0 -0
  61. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/tasks.py +0 -0
  62. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/text_to_image.py +0 -0
  63. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/resources/video_upscale.py +0 -0
  64. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/image_to_video_create_params.py +0 -0
  65. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/image_to_video_create_response.py +0 -0
  66. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/task_retrieve_response.py +0 -0
  67. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/text_to_image_create_params.py +0 -0
  68. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/text_to_image_create_response.py +0 -0
  69. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/video_upscale_create_params.py +0 -0
  70. {runwayml-3.6.5 → runwayml-3.7.0}/src/runwayml/types/video_upscale_create_response.py +0 -0
  71. {runwayml-3.6.5 → runwayml-3.7.0}/tests/__init__.py +0 -0
  72. {runwayml-3.6.5 → runwayml-3.7.0}/tests/api_resources/__init__.py +0 -0
  73. {runwayml-3.6.5 → runwayml-3.7.0}/tests/api_resources/test_image_to_video.py +0 -0
  74. {runwayml-3.6.5 → runwayml-3.7.0}/tests/api_resources/test_tasks.py +0 -0
  75. {runwayml-3.6.5 → runwayml-3.7.0}/tests/api_resources/test_text_to_image.py +0 -0
  76. {runwayml-3.6.5 → runwayml-3.7.0}/tests/api_resources/test_video_upscale.py +0 -0
  77. {runwayml-3.6.5 → runwayml-3.7.0}/tests/conftest.py +0 -0
  78. {runwayml-3.6.5 → runwayml-3.7.0}/tests/sample_file.txt +0 -0
  79. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_client.py +0 -0
  80. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_deepcopy.py +0 -0
  81. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_extract_files.py +0 -0
  82. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_files.py +0 -0
  83. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_models.py +0 -0
  84. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_qs.py +0 -0
  85. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_required_args.py +0 -0
  86. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_response.py +0 -0
  87. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_streaming.py +0 -0
  88. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_transform.py +0 -0
  89. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_utils/test_proxy.py +0 -0
  90. {runwayml-3.6.5 → runwayml-3.7.0}/tests/test_utils/test_typing.py +0 -0
  91. {runwayml-3.6.5 → runwayml-3.7.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.7.0"
3
+ }
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.0 (2025-07-19)
4
+
5
+ Full Changelog: [v3.6.5...v3.7.0](https://github.com/runwayml/sdk-python/compare/v3.6.5...v3.7.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Act Two, credit usage endpoints ([f1114e0](https://github.com/runwayml/sdk-python/commit/f1114e0be865f9e27e697dfcaeb5dc6c0be659ed))
10
+ * **api:** Awaitability on new resources ([7612c78](https://github.com/runwayml/sdk-python/commit/7612c78ee6f64969138685312c4a3d539191beb9))
11
+ * clean up environment call outs ([caa8eff](https://github.com/runwayml/sdk-python/commit/caa8eff7855430950fe4184c3db885e84a607d5f))
12
+
13
+
14
+ ### Chores
15
+
16
+ * **client:** lint ([d745891](https://github.com/runwayml/sdk-python/commit/d74589104c8a15d5ab4e87b1f4de4ec915210a3e))
17
+
3
18
  ## 3.6.5 (2025-07-12)
4
19
 
5
20
  Full Changelog: [v3.6.4...v3.6.5](https://github.com/runwayml/sdk-python/compare/v3.6.4...v3.6.5)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.6.5
3
+ Version: 3.7.0
4
4
  Summary: The official Python library for the runwayml API
5
5
  Project-URL: Homepage, https://github.com/runwayml/sdk-python
6
6
  Project-URL: Repository, https://github.com/runwayml/sdk-python
@@ -124,7 +124,6 @@ pip install runwayml[aiohttp]
124
124
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
125
125
 
126
126
  ```python
127
- import os
128
127
  import asyncio
129
128
  from runwayml import DefaultAioHttpClient
130
129
  from runwayml import AsyncRunwayML
@@ -132,7 +131,7 @@ from runwayml import AsyncRunwayML
132
131
 
133
132
  async def main() -> None:
134
133
  async with AsyncRunwayML(
135
- api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
134
+ api_key="My API Key",
136
135
  http_client=DefaultAioHttpClient(),
137
136
  ) as client:
138
137
  image_to_video = await client.image_to_video.create(
@@ -89,7 +89,6 @@ pip install runwayml[aiohttp]
89
89
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
90
90
 
91
91
  ```python
92
- import os
93
92
  import asyncio
94
93
  from runwayml import DefaultAioHttpClient
95
94
  from runwayml import AsyncRunwayML
@@ -97,7 +96,7 @@ from runwayml import AsyncRunwayML
97
96
 
98
97
  async def main() -> None:
99
98
  async with AsyncRunwayML(
100
- api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
99
+ api_key="My API Key",
101
100
  http_client=DefaultAioHttpClient(),
102
101
  ) as client:
103
102
  image_to_video = await client.image_to_video.create(
@@ -47,14 +47,27 @@ Methods:
47
47
 
48
48
  - <code title="post /v1/video_upscale">client.video_upscale.<a href="./src/runwayml/resources/video_upscale.py">create</a>(\*\*<a href="src/runwayml/types/video_upscale_create_params.py">params</a>) -> <a href="./src/runwayml/types/video_upscale_create_response.py">VideoUpscaleCreateResponse</a></code>
49
49
 
50
+ # CharacterPerformance
51
+
52
+ Types:
53
+
54
+ ```python
55
+ from runwayml.types import CharacterPerformanceCreateResponse
56
+ ```
57
+
58
+ Methods:
59
+
60
+ - <code title="post /v1/character_performance">client.character_performance.<a href="./src/runwayml/resources/character_performance.py">create</a>(\*\*<a href="src/runwayml/types/character_performance_create_params.py">params</a>) -> <a href="./src/runwayml/types/character_performance_create_response.py">CharacterPerformanceCreateResponse</a></code>
61
+
50
62
  # Organization
51
63
 
52
64
  Types:
53
65
 
54
66
  ```python
55
- from runwayml.types import OrganizationRetrieveResponse
67
+ from runwayml.types import OrganizationRetrieveResponse, OrganizationRetrieveUsageResponse
56
68
  ```
57
69
 
58
70
  Methods:
59
71
 
60
72
  - <code title="get /v1/organization">client.organization.<a href="./src/runwayml/resources/organization.py">retrieve</a>() -> <a href="./src/runwayml/types/organization_retrieve_response.py">OrganizationRetrieveResponse</a></code>
73
+ - <code title="post /v1/organization/usage">client.organization.<a href="./src/runwayml/resources/organization.py">retrieve_usage</a>(\*\*<a href="src/runwayml/types/organization_retrieve_usage_params.py">params</a>) -> <a href="./src/runwayml/types/organization_retrieve_usage_response.py">OrganizationRetrieveUsageResponse</a></code>
@@ -10,7 +10,7 @@ image_task = client.text_to_image.create(
10
10
  try:
11
11
  output = image_task.wait_for_task_output()
12
12
  except TaskFailedError as e:
13
- print('The image failed to generate.')
13
+ print("The image failed to generate.")
14
14
  print(e.task_details)
15
15
  else:
16
16
  print(output.output[0]) # type: ignore
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runwayml"
3
- version = "3.6.5"
3
+ version = "3.7.0"
4
4
  description = "The official Python library for the runwayml API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -21,7 +21,7 @@ from ._types import (
21
21
  )
22
22
  from ._utils import is_given, get_async_library
23
23
  from ._version import __version__
24
- from .resources import tasks, organization, text_to_image, video_upscale, image_to_video
24
+ from .resources import tasks, organization, text_to_image, video_upscale, image_to_video, character_performance
25
25
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
26
26
  from ._exceptions import RunwayMLError, APIStatusError
27
27
  from ._base_client import (
@@ -47,6 +47,7 @@ class RunwayML(SyncAPIClient):
47
47
  image_to_video: image_to_video.ImageToVideoResource
48
48
  text_to_image: text_to_image.TextToImageResource
49
49
  video_upscale: video_upscale.VideoUpscaleResource
50
+ character_performance: character_performance.CharacterPerformanceResource
50
51
  organization: organization.OrganizationResource
51
52
  with_raw_response: RunwayMLWithRawResponse
52
53
  with_streaming_response: RunwayMLWithStreamedResponse
@@ -115,6 +116,7 @@ class RunwayML(SyncAPIClient):
115
116
  self.image_to_video = image_to_video.ImageToVideoResource(self)
116
117
  self.text_to_image = text_to_image.TextToImageResource(self)
117
118
  self.video_upscale = video_upscale.VideoUpscaleResource(self)
119
+ self.character_performance = character_performance.CharacterPerformanceResource(self)
118
120
  self.organization = organization.OrganizationResource(self)
119
121
  self.with_raw_response = RunwayMLWithRawResponse(self)
120
122
  self.with_streaming_response = RunwayMLWithStreamedResponse(self)
@@ -232,6 +234,7 @@ class AsyncRunwayML(AsyncAPIClient):
232
234
  image_to_video: image_to_video.AsyncImageToVideoResource
233
235
  text_to_image: text_to_image.AsyncTextToImageResource
234
236
  video_upscale: video_upscale.AsyncVideoUpscaleResource
237
+ character_performance: character_performance.AsyncCharacterPerformanceResource
235
238
  organization: organization.AsyncOrganizationResource
236
239
  with_raw_response: AsyncRunwayMLWithRawResponse
237
240
  with_streaming_response: AsyncRunwayMLWithStreamedResponse
@@ -300,6 +303,7 @@ class AsyncRunwayML(AsyncAPIClient):
300
303
  self.image_to_video = image_to_video.AsyncImageToVideoResource(self)
301
304
  self.text_to_image = text_to_image.AsyncTextToImageResource(self)
302
305
  self.video_upscale = video_upscale.AsyncVideoUpscaleResource(self)
306
+ self.character_performance = character_performance.AsyncCharacterPerformanceResource(self)
303
307
  self.organization = organization.AsyncOrganizationResource(self)
304
308
  self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
305
309
  self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)
@@ -418,6 +422,9 @@ class RunwayMLWithRawResponse:
418
422
  self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
419
423
  self.text_to_image = text_to_image.TextToImageResourceWithRawResponse(client.text_to_image)
420
424
  self.video_upscale = video_upscale.VideoUpscaleResourceWithRawResponse(client.video_upscale)
425
+ self.character_performance = character_performance.CharacterPerformanceResourceWithRawResponse(
426
+ client.character_performance
427
+ )
421
428
  self.organization = organization.OrganizationResourceWithRawResponse(client.organization)
422
429
 
423
430
 
@@ -427,6 +434,9 @@ class AsyncRunwayMLWithRawResponse:
427
434
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
428
435
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithRawResponse(client.text_to_image)
429
436
  self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithRawResponse(client.video_upscale)
437
+ self.character_performance = character_performance.AsyncCharacterPerformanceResourceWithRawResponse(
438
+ client.character_performance
439
+ )
430
440
  self.organization = organization.AsyncOrganizationResourceWithRawResponse(client.organization)
431
441
 
432
442
 
@@ -436,6 +446,9 @@ class RunwayMLWithStreamedResponse:
436
446
  self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
437
447
  self.text_to_image = text_to_image.TextToImageResourceWithStreamingResponse(client.text_to_image)
438
448
  self.video_upscale = video_upscale.VideoUpscaleResourceWithStreamingResponse(client.video_upscale)
449
+ self.character_performance = character_performance.CharacterPerformanceResourceWithStreamingResponse(
450
+ client.character_performance
451
+ )
439
452
  self.organization = organization.OrganizationResourceWithStreamingResponse(client.organization)
440
453
 
441
454
 
@@ -445,6 +458,9 @@ class AsyncRunwayMLWithStreamedResponse:
445
458
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
446
459
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithStreamingResponse(client.text_to_image)
447
460
  self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithStreamingResponse(client.video_upscale)
461
+ self.character_performance = character_performance.AsyncCharacterPerformanceResourceWithStreamingResponse(
462
+ client.character_performance
463
+ )
448
464
  self.organization = organization.AsyncOrganizationResourceWithStreamingResponse(client.organization)
449
465
 
450
466
 
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "runwayml"
4
- __version__ = "3.6.5" # x-release-please-version
4
+ __version__ = "3.7.0" # x-release-please-version
@@ -40,6 +40,14 @@ from .image_to_video import (
40
40
  ImageToVideoResourceWithStreamingResponse,
41
41
  AsyncImageToVideoResourceWithStreamingResponse,
42
42
  )
43
+ from .character_performance import (
44
+ CharacterPerformanceResource,
45
+ AsyncCharacterPerformanceResource,
46
+ CharacterPerformanceResourceWithRawResponse,
47
+ AsyncCharacterPerformanceResourceWithRawResponse,
48
+ CharacterPerformanceResourceWithStreamingResponse,
49
+ AsyncCharacterPerformanceResourceWithStreamingResponse,
50
+ )
43
51
 
44
52
  __all__ = [
45
53
  "TasksResource",
@@ -66,6 +74,12 @@ __all__ = [
66
74
  "AsyncVideoUpscaleResourceWithRawResponse",
67
75
  "VideoUpscaleResourceWithStreamingResponse",
68
76
  "AsyncVideoUpscaleResourceWithStreamingResponse",
77
+ "CharacterPerformanceResource",
78
+ "AsyncCharacterPerformanceResource",
79
+ "CharacterPerformanceResourceWithRawResponse",
80
+ "AsyncCharacterPerformanceResourceWithRawResponse",
81
+ "CharacterPerformanceResourceWithStreamingResponse",
82
+ "AsyncCharacterPerformanceResourceWithStreamingResponse",
69
83
  "OrganizationResource",
70
84
  "AsyncOrganizationResource",
71
85
  "OrganizationResourceWithRawResponse",
@@ -0,0 +1,251 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal
6
+
7
+ import httpx
8
+
9
+ from ..types import character_performance_create_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from ..lib.polling import (
21
+ NewTaskCreatedResponse,
22
+ AsyncNewTaskCreatedResponse,
23
+ create_waitable_resource,
24
+ create_async_waitable_resource,
25
+ )
26
+ from .._base_client import make_request_options
27
+ from ..types.character_performance_create_response import CharacterPerformanceCreateResponse
28
+
29
+ __all__ = ["CharacterPerformanceResource", "AsyncCharacterPerformanceResource"]
30
+
31
+
32
+ class CharacterPerformanceResource(SyncAPIResource):
33
+ @cached_property
34
+ def with_raw_response(self) -> CharacterPerformanceResourceWithRawResponse:
35
+ """
36
+ This property can be used as a prefix for any HTTP method call to return
37
+ the raw response object instead of the parsed content.
38
+
39
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
40
+ """
41
+ return CharacterPerformanceResourceWithRawResponse(self)
42
+
43
+ @cached_property
44
+ def with_streaming_response(self) -> CharacterPerformanceResourceWithStreamingResponse:
45
+ """
46
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
47
+
48
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
49
+ """
50
+ return CharacterPerformanceResourceWithStreamingResponse(self)
51
+
52
+ def create(
53
+ self,
54
+ *,
55
+ character: character_performance_create_params.Character,
56
+ model: Literal["act_two"],
57
+ ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
58
+ reference: character_performance_create_params.Reference,
59
+ body_control: bool | NotGiven = NOT_GIVEN,
60
+ content_moderation: character_performance_create_params.ContentModeration | NotGiven = NOT_GIVEN,
61
+ expression_intensity: int | NotGiven = NOT_GIVEN,
62
+ seed: int | NotGiven = NOT_GIVEN,
63
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
64
+ # The extra values given here take precedence over values defined on the client or passed to this method.
65
+ extra_headers: Headers | None = None,
66
+ extra_query: Query | None = None,
67
+ extra_body: Body | None = None,
68
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
69
+ ) -> NewTaskCreatedResponse:
70
+ """
71
+ This endpoint will start a new task to control a character's facial expressions
72
+ and body movements using a reference video.
73
+
74
+ Args:
75
+ character: The character to control. You can either provide a video or an image. A visually
76
+ recognizable face must be visible and stay within the frame.
77
+
78
+ model: The model variant to use.
79
+
80
+ ratio: The resolution of the output video.
81
+
82
+ body_control: A boolean indicating whether to enable body control. When enabled, non-facial
83
+ movements and gestures will be applied to the character in addition to facial
84
+ expressions.
85
+
86
+ content_moderation: Settings that affect the behavior of the content moderation system.
87
+
88
+ expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
89
+ of the character's expression.
90
+
91
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
92
+ get different results for the same other request parameters. Using the same seed
93
+ integer for an identical request will produce similar results.
94
+
95
+ extra_headers: Send extra headers
96
+
97
+ extra_query: Add additional query parameters to the request
98
+
99
+ extra_body: Add additional JSON properties to the request
100
+
101
+ timeout: Override the client-level default timeout for this request, in seconds
102
+ """
103
+ return self._post(
104
+ "/v1/character_performance",
105
+ body=maybe_transform(
106
+ {
107
+ "character": character,
108
+ "model": model,
109
+ "ratio": ratio,
110
+ "reference": reference,
111
+ "body_control": body_control,
112
+ "content_moderation": content_moderation,
113
+ "expression_intensity": expression_intensity,
114
+ "seed": seed,
115
+ },
116
+ character_performance_create_params.CharacterPerformanceCreateParams,
117
+ ),
118
+ options=make_request_options(
119
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
120
+ ),
121
+ cast_to=create_waitable_resource(CharacterPerformanceCreateResponse, self._client),
122
+ )
123
+
124
+
125
+ class AsyncCharacterPerformanceResource(AsyncAPIResource):
126
+ @cached_property
127
+ def with_raw_response(self) -> AsyncCharacterPerformanceResourceWithRawResponse:
128
+ """
129
+ This property can be used as a prefix for any HTTP method call to return
130
+ the raw response object instead of the parsed content.
131
+
132
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
133
+ """
134
+ return AsyncCharacterPerformanceResourceWithRawResponse(self)
135
+
136
+ @cached_property
137
+ def with_streaming_response(self) -> AsyncCharacterPerformanceResourceWithStreamingResponse:
138
+ """
139
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
140
+
141
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
142
+ """
143
+ return AsyncCharacterPerformanceResourceWithStreamingResponse(self)
144
+
145
+ async def create(
146
+ self,
147
+ *,
148
+ character: character_performance_create_params.Character,
149
+ model: Literal["act_two"],
150
+ ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
151
+ reference: character_performance_create_params.Reference,
152
+ body_control: bool | NotGiven = NOT_GIVEN,
153
+ content_moderation: character_performance_create_params.ContentModeration | NotGiven = NOT_GIVEN,
154
+ expression_intensity: int | NotGiven = NOT_GIVEN,
155
+ seed: int | NotGiven = NOT_GIVEN,
156
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157
+ # The extra values given here take precedence over values defined on the client or passed to this method.
158
+ extra_headers: Headers | None = None,
159
+ extra_query: Query | None = None,
160
+ extra_body: Body | None = None,
161
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
162
+ ) -> AsyncNewTaskCreatedResponse:
163
+ """
164
+ This endpoint will start a new task to control a character's facial expressions
165
+ and body movements using a reference video.
166
+
167
+ Args:
168
+ character: The character to control. You can either provide a video or an image. A visually
169
+ recognizable face must be visible and stay within the frame.
170
+
171
+ model: The model variant to use.
172
+
173
+ ratio: The resolution of the output video.
174
+
175
+ body_control: A boolean indicating whether to enable body control. When enabled, non-facial
176
+ movements and gestures will be applied to the character in addition to facial
177
+ expressions.
178
+
179
+ content_moderation: Settings that affect the behavior of the content moderation system.
180
+
181
+ expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
182
+ of the character's expression.
183
+
184
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
185
+ get different results for the same other request parameters. Using the same seed
186
+ integer for an identical request will produce similar results.
187
+
188
+ extra_headers: Send extra headers
189
+
190
+ extra_query: Add additional query parameters to the request
191
+
192
+ extra_body: Add additional JSON properties to the request
193
+
194
+ timeout: Override the client-level default timeout for this request, in seconds
195
+ """
196
+ return await self._post(
197
+ "/v1/character_performance",
198
+ body=await async_maybe_transform(
199
+ {
200
+ "character": character,
201
+ "model": model,
202
+ "ratio": ratio,
203
+ "reference": reference,
204
+ "body_control": body_control,
205
+ "content_moderation": content_moderation,
206
+ "expression_intensity": expression_intensity,
207
+ "seed": seed,
208
+ },
209
+ character_performance_create_params.CharacterPerformanceCreateParams,
210
+ ),
211
+ options=make_request_options(
212
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
213
+ ),
214
+ cast_to=create_async_waitable_resource(CharacterPerformanceCreateResponse, self._client),
215
+ )
216
+
217
+
218
+ class CharacterPerformanceResourceWithRawResponse:
219
+ def __init__(self, character_performance: CharacterPerformanceResource) -> None:
220
+ self._character_performance = character_performance
221
+
222
+ self.create = to_raw_response_wrapper(
223
+ character_performance.create,
224
+ )
225
+
226
+
227
+ class AsyncCharacterPerformanceResourceWithRawResponse:
228
+ def __init__(self, character_performance: AsyncCharacterPerformanceResource) -> None:
229
+ self._character_performance = character_performance
230
+
231
+ self.create = async_to_raw_response_wrapper(
232
+ character_performance.create,
233
+ )
234
+
235
+
236
+ class CharacterPerformanceResourceWithStreamingResponse:
237
+ def __init__(self, character_performance: CharacterPerformanceResource) -> None:
238
+ self._character_performance = character_performance
239
+
240
+ self.create = to_streamed_response_wrapper(
241
+ character_performance.create,
242
+ )
243
+
244
+
245
+ class AsyncCharacterPerformanceResourceWithStreamingResponse:
246
+ def __init__(self, character_performance: AsyncCharacterPerformanceResource) -> None:
247
+ self._character_performance = character_performance
248
+
249
+ self.create = async_to_streamed_response_wrapper(
250
+ character_performance.create,
251
+ )
@@ -2,9 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Union
6
+ from datetime import date
7
+
5
8
  import httpx
6
9
 
10
+ from ..types import organization_retrieve_usage_params
7
11
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from .._utils import maybe_transform, async_maybe_transform
8
13
  from .._compat import cached_property
9
14
  from .._resource import SyncAPIResource, AsyncAPIResource
10
15
  from .._response import (
@@ -15,6 +20,7 @@ from .._response import (
15
20
  )
16
21
  from .._base_client import make_request_options
17
22
  from ..types.organization_retrieve_response import OrganizationRetrieveResponse
23
+ from ..types.organization_retrieve_usage_response import OrganizationRetrieveUsageResponse
18
24
 
19
25
  __all__ = ["OrganizationResource", "AsyncOrganizationResource"]
20
26
 
@@ -61,6 +67,55 @@ class OrganizationResource(SyncAPIResource):
61
67
  cast_to=OrganizationRetrieveResponse,
62
68
  )
63
69
 
70
+ def retrieve_usage(
71
+ self,
72
+ *,
73
+ before_date: Union[str, date] | NotGiven = NOT_GIVEN,
74
+ start_date: Union[str, date] | NotGiven = NOT_GIVEN,
75
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
76
+ # The extra values given here take precedence over values defined on the client or passed to this method.
77
+ extra_headers: Headers | None = None,
78
+ extra_query: Query | None = None,
79
+ extra_body: Body | None = None,
80
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
81
+ ) -> OrganizationRetrieveUsageResponse:
82
+ """
83
+ Fetch credit usage data broken down by model and day for the organization
84
+ associated with the API key used to make the request. Up to 90 days of data can
85
+ be queried at a time.
86
+
87
+ Args:
88
+ before_date: The end date of the usage data in ISO-8601 format (YYYY-MM-DD), not inclusive.
89
+ If unspecified, it will default to thirty days after the start date. Must be
90
+ less than or equal to 90 days after the start date. All dates are in UTC.
91
+
92
+ start_date: The start date of the usage data in ISO-8601 format (YYYY-MM-DD). If
93
+ unspecified, it will default to 30 days before the current date. All dates are
94
+ in UTC.
95
+
96
+ extra_headers: Send extra headers
97
+
98
+ extra_query: Add additional query parameters to the request
99
+
100
+ extra_body: Add additional JSON properties to the request
101
+
102
+ timeout: Override the client-level default timeout for this request, in seconds
103
+ """
104
+ return self._post(
105
+ "/v1/organization/usage",
106
+ body=maybe_transform(
107
+ {
108
+ "before_date": before_date,
109
+ "start_date": start_date,
110
+ },
111
+ organization_retrieve_usage_params.OrganizationRetrieveUsageParams,
112
+ ),
113
+ options=make_request_options(
114
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
115
+ ),
116
+ cast_to=OrganizationRetrieveUsageResponse,
117
+ )
118
+
64
119
 
65
120
  class AsyncOrganizationResource(AsyncAPIResource):
66
121
  @cached_property
@@ -104,6 +159,55 @@ class AsyncOrganizationResource(AsyncAPIResource):
104
159
  cast_to=OrganizationRetrieveResponse,
105
160
  )
106
161
 
162
+ async def retrieve_usage(
163
+ self,
164
+ *,
165
+ before_date: Union[str, date] | NotGiven = NOT_GIVEN,
166
+ start_date: Union[str, date] | NotGiven = NOT_GIVEN,
167
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
+ # The extra values given here take precedence over values defined on the client or passed to this method.
169
+ extra_headers: Headers | None = None,
170
+ extra_query: Query | None = None,
171
+ extra_body: Body | None = None,
172
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
173
+ ) -> OrganizationRetrieveUsageResponse:
174
+ """
175
+ Fetch credit usage data broken down by model and day for the organization
176
+ associated with the API key used to make the request. Up to 90 days of data can
177
+ be queried at a time.
178
+
179
+ Args:
180
+ before_date: The end date of the usage data in ISO-8601 format (YYYY-MM-DD), not inclusive.
181
+ If unspecified, it will default to thirty days after the start date. Must be
182
+ less than or equal to 90 days after the start date. All dates are in UTC.
183
+
184
+ start_date: The start date of the usage data in ISO-8601 format (YYYY-MM-DD). If
185
+ unspecified, it will default to 30 days before the current date. All dates are
186
+ in UTC.
187
+
188
+ extra_headers: Send extra headers
189
+
190
+ extra_query: Add additional query parameters to the request
191
+
192
+ extra_body: Add additional JSON properties to the request
193
+
194
+ timeout: Override the client-level default timeout for this request, in seconds
195
+ """
196
+ return await self._post(
197
+ "/v1/organization/usage",
198
+ body=await async_maybe_transform(
199
+ {
200
+ "before_date": before_date,
201
+ "start_date": start_date,
202
+ },
203
+ organization_retrieve_usage_params.OrganizationRetrieveUsageParams,
204
+ ),
205
+ options=make_request_options(
206
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
207
+ ),
208
+ cast_to=OrganizationRetrieveUsageResponse,
209
+ )
210
+
107
211
 
108
212
  class OrganizationResourceWithRawResponse:
109
213
  def __init__(self, organization: OrganizationResource) -> None:
@@ -112,6 +216,9 @@ class OrganizationResourceWithRawResponse:
112
216
  self.retrieve = to_raw_response_wrapper(
113
217
  organization.retrieve,
114
218
  )
219
+ self.retrieve_usage = to_raw_response_wrapper(
220
+ organization.retrieve_usage,
221
+ )
115
222
 
116
223
 
117
224
  class AsyncOrganizationResourceWithRawResponse:
@@ -121,6 +228,9 @@ class AsyncOrganizationResourceWithRawResponse:
121
228
  self.retrieve = async_to_raw_response_wrapper(
122
229
  organization.retrieve,
123
230
  )
231
+ self.retrieve_usage = async_to_raw_response_wrapper(
232
+ organization.retrieve_usage,
233
+ )
124
234
 
125
235
 
126
236
  class OrganizationResourceWithStreamingResponse:
@@ -130,6 +240,9 @@ class OrganizationResourceWithStreamingResponse:
130
240
  self.retrieve = to_streamed_response_wrapper(
131
241
  organization.retrieve,
132
242
  )
243
+ self.retrieve_usage = to_streamed_response_wrapper(
244
+ organization.retrieve_usage,
245
+ )
133
246
 
134
247
 
135
248
  class AsyncOrganizationResourceWithStreamingResponse:
@@ -139,3 +252,6 @@ class AsyncOrganizationResourceWithStreamingResponse:
139
252
  self.retrieve = async_to_streamed_response_wrapper(
140
253
  organization.retrieve,
141
254
  )
255
+ self.retrieve_usage = async_to_streamed_response_wrapper(
256
+ organization.retrieve_usage,
257
+ )
@@ -10,3 +10,9 @@ from .text_to_image_create_response import TextToImageCreateResponse as TextToIm
10
10
  from .video_upscale_create_response import VideoUpscaleCreateResponse as VideoUpscaleCreateResponse
11
11
  from .image_to_video_create_response import ImageToVideoCreateResponse as ImageToVideoCreateResponse
12
12
  from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse
13
+ from .organization_retrieve_usage_params import OrganizationRetrieveUsageParams as OrganizationRetrieveUsageParams
14
+ from .character_performance_create_params import CharacterPerformanceCreateParams as CharacterPerformanceCreateParams
15
+ from .organization_retrieve_usage_response import OrganizationRetrieveUsageResponse as OrganizationRetrieveUsageResponse
16
+ from .character_performance_create_response import (
17
+ CharacterPerformanceCreateResponse as CharacterPerformanceCreateResponse,
18
+ )