@runapi.ai/veo-3.1 0.1.0
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.
- package/LICENSE +201 -0
- package/README.md +43 -0
- package/dist/index.d.mts +159 -0
- package/dist/index.d.ts +159 -0
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +138 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +71 -0
- package/skills/veo-3.1/README.md +49 -0
- package/skills/veo-3.1/SKILL.md +20 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Veo API JavaScript SDK for RunAPI
|
|
2
|
+
|
|
3
|
+
The veo api JavaScript SDK is the language-specific package for Veo 3 on RunAPI. Use this veo api package for text-to-video, image-to-video, video-to-video, animation, and edit flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
|
|
4
|
+
|
|
5
|
+
This veo api README is the JavaScript package guide inside the public `veo3-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/veo-3.1; for API reference, use https://runapi.ai/docs#veo-3.1; for SDK docs, use https://runapi.ai/docs#sdk-veo-3.1.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @runapi.ai/veo3
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Veo3Client } from '@runapi.ai/veo3';
|
|
17
|
+
|
|
18
|
+
const client = new Veo3Client();
|
|
19
|
+
const task = await client.generations.create({
|
|
20
|
+
// Pass the Veo 3 JSON request body from https://runapi.ai/docs#veo-3.1.
|
|
21
|
+
});
|
|
22
|
+
const status = await client.generations.get(task.id);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
|
|
26
|
+
|
|
27
|
+
## Language notes
|
|
28
|
+
|
|
29
|
+
Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building video applications. The available resources include generations, extensions, hd1080p, and hd4k. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
|
|
30
|
+
|
|
31
|
+
## Links
|
|
32
|
+
|
|
33
|
+
- Model page: https://runapi.ai/models/veo-3.1
|
|
34
|
+
- SDK docs: https://runapi.ai/docs#sdk-veo-3.1
|
|
35
|
+
- Product docs: https://runapi.ai/docs#veo-3.1
|
|
36
|
+
- Pricing and rate limits: https://runapi.ai/models/veo-3.1/veo-3
|
|
37
|
+
- Provider comparison: https://runapi.ai/providers/google
|
|
38
|
+
- Full catalog: https://runapi.ai/models
|
|
39
|
+
- Repository: https://github.com/runapi-ai/veo3-sdk
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
Licensed under the Apache License, Version 2.0.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
|
|
2
|
+
export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
|
|
3
|
+
|
|
4
|
+
type Veo31Model = 'veo-3.1' | 'veo-3.1-fast';
|
|
5
|
+
type TargetResolution = '1080p' | '4k';
|
|
6
|
+
/**
|
|
7
|
+
* Video generation types.
|
|
8
|
+
* - TEXT_2_VIDEO: Pure text-to-video generation
|
|
9
|
+
* - FIRST_AND_LAST_FRAMES_2_VIDEO: Image-to-video with 1-2 images
|
|
10
|
+
* - REFERENCE_2_VIDEO: Reference-based generation with 1-3 images (fast model only, 16:9 only)
|
|
11
|
+
*/
|
|
12
|
+
type GenerationType = 'TEXT_2_VIDEO' | 'FIRST_AND_LAST_FRAMES_2_VIDEO' | 'REFERENCE_2_VIDEO';
|
|
13
|
+
/**
|
|
14
|
+
* Video aspect ratios.
|
|
15
|
+
* - 16:9: Landscape
|
|
16
|
+
* - 9:16: Portrait
|
|
17
|
+
* - auto: Automatic cropping based on input dimensions
|
|
18
|
+
*/
|
|
19
|
+
type AspectRatio = '16:9' | '9:16' | 'auto';
|
|
20
|
+
interface TextToVideoParams {
|
|
21
|
+
/** Text description of desired video content */
|
|
22
|
+
prompt: string;
|
|
23
|
+
/** Model to use for generation */
|
|
24
|
+
model: Veo31Model;
|
|
25
|
+
/** Type of generation (defaults to TEXT_2_VIDEO) */
|
|
26
|
+
generation_type?: GenerationType;
|
|
27
|
+
/** Video aspect ratio (defaults to 16:9) */
|
|
28
|
+
aspect_ratio?: AspectRatio;
|
|
29
|
+
/** Random seed (10000-99999) for reproducibility */
|
|
30
|
+
seeds?: number;
|
|
31
|
+
/** Auto-translate prompt to English (default: true) */
|
|
32
|
+
enable_translation?: boolean;
|
|
33
|
+
/** Optional watermark text to add to video */
|
|
34
|
+
watermark?: string;
|
|
35
|
+
/** URL for completion callback */
|
|
36
|
+
callback_url?: string;
|
|
37
|
+
/** 1-3 image URLs for image-to-video or reference-based generation */
|
|
38
|
+
image_urls?: string[];
|
|
39
|
+
}
|
|
40
|
+
interface ExtendVideoParams {
|
|
41
|
+
/** Task ID of the original video to extend */
|
|
42
|
+
task_id: string;
|
|
43
|
+
/** Optional text description for the extension content */
|
|
44
|
+
prompt?: string;
|
|
45
|
+
/** Random seed (10000-99999) for reproducibility */
|
|
46
|
+
seeds?: number;
|
|
47
|
+
/** Optional watermark text to add to extended video */
|
|
48
|
+
watermark?: string;
|
|
49
|
+
/** URL for completion callback */
|
|
50
|
+
callback_url?: string;
|
|
51
|
+
}
|
|
52
|
+
interface UpscaleVideoParams {
|
|
53
|
+
/** Task ID of the original video */
|
|
54
|
+
task_id: string;
|
|
55
|
+
/** Target output resolution */
|
|
56
|
+
target_resolution: TargetResolution;
|
|
57
|
+
/** Video index if multiple videos were generated (default: 0) */
|
|
58
|
+
index?: number;
|
|
59
|
+
/** URL for completion callback */
|
|
60
|
+
callback_url?: string;
|
|
61
|
+
}
|
|
62
|
+
interface TaskCreateResponse {
|
|
63
|
+
id: string;
|
|
64
|
+
}
|
|
65
|
+
interface VideoMetadata {
|
|
66
|
+
url: string;
|
|
67
|
+
resolution: string;
|
|
68
|
+
has_audio?: boolean;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
interface TextToVideoResponse {
|
|
72
|
+
id: string;
|
|
73
|
+
status: AsyncTaskStatus;
|
|
74
|
+
model?: Veo31Model;
|
|
75
|
+
videos?: VideoMetadata[];
|
|
76
|
+
error?: string;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
interface ExtendVideoResponse {
|
|
80
|
+
id: string;
|
|
81
|
+
status: AsyncTaskStatus;
|
|
82
|
+
original_task_id?: string;
|
|
83
|
+
videos?: VideoMetadata[];
|
|
84
|
+
error?: string;
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
}
|
|
87
|
+
interface UpscaleVideoResponse {
|
|
88
|
+
id: string;
|
|
89
|
+
status: AsyncTaskStatus;
|
|
90
|
+
original_task_id?: string;
|
|
91
|
+
video?: VideoMetadata;
|
|
92
|
+
error?: string;
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolved responses returned by the `run()` methods after polling sees
|
|
97
|
+
* `status: 'completed'`.
|
|
98
|
+
*/
|
|
99
|
+
type CompletedTextToVideoResponse = TextToVideoResponse & {
|
|
100
|
+
status: 'completed';
|
|
101
|
+
videos: VideoMetadata[];
|
|
102
|
+
};
|
|
103
|
+
type CompletedExtendVideoResponse = ExtendVideoResponse & {
|
|
104
|
+
status: 'completed';
|
|
105
|
+
videos: VideoMetadata[];
|
|
106
|
+
};
|
|
107
|
+
type CompletedUpscaleVideoResponse = UpscaleVideoResponse & {
|
|
108
|
+
status: 'completed';
|
|
109
|
+
video: VideoMetadata;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare class TextToVideo {
|
|
113
|
+
private readonly http;
|
|
114
|
+
constructor(http: HttpClient);
|
|
115
|
+
run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
|
|
116
|
+
create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
117
|
+
get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare class ExtendVideo {
|
|
121
|
+
private readonly http;
|
|
122
|
+
constructor(http: HttpClient);
|
|
123
|
+
run(params: ExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedExtendVideoResponse>;
|
|
124
|
+
create(params: ExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
125
|
+
get(id: string, options?: RequestOptions): Promise<ExtendVideoResponse>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare class UpscaleVideo {
|
|
129
|
+
private readonly http;
|
|
130
|
+
constructor(http: HttpClient);
|
|
131
|
+
run(params: UpscaleVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedUpscaleVideoResponse>;
|
|
132
|
+
create(params: UpscaleVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
133
|
+
get(id: string, options?: RequestOptions): Promise<UpscaleVideoResponse>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Veo 3.1 video API client.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const client = new Veo31Client({ apiKey: 'your-api-key' });
|
|
142
|
+
*
|
|
143
|
+
* const result = await client.textToVideo.run({
|
|
144
|
+
* model: 'veo-3.1-fast',
|
|
145
|
+
* prompt: 'A drone shot over mountains at sunset',
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare class Veo31Client {
|
|
150
|
+
/** Text, image, and reference-to-video operations. */
|
|
151
|
+
readonly textToVideo: TextToVideo;
|
|
152
|
+
/** Video extension operations. */
|
|
153
|
+
readonly extendVideo: ExtendVideo;
|
|
154
|
+
/** Video upscaling operations. */
|
|
155
|
+
readonly upscaleVideo: UpscaleVideo;
|
|
156
|
+
constructor(options?: ClientOptions);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export { type AspectRatio, type CompletedExtendVideoResponse, type CompletedTextToVideoResponse, type CompletedUpscaleVideoResponse, type ExtendVideoParams, type ExtendVideoResponse, type GenerationType, type TargetResolution, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type UpscaleVideoParams, type UpscaleVideoResponse, Veo31Client, type Veo31Model, type VideoMetadata };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
|
|
2
|
+
export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
|
|
3
|
+
|
|
4
|
+
type Veo31Model = 'veo-3.1' | 'veo-3.1-fast';
|
|
5
|
+
type TargetResolution = '1080p' | '4k';
|
|
6
|
+
/**
|
|
7
|
+
* Video generation types.
|
|
8
|
+
* - TEXT_2_VIDEO: Pure text-to-video generation
|
|
9
|
+
* - FIRST_AND_LAST_FRAMES_2_VIDEO: Image-to-video with 1-2 images
|
|
10
|
+
* - REFERENCE_2_VIDEO: Reference-based generation with 1-3 images (fast model only, 16:9 only)
|
|
11
|
+
*/
|
|
12
|
+
type GenerationType = 'TEXT_2_VIDEO' | 'FIRST_AND_LAST_FRAMES_2_VIDEO' | 'REFERENCE_2_VIDEO';
|
|
13
|
+
/**
|
|
14
|
+
* Video aspect ratios.
|
|
15
|
+
* - 16:9: Landscape
|
|
16
|
+
* - 9:16: Portrait
|
|
17
|
+
* - auto: Automatic cropping based on input dimensions
|
|
18
|
+
*/
|
|
19
|
+
type AspectRatio = '16:9' | '9:16' | 'auto';
|
|
20
|
+
interface TextToVideoParams {
|
|
21
|
+
/** Text description of desired video content */
|
|
22
|
+
prompt: string;
|
|
23
|
+
/** Model to use for generation */
|
|
24
|
+
model: Veo31Model;
|
|
25
|
+
/** Type of generation (defaults to TEXT_2_VIDEO) */
|
|
26
|
+
generation_type?: GenerationType;
|
|
27
|
+
/** Video aspect ratio (defaults to 16:9) */
|
|
28
|
+
aspect_ratio?: AspectRatio;
|
|
29
|
+
/** Random seed (10000-99999) for reproducibility */
|
|
30
|
+
seeds?: number;
|
|
31
|
+
/** Auto-translate prompt to English (default: true) */
|
|
32
|
+
enable_translation?: boolean;
|
|
33
|
+
/** Optional watermark text to add to video */
|
|
34
|
+
watermark?: string;
|
|
35
|
+
/** URL for completion callback */
|
|
36
|
+
callback_url?: string;
|
|
37
|
+
/** 1-3 image URLs for image-to-video or reference-based generation */
|
|
38
|
+
image_urls?: string[];
|
|
39
|
+
}
|
|
40
|
+
interface ExtendVideoParams {
|
|
41
|
+
/** Task ID of the original video to extend */
|
|
42
|
+
task_id: string;
|
|
43
|
+
/** Optional text description for the extension content */
|
|
44
|
+
prompt?: string;
|
|
45
|
+
/** Random seed (10000-99999) for reproducibility */
|
|
46
|
+
seeds?: number;
|
|
47
|
+
/** Optional watermark text to add to extended video */
|
|
48
|
+
watermark?: string;
|
|
49
|
+
/** URL for completion callback */
|
|
50
|
+
callback_url?: string;
|
|
51
|
+
}
|
|
52
|
+
interface UpscaleVideoParams {
|
|
53
|
+
/** Task ID of the original video */
|
|
54
|
+
task_id: string;
|
|
55
|
+
/** Target output resolution */
|
|
56
|
+
target_resolution: TargetResolution;
|
|
57
|
+
/** Video index if multiple videos were generated (default: 0) */
|
|
58
|
+
index?: number;
|
|
59
|
+
/** URL for completion callback */
|
|
60
|
+
callback_url?: string;
|
|
61
|
+
}
|
|
62
|
+
interface TaskCreateResponse {
|
|
63
|
+
id: string;
|
|
64
|
+
}
|
|
65
|
+
interface VideoMetadata {
|
|
66
|
+
url: string;
|
|
67
|
+
resolution: string;
|
|
68
|
+
has_audio?: boolean;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
interface TextToVideoResponse {
|
|
72
|
+
id: string;
|
|
73
|
+
status: AsyncTaskStatus;
|
|
74
|
+
model?: Veo31Model;
|
|
75
|
+
videos?: VideoMetadata[];
|
|
76
|
+
error?: string;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
interface ExtendVideoResponse {
|
|
80
|
+
id: string;
|
|
81
|
+
status: AsyncTaskStatus;
|
|
82
|
+
original_task_id?: string;
|
|
83
|
+
videos?: VideoMetadata[];
|
|
84
|
+
error?: string;
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
}
|
|
87
|
+
interface UpscaleVideoResponse {
|
|
88
|
+
id: string;
|
|
89
|
+
status: AsyncTaskStatus;
|
|
90
|
+
original_task_id?: string;
|
|
91
|
+
video?: VideoMetadata;
|
|
92
|
+
error?: string;
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolved responses returned by the `run()` methods after polling sees
|
|
97
|
+
* `status: 'completed'`.
|
|
98
|
+
*/
|
|
99
|
+
type CompletedTextToVideoResponse = TextToVideoResponse & {
|
|
100
|
+
status: 'completed';
|
|
101
|
+
videos: VideoMetadata[];
|
|
102
|
+
};
|
|
103
|
+
type CompletedExtendVideoResponse = ExtendVideoResponse & {
|
|
104
|
+
status: 'completed';
|
|
105
|
+
videos: VideoMetadata[];
|
|
106
|
+
};
|
|
107
|
+
type CompletedUpscaleVideoResponse = UpscaleVideoResponse & {
|
|
108
|
+
status: 'completed';
|
|
109
|
+
video: VideoMetadata;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare class TextToVideo {
|
|
113
|
+
private readonly http;
|
|
114
|
+
constructor(http: HttpClient);
|
|
115
|
+
run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
|
|
116
|
+
create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
117
|
+
get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare class ExtendVideo {
|
|
121
|
+
private readonly http;
|
|
122
|
+
constructor(http: HttpClient);
|
|
123
|
+
run(params: ExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedExtendVideoResponse>;
|
|
124
|
+
create(params: ExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
125
|
+
get(id: string, options?: RequestOptions): Promise<ExtendVideoResponse>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare class UpscaleVideo {
|
|
129
|
+
private readonly http;
|
|
130
|
+
constructor(http: HttpClient);
|
|
131
|
+
run(params: UpscaleVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedUpscaleVideoResponse>;
|
|
132
|
+
create(params: UpscaleVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
133
|
+
get(id: string, options?: RequestOptions): Promise<UpscaleVideoResponse>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Veo 3.1 video API client.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const client = new Veo31Client({ apiKey: 'your-api-key' });
|
|
142
|
+
*
|
|
143
|
+
* const result = await client.textToVideo.run({
|
|
144
|
+
* model: 'veo-3.1-fast',
|
|
145
|
+
* prompt: 'A drone shot over mountains at sunset',
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare class Veo31Client {
|
|
150
|
+
/** Text, image, and reference-to-video operations. */
|
|
151
|
+
readonly textToVideo: TextToVideo;
|
|
152
|
+
/** Video extension operations. */
|
|
153
|
+
readonly extendVideo: ExtendVideo;
|
|
154
|
+
/** Video upscaling operations. */
|
|
155
|
+
readonly upscaleVideo: UpscaleVideo;
|
|
156
|
+
constructor(options?: ClientOptions);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export { type AspectRatio, type CompletedExtendVideoResponse, type CompletedTextToVideoResponse, type CompletedUpscaleVideoResponse, type ExtendVideoParams, type ExtendVideoResponse, type GenerationType, type TargetResolution, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type UpscaleVideoParams, type UpscaleVideoResponse, Veo31Client, type Veo31Model, type VideoMetadata };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
AuthenticationError: () => import_core5.AuthenticationError,
|
|
24
|
+
InsufficientCreditsError: () => import_core5.InsufficientCreditsError,
|
|
25
|
+
NetworkError: () => import_core5.NetworkError,
|
|
26
|
+
NotFoundError: () => import_core5.NotFoundError,
|
|
27
|
+
RateLimitError: () => import_core5.RateLimitError,
|
|
28
|
+
RunApiError: () => import_core5.RunApiError,
|
|
29
|
+
ServiceUnavailableError: () => import_core5.ServiceUnavailableError,
|
|
30
|
+
TaskFailedError: () => import_core5.TaskFailedError,
|
|
31
|
+
TaskTimeoutError: () => import_core5.TaskTimeoutError,
|
|
32
|
+
TimeoutError: () => import_core5.TimeoutError,
|
|
33
|
+
ValidationError: () => import_core5.ValidationError,
|
|
34
|
+
Veo31Client: () => Veo31Client
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/client.ts
|
|
39
|
+
var import_core4 = require("@runapi.ai/core");
|
|
40
|
+
|
|
41
|
+
// src/resources/text-to-video.ts
|
|
42
|
+
var import_core = require("@runapi.ai/core");
|
|
43
|
+
var import_internal = require("@runapi.ai/core/internal");
|
|
44
|
+
var ENDPOINT = "/api/v1/veo_3_1/text_to_video";
|
|
45
|
+
var TextToVideo = class {
|
|
46
|
+
constructor(http) {
|
|
47
|
+
this.http = http;
|
|
48
|
+
}
|
|
49
|
+
http;
|
|
50
|
+
async run(params, options) {
|
|
51
|
+
const { id } = await this.create(params, options);
|
|
52
|
+
const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
|
|
53
|
+
maxWaitMs: options?.maxWaitMs,
|
|
54
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
55
|
+
});
|
|
56
|
+
return response;
|
|
57
|
+
}
|
|
58
|
+
async create(params, options) {
|
|
59
|
+
return this.http.request("POST", ENDPOINT, {
|
|
60
|
+
body: (0, import_core.compactParams)(params),
|
|
61
|
+
...options
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async get(id, options) {
|
|
65
|
+
return this.http.request("GET", `${ENDPOINT}/${id}`, {
|
|
66
|
+
...options
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/resources/extend-video.ts
|
|
72
|
+
var import_core2 = require("@runapi.ai/core");
|
|
73
|
+
var import_internal2 = require("@runapi.ai/core/internal");
|
|
74
|
+
var ENDPOINT2 = "/api/v1/veo_3_1/extend_video";
|
|
75
|
+
var ExtendVideo = class {
|
|
76
|
+
constructor(http) {
|
|
77
|
+
this.http = http;
|
|
78
|
+
}
|
|
79
|
+
http;
|
|
80
|
+
async run(params, options) {
|
|
81
|
+
const { id } = await this.create(params, options);
|
|
82
|
+
const response = await (0, import_internal2.pollUntilComplete)(() => this.get(id, options), {
|
|
83
|
+
maxWaitMs: options?.maxWaitMs,
|
|
84
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
85
|
+
});
|
|
86
|
+
return response;
|
|
87
|
+
}
|
|
88
|
+
async create(params, options) {
|
|
89
|
+
return this.http.request("POST", ENDPOINT2, {
|
|
90
|
+
body: (0, import_core2.compactParams)(params),
|
|
91
|
+
...options
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async get(id, options) {
|
|
95
|
+
return this.http.request("GET", `${ENDPOINT2}/${id}`, {
|
|
96
|
+
...options
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// src/resources/upscale-video.ts
|
|
102
|
+
var import_core3 = require("@runapi.ai/core");
|
|
103
|
+
var import_internal3 = require("@runapi.ai/core/internal");
|
|
104
|
+
var ENDPOINT3 = "/api/v1/veo_3_1/upscale_video";
|
|
105
|
+
var UpscaleVideo = class {
|
|
106
|
+
constructor(http) {
|
|
107
|
+
this.http = http;
|
|
108
|
+
}
|
|
109
|
+
http;
|
|
110
|
+
async run(params, options) {
|
|
111
|
+
const { id } = await this.create(params, options);
|
|
112
|
+
const response = await (0, import_internal3.pollUntilComplete)(() => this.get(id, options), {
|
|
113
|
+
maxWaitMs: options?.maxWaitMs,
|
|
114
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
115
|
+
});
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
async create(params, options) {
|
|
119
|
+
return this.http.request("POST", ENDPOINT3, {
|
|
120
|
+
body: (0, import_core3.compactParams)(params),
|
|
121
|
+
...options
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async get(id, options) {
|
|
125
|
+
return this.http.request("GET", `${ENDPOINT3}/${id}`, {
|
|
126
|
+
...options
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// src/client.ts
|
|
132
|
+
var Veo31Client = class {
|
|
133
|
+
/** Text, image, and reference-to-video operations. */
|
|
134
|
+
textToVideo;
|
|
135
|
+
/** Video extension operations. */
|
|
136
|
+
extendVideo;
|
|
137
|
+
/** Video upscaling operations. */
|
|
138
|
+
upscaleVideo;
|
|
139
|
+
constructor(options = {}) {
|
|
140
|
+
const http = (0, import_core4.createHttpClient)(options);
|
|
141
|
+
this.textToVideo = new TextToVideo(http);
|
|
142
|
+
this.extendVideo = new ExtendVideo(http);
|
|
143
|
+
this.upscaleVideo = new UpscaleVideo(http);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// src/index.ts
|
|
148
|
+
var import_core5 = require("@runapi.ai/core");
|
|
149
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
150
|
+
0 && (module.exports = {
|
|
151
|
+
AuthenticationError,
|
|
152
|
+
InsufficientCreditsError,
|
|
153
|
+
NetworkError,
|
|
154
|
+
NotFoundError,
|
|
155
|
+
RateLimitError,
|
|
156
|
+
RunApiError,
|
|
157
|
+
ServiceUnavailableError,
|
|
158
|
+
TaskFailedError,
|
|
159
|
+
TaskTimeoutError,
|
|
160
|
+
TimeoutError,
|
|
161
|
+
ValidationError,
|
|
162
|
+
Veo31Client
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-video.ts","../src/resources/extend-video.ts","../src/resources/upscale-video.ts"],"sourcesContent":["export { Veo31Client } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\nimport { ExtendVideo } from './resources/extend-video';\nimport { UpscaleVideo } from './resources/upscale-video';\n\n/**\n * Veo 3.1 video API client.\n *\n * @example\n * ```typescript\n * const client = new Veo31Client({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'veo-3.1-fast',\n * prompt: 'A drone shot over mountains at sunset',\n * });\n * ```\n */\nexport class Veo31Client {\n /** Text, image, and reference-to-video operations. */\n public readonly textToVideo: TextToVideo;\n /** Video extension operations. */\n public readonly extendVideo: ExtendVideo;\n /** Video upscaling operations. */\n public readonly upscaleVideo: UpscaleVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.extendVideo = new ExtendVideo(http);\n this.upscaleVideo = new UpscaleVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedExtendVideoResponse,\n ExtendVideoParams,\n ExtendVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/extend_video';\n\nexport class ExtendVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedExtendVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ExtendVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedExtendVideoResponse;\n }\n\n async create(params: ExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ExtendVideoResponse> {\n return this.http.request<ExtendVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedUpscaleVideoResponse,\n UpscaleVideoParams,\n UpscaleVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/upscale_video';\n\nexport class UpscaleVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: UpscaleVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedUpscaleVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<UpscaleVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedUpscaleVideoResponse;\n }\n\n async create(params: UpscaleVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<UpscaleVideoResponse> {\n return this.http.request<UpscaleVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":"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","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// src/client.ts
|
|
2
|
+
import { createHttpClient } from "@runapi.ai/core";
|
|
3
|
+
|
|
4
|
+
// src/resources/text-to-video.ts
|
|
5
|
+
import { compactParams } from "@runapi.ai/core";
|
|
6
|
+
import { pollUntilComplete } from "@runapi.ai/core/internal";
|
|
7
|
+
var ENDPOINT = "/api/v1/veo_3_1/text_to_video";
|
|
8
|
+
var TextToVideo = class {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
http;
|
|
13
|
+
async run(params, options) {
|
|
14
|
+
const { id } = await this.create(params, options);
|
|
15
|
+
const response = await pollUntilComplete(() => this.get(id, options), {
|
|
16
|
+
maxWaitMs: options?.maxWaitMs,
|
|
17
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
18
|
+
});
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
async create(params, options) {
|
|
22
|
+
return this.http.request("POST", ENDPOINT, {
|
|
23
|
+
body: compactParams(params),
|
|
24
|
+
...options
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async get(id, options) {
|
|
28
|
+
return this.http.request("GET", `${ENDPOINT}/${id}`, {
|
|
29
|
+
...options
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/resources/extend-video.ts
|
|
35
|
+
import { compactParams as compactParams2 } from "@runapi.ai/core";
|
|
36
|
+
import { pollUntilComplete as pollUntilComplete2 } from "@runapi.ai/core/internal";
|
|
37
|
+
var ENDPOINT2 = "/api/v1/veo_3_1/extend_video";
|
|
38
|
+
var ExtendVideo = class {
|
|
39
|
+
constructor(http) {
|
|
40
|
+
this.http = http;
|
|
41
|
+
}
|
|
42
|
+
http;
|
|
43
|
+
async run(params, options) {
|
|
44
|
+
const { id } = await this.create(params, options);
|
|
45
|
+
const response = await pollUntilComplete2(() => this.get(id, options), {
|
|
46
|
+
maxWaitMs: options?.maxWaitMs,
|
|
47
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
48
|
+
});
|
|
49
|
+
return response;
|
|
50
|
+
}
|
|
51
|
+
async create(params, options) {
|
|
52
|
+
return this.http.request("POST", ENDPOINT2, {
|
|
53
|
+
body: compactParams2(params),
|
|
54
|
+
...options
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async get(id, options) {
|
|
58
|
+
return this.http.request("GET", `${ENDPOINT2}/${id}`, {
|
|
59
|
+
...options
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// src/resources/upscale-video.ts
|
|
65
|
+
import { compactParams as compactParams3 } from "@runapi.ai/core";
|
|
66
|
+
import { pollUntilComplete as pollUntilComplete3 } from "@runapi.ai/core/internal";
|
|
67
|
+
var ENDPOINT3 = "/api/v1/veo_3_1/upscale_video";
|
|
68
|
+
var UpscaleVideo = class {
|
|
69
|
+
constructor(http) {
|
|
70
|
+
this.http = http;
|
|
71
|
+
}
|
|
72
|
+
http;
|
|
73
|
+
async run(params, options) {
|
|
74
|
+
const { id } = await this.create(params, options);
|
|
75
|
+
const response = await pollUntilComplete3(() => this.get(id, options), {
|
|
76
|
+
maxWaitMs: options?.maxWaitMs,
|
|
77
|
+
pollIntervalMs: options?.pollIntervalMs
|
|
78
|
+
});
|
|
79
|
+
return response;
|
|
80
|
+
}
|
|
81
|
+
async create(params, options) {
|
|
82
|
+
return this.http.request("POST", ENDPOINT3, {
|
|
83
|
+
body: compactParams3(params),
|
|
84
|
+
...options
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async get(id, options) {
|
|
88
|
+
return this.http.request("GET", `${ENDPOINT3}/${id}`, {
|
|
89
|
+
...options
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// src/client.ts
|
|
95
|
+
var Veo31Client = class {
|
|
96
|
+
/** Text, image, and reference-to-video operations. */
|
|
97
|
+
textToVideo;
|
|
98
|
+
/** Video extension operations. */
|
|
99
|
+
extendVideo;
|
|
100
|
+
/** Video upscaling operations. */
|
|
101
|
+
upscaleVideo;
|
|
102
|
+
constructor(options = {}) {
|
|
103
|
+
const http = createHttpClient(options);
|
|
104
|
+
this.textToVideo = new TextToVideo(http);
|
|
105
|
+
this.extendVideo = new ExtendVideo(http);
|
|
106
|
+
this.upscaleVideo = new UpscaleVideo(http);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/index.ts
|
|
111
|
+
import {
|
|
112
|
+
RunApiError,
|
|
113
|
+
AuthenticationError,
|
|
114
|
+
InsufficientCreditsError,
|
|
115
|
+
NotFoundError,
|
|
116
|
+
ValidationError,
|
|
117
|
+
RateLimitError,
|
|
118
|
+
ServiceUnavailableError,
|
|
119
|
+
NetworkError,
|
|
120
|
+
TimeoutError,
|
|
121
|
+
TaskTimeoutError,
|
|
122
|
+
TaskFailedError
|
|
123
|
+
} from "@runapi.ai/core";
|
|
124
|
+
export {
|
|
125
|
+
AuthenticationError,
|
|
126
|
+
InsufficientCreditsError,
|
|
127
|
+
NetworkError,
|
|
128
|
+
NotFoundError,
|
|
129
|
+
RateLimitError,
|
|
130
|
+
RunApiError,
|
|
131
|
+
ServiceUnavailableError,
|
|
132
|
+
TaskFailedError,
|
|
133
|
+
TaskTimeoutError,
|
|
134
|
+
TimeoutError,
|
|
135
|
+
ValidationError,
|
|
136
|
+
Veo31Client
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/resources/text-to-video.ts","../src/resources/extend-video.ts","../src/resources/upscale-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\nimport { ExtendVideo } from './resources/extend-video';\nimport { UpscaleVideo } from './resources/upscale-video';\n\n/**\n * Veo 3.1 video API client.\n *\n * @example\n * ```typescript\n * const client = new Veo31Client({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'veo-3.1-fast',\n * prompt: 'A drone shot over mountains at sunset',\n * });\n * ```\n */\nexport class Veo31Client {\n /** Text, image, and reference-to-video operations. */\n public readonly textToVideo: TextToVideo;\n /** Video extension operations. */\n public readonly extendVideo: ExtendVideo;\n /** Video upscaling operations. */\n public readonly upscaleVideo: UpscaleVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.extendVideo = new ExtendVideo(http);\n this.upscaleVideo = new UpscaleVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedExtendVideoResponse,\n ExtendVideoParams,\n ExtendVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/extend_video';\n\nexport class ExtendVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedExtendVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ExtendVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedExtendVideoResponse;\n }\n\n async create(params: ExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ExtendVideoResponse> {\n return this.http.request<ExtendVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedUpscaleVideoResponse,\n UpscaleVideoParams,\n UpscaleVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/veo_3_1/upscale_video';\n\nexport class UpscaleVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: UpscaleVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedUpscaleVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<UpscaleVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedUpscaleVideoResponse;\n }\n\n async create(params: UpscaleVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<UpscaleVideoResponse> {\n return this.http.request<UpscaleVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { Veo31Client } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":"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","names":["compactParams","pollUntilComplete","ENDPOINT","compactParams","pollUntilComplete","ENDPOINT"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@runapi.ai/veo-3.1",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "RunAPI Veo 3 SDK for JavaScript, Ruby, and Go",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"skills",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18.0.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"test:text2video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-text-to-video.ts",
|
|
30
|
+
"test:image2video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-image-to-video.ts",
|
|
31
|
+
"test:reference2video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-reference-to-video.ts",
|
|
32
|
+
"test:extend-video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-extend-video.ts",
|
|
33
|
+
"test:upscale-video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-upscale-video.ts",
|
|
34
|
+
"test:model": "dotenv -e manual-tests/.env -- tsx manual-tests/test-model-comparison.ts",
|
|
35
|
+
"test:errors": "dotenv -e manual-tests/.env -- tsx manual-tests/test-error-handling.ts",
|
|
36
|
+
"test:all": "dotenv -e manual-tests/.env -- tsx manual-tests/test-all.ts",
|
|
37
|
+
"test:manual": "pnpm run test:all"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@runapi.ai/core": "^0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
45
|
+
"dotenv-cli": "^11.0.0",
|
|
46
|
+
"tsup": "^8.0.0",
|
|
47
|
+
"tsx": "^4.7.0",
|
|
48
|
+
"typescript": "^5.4.0",
|
|
49
|
+
"vitest": "^1.6.0"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"runapi",
|
|
56
|
+
"runapi-ai",
|
|
57
|
+
"veo-3",
|
|
58
|
+
"api",
|
|
59
|
+
"sdk",
|
|
60
|
+
"typescript",
|
|
61
|
+
"ruby",
|
|
62
|
+
"golang"
|
|
63
|
+
],
|
|
64
|
+
"author": "RunAPI",
|
|
65
|
+
"license": "Apache-2.0",
|
|
66
|
+
"homepage": "https://runapi.ai/models/veo-3.1",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "git+https://github.com/runapi-ai/veo-3.1-sdk.git"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Veo 3 API Skill for RunAPI
|
|
2
|
+
|
|
3
|
+
Generate video with Veo 3 and Veo 3 Fast text-to-video. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Veo 3 through RunAPI.
|
|
4
|
+
|
|
5
|
+
The canonical agent file is `skills/veo-3.1/SKILL.md`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx skills add runapi-ai/veo-3.1 -g
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or manually: clone this repo and copy `skills/veo-3.1/` into your agent's skills directory.
|
|
14
|
+
|
|
15
|
+
## Quick example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { Veo31Client } from '@runapi.ai/veo-3-1';
|
|
19
|
+
|
|
20
|
+
const client = new Veo31Client();
|
|
21
|
+
const result = await client.textToVideo.run({
|
|
22
|
+
prompt: 'A low-angle tracking shot through a neon market at night',
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Routing
|
|
27
|
+
|
|
28
|
+
- Model page: https://runapi.ai/models/veo-3.1
|
|
29
|
+
- Product docs: https://runapi.ai/docs#veo-3.1
|
|
30
|
+
- SDK docs: https://runapi.ai/docs#sdk-veo-3.1
|
|
31
|
+
- SDK repository: https://github.com/runapi-ai/veo-3.1-sdk
|
|
32
|
+
- Pricing and rate limits: https://runapi.ai/models/veo-3.1/veo-3
|
|
33
|
+
- Provider comparison: https://runapi.ai/providers/google
|
|
34
|
+
- Browse all RunAPI models and skills: https://runapi.ai/models
|
|
35
|
+
|
|
36
|
+
## Variants
|
|
37
|
+
|
|
38
|
+
- [Veo 3](https://runapi.ai/models/veo-3.1/veo-3)
|
|
39
|
+
- [Veo 3 fast](https://runapi.ai/models/veo-3.1/fast)
|
|
40
|
+
|
|
41
|
+
## Agent rules
|
|
42
|
+
|
|
43
|
+
- Keep API keys in `RUNAPI_API_KEY` or RunAPI CLI config; never commit secrets.
|
|
44
|
+
- Prefer `create`, `get`, and `run` JSON passthrough patterns instead of inventing flags for every model parameter.
|
|
45
|
+
- For veo api pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
Licensed under the Apache License, Version 2.0.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: veo-3.1
|
|
3
|
+
description: Generate videos with Veo 3.1 text-to-video, extend-video, and upscale-video through RunAPI.ai using the @runapi.ai/veo-3-1 Node/TypeScript SDK. Use when the user asks to add AI video generation, mentions Veo 3.1, or writes against @runapi.ai/veo-3-1. Triggers on "veo3", "veo 3.1", "video generation", "生成视频", "@runapi.ai/veo-3-1".
|
|
4
|
+
documentation: https://runapi.ai/models/veo-3.1
|
|
5
|
+
provider_page: https://runapi.ai/providers/google
|
|
6
|
+
catalog: https://runapi.ai/models
|
|
7
|
+
---
|
|
8
|
+
# @runapi.ai/veo-3-1 — RunAPI.ai Veo 3.1 video generation
|
|
9
|
+
|
|
10
|
+
Use `Veo31Client` for Veo 3.1 video tasks.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { Veo31Client } from '@runapi.ai/veo-3-1';
|
|
14
|
+
|
|
15
|
+
const client = new Veo31Client({ apiKey: process.env.RUNAPI_API_KEY });
|
|
16
|
+
|
|
17
|
+
const result = await client.textToVideo.run({
|
|
18
|
+
prompt: 'A low-angle tracking shot through a neon market at night',
|
|
19
|
+
});
|
|
20
|
+
```
|