Skip to content
Merged
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
30 changes: 29 additions & 1 deletion .sdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "102269bb-de21-44c1-a841-98323dccb754",
"id": "4cb2c833-ef6d-45d1-949f-40dea5e812de",
"tracked_paths": [
{
"editable": true,
Expand Down Expand Up @@ -405,6 +405,18 @@
"editable": true,
"path": "magic_hour/resources/v1/photo_colorizer/client.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/saved_items/README.md"
},
{
"editable": true,
"path": "magic_hour/resources/v1/saved_items/__init__.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/saved_items/client.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/text_to_video/README.md"
Expand Down Expand Up @@ -605,6 +617,18 @@
"editable": false,
"path": "magic_hour/types/models/v1_photo_colorizer_create_response.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_saved_items_list_response.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_saved_items_list_response_items_item.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_saved_items_list_response_items_item_assets_item.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_text_to_video_create_response.py"
Expand Down Expand Up @@ -1065,6 +1089,10 @@
"editable": false,
"path": "tests/test_v1_photo_colorizer_client.py"
},
{
"editable": false,
"path": "tests/test_v1_saved_items_client.py"
},
{
"editable": false,
"path": "tests/test_v1_text_to_video_client.py"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ download_urls = result.downloads
- [create](magic_hour/resources/v1/photo_colorizer/README.md#create) - Photo Colorizer
- [generate](magic_hour/resources/v1/photo_colorizer/README.md#generate) - Photo Colorizer Generate Workflow

### [v1.saved_items](magic_hour/resources/v1/saved_items/README.md)

- [list](magic_hour/resources/v1/saved_items/README.md#list) - List saved items

### [v1.text_to_video](magic_hour/resources/v1/text_to_video/README.md)

- [create](magic_hour/resources/v1/text_to_video/README.md#create) - Text-to-Video
Expand Down
1 change: 1 addition & 0 deletions magic_hour/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [image_to_video](resources/v1/image_to_video/README.md) - image_to_video
- [lip_sync](resources/v1/lip_sync/README.md) - lip_sync
- [photo_colorizer](resources/v1/photo_colorizer/README.md) - photo_colorizer
- [saved_items](resources/v1/saved_items/README.md) - saved_items
- [text_to_video](resources/v1/text_to_video/README.md) - text_to_video
- [video_projects](resources/v1/video_projects/README.md) - video_projects
- [video_to_video](resources/v1/video_to_video/README.md) - video_to_video
Expand Down
2 changes: 1 addition & 1 deletion magic_hour/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Environment(enum.Enum):
"""Pre-defined base URLs for the API"""

ENVIRONMENT = "https://api.magichour.ai"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.81.1"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.82.0"


def _get_base_url(
Expand Down
1 change: 1 addition & 0 deletions magic_hour/resources/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [image_to_video](image_to_video/README.md) - image_to_video
- [lip_sync](lip_sync/README.md) - lip_sync
- [photo_colorizer](photo_colorizer/README.md) - photo_colorizer
- [saved_items](saved_items/README.md) - saved_items
- [text_to_video](text_to_video/README.md) - text_to_video
- [video_projects](video_projects/README.md) - video_projects
- [video_to_video](video_to_video/README.md) - video_to_video
3 changes: 3 additions & 0 deletions magic_hour/resources/v1/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
AsyncPhotoColorizerClient,
PhotoColorizerClient,
)
from magic_hour.resources.v1.saved_items import AsyncSavedItemsClient, SavedItemsClient
from magic_hour.resources.v1.text_to_video import (
AsyncTextToVideoClient,
TextToVideoClient,
Expand Down Expand Up @@ -157,6 +158,7 @@ def __init__(self, *, base_client: SyncBaseClient):
self.ai_video_editor = AiVideoEditorClient(base_client=self._base_client)
self.character_replace = CharacterReplaceClient(base_client=self._base_client)
self.account = AccountClient(base_client=self._base_client)
self.saved_items = SavedItemsClient(base_client=self._base_client)


class AsyncV1Client:
Expand Down Expand Up @@ -216,3 +218,4 @@ def __init__(self, *, base_client: AsyncBaseClient):
base_client=self._base_client
)
self.account = AsyncAccountClient(base_client=self._base_client)
self.saved_items = AsyncSavedItemsClient(base_client=self._base_client)
32 changes: 16 additions & 16 deletions magic_hour/resources/v1/image_to_video/README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions magic_hour/resources/v1/image_to_video/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def create(
"veo3.1-audio",
"veo3.1-lite",
"wan-2.2",
"wan-3.0",
]
],
type_utils.NotGiven,
Expand Down Expand Up @@ -234,6 +235,7 @@ def create(
* **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
* **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
* **`wan-2.2`**: Not supported
* **`wan-3.0`**: Toggle-able: no additional credits for audio

height: `height` is deprecated and no longer influences the output video's resolution.

Expand All @@ -255,6 +257,7 @@ def create(
* `veo3.1`: Best for romantic interactions and expressive action, with realistic detail.
* `veo3.1-lite`: Balanced realism and audio at a lower cost than Veo 3.1.
* `wan-2.2`: Best for physical motion, action, and camera movement.
* `wan-3.0`: High-quality video with native audio, long clips, and end-frame control.

If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`.
name: Give your video a custom name for easy identification.
Expand All @@ -274,6 +277,7 @@ def create(
* **`veo3.1`**: Supports 720p, 1080p.
* **`veo3.1-lite`**: Supports 720p, 1080p.
* **`wan-2.2`**: Supports 480p, 720p, 1080p.
* **`wan-3.0`**: Supports 480p, 720p, 1080p.

style: Attributed used to dictate the style of the output
width: `width` is deprecated and no longer influences the output video's resolution.
Expand All @@ -296,6 +300,7 @@ def create(
* **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
* **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
* **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15
* **`wan-3.0`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30

request_options: Additional options to customize the HTTP request

Expand Down Expand Up @@ -491,6 +496,7 @@ async def create(
"veo3.1-audio",
"veo3.1-lite",
"wan-2.2",
"wan-3.0",
]
],
type_utils.NotGiven,
Expand Down Expand Up @@ -558,6 +564,7 @@ async def create(
* **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
* **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
* **`wan-2.2`**: Not supported
* **`wan-3.0`**: Toggle-able: no additional credits for audio

height: `height` is deprecated and no longer influences the output video's resolution.

Expand All @@ -579,6 +586,7 @@ async def create(
* `veo3.1`: Best for romantic interactions and expressive action, with realistic detail.
* `veo3.1-lite`: Balanced realism and audio at a lower cost than Veo 3.1.
* `wan-2.2`: Best for physical motion, action, and camera movement.
* `wan-3.0`: High-quality video with native audio, long clips, and end-frame control.

If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`.
name: Give your video a custom name for easy identification.
Expand All @@ -598,6 +606,7 @@ async def create(
* **`veo3.1`**: Supports 720p, 1080p.
* **`veo3.1-lite`**: Supports 720p, 1080p.
* **`wan-2.2`**: Supports 480p, 720p, 1080p.
* **`wan-3.0`**: Supports 480p, 720p, 1080p.

style: Attributed used to dictate the style of the output
width: `width` is deprecated and no longer influences the output video's resolution.
Expand All @@ -620,6 +629,7 @@ async def create(
* **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
* **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
* **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15
* **`wan-3.0`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30

request_options: Additional options to customize the HTTP request

Expand Down
49 changes: 49 additions & 0 deletions magic_hour/resources/v1/saved_items/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# v1.saved_items

## Module Functions

### List saved items <a name="list"></a>

Returns active saved items owned by the authenticated account, newest first. Each item includes every saved asset with a durable file_path for reuse in compatible generation APIs and a temporary signed URL for previewing or downloading. Filter by type to find characters, references, voices, moodboards, or brand kits. To fetch the next page, pass the response's next_cursor as cursor.

**API Endpoint**: `GET /v1/saved-items`

#### Parameters

| Parameter | Required | Description | Example |
| --------- | :------: | ------------------------------------------------------------------ | ------------- |
| `cursor` | ✗ | Opaque pagination cursor from the previous response's next_cursor. | `"string"` |
| `limit` | ✗ | Maximum number of saved items to return. Defaults to 20. | `20` |
| `type_` | ✗ | Only return saved items of this type. | `"character"` |

#### Synchronous Client

```python
from magic_hour import Client
from os import getenv

client = Client(token=getenv("API_TOKEN"))
res = client.v1.saved_items.list(limit=20, type_="character")
```

#### Asynchronous Client

```python
from magic_hour import AsyncClient
from os import getenv

client = AsyncClient(token=getenv("API_TOKEN"))
res = await client.v1.saved_items.list(limit=20, type_="character")
```

#### Response

##### Type

[V1SavedItemsListResponse](/magic_hour/types/models/v1_saved_items_list_response.py)

##### Example

```python
{"items": [{"assets": [{"file_path": "saved-items/user-id/item-id/image.png", "is_primary": True, "media_kind": "IMAGE", "url": "http://www.example.com", "url_expires_at": "2026-09-17T00:00:00.000Z"}], "id": "cuid-example", "name": "Alex", "type_": "character"}], "next_cursor": "string"}
```
4 changes: 4 additions & 0 deletions magic_hour/resources/v1/saved_items/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .client import AsyncSavedItemsClient, SavedItemsClient


__all__ = ["AsyncSavedItemsClient", "SavedItemsClient"]
Loading
Loading