@runapi.ai/gemini-omni 0.2.6 → 0.2.8

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Gemini Omni API JavaScript SDK for RunAPI
1
+ # Gemini Omni JavaScript SDK for RunAPI
2
2
 
3
- The gemini omni api JavaScript SDK is the language-specific package for Gemini Omni on RunAPI. Use this package for voice resources, character resources, and multimodal video generation workflows that need JSON request bodies and consistent RunAPI errors in JavaScript.
3
+ The Gemini Omni JavaScript SDK is the language-specific package for Gemini Omni on RunAPI. Use this package for voice resources, character resources, and multimodal video generation workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
5
  ## Install
6
6
 
@@ -32,6 +32,8 @@ const video = await client.textToVideo.run({
32
32
  });
33
33
  ```
34
34
 
35
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
36
+
35
37
  ## Links
36
38
 
37
39
  - Model page: https://runapi.ai/models/gemini-omni
package/dist/index.d.mts CHANGED
@@ -1,108 +1,240 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
+ /**
5
+ * One of 30 preset voice identities for audio creation.
6
+ * Each voice has a distinct pitch, cadence, and personality.
7
+ * Pass the chosen value to {@link CreateAudioParams.audio_id}.
8
+ */
4
9
  type GeminiOmniAudioVoice = 'achernar' | 'achird' | 'algenib' | 'algieba' | 'alnilam' | 'aoede' | 'autonoe' | 'callirrhoe' | 'charon' | 'despina' | 'enceladus' | 'erinome' | 'fenrir' | 'gacrux' | 'iapetus' | 'kore' | 'laomedeia' | 'leda' | 'orus' | 'puck' | 'pulcherrima' | 'rasalgethi' | 'sadachbia' | 'sadaltager' | 'schedar' | 'sulafat' | 'umbriel' | 'vindemiatrix' | 'zephyr' | 'zubenelgenubi';
10
+ /**
11
+ * Parameters for registering a reusable voice preset.
12
+ * The returned audio ID can be attached to characters or text-to-video params
13
+ * to control narration voice.
14
+ */
5
15
  interface CreateAudioParams {
16
+ /** Preset voice identity. See {@link GeminiOmniAudioVoice} for the full list. */
6
17
  audio_id: GeminiOmniAudioVoice | string;
18
+ /** Display name for the voice preset, max 210 characters. */
7
19
  name: string;
20
+ /** Describes vocal characteristics (pitch, tone, accent), max 20 000 characters. */
8
21
  voice_description?: string;
22
+ /** Example dialogue line demonstrating the voice style, max 120 characters. */
9
23
  example_dialogue?: string;
10
24
  }
25
+ /** A created voice preset with its server-assigned ID. */
11
26
  interface GeminiOmniAudio {
12
27
  id: string;
13
28
  name?: string;
14
29
  [key: string]: unknown;
15
30
  }
31
+ /** Result of a synchronous create-audio call. */
16
32
  interface CreateAudioResponse {
17
33
  id: string;
34
+ /** The created voice preset; present on success. */
18
35
  audio?: GeminiOmniAudio;
19
36
  error?: string;
20
37
  [key: string]: unknown;
21
38
  }
39
+ /**
40
+ * Parameters for building a reusable character from a reference image and description.
41
+ * The returned character ID can be passed to {@link TextToVideoParams.character_ids}
42
+ * for consistent identity across videos.
43
+ */
22
44
  interface CreateCharacterParams {
45
+ /** Appearance, identity, style, clothing, or personality description. */
23
46
  descriptions: string;
47
+ /** Character reference image URL, max 20 MB. */
24
48
  reference_image_url: string;
49
+ /** Audio IDs from create-audio to give the character a specific voice. */
25
50
  audio_ids?: string[];
51
+ /** Character display name, max 210 characters. */
26
52
  character_name?: string;
27
53
  }
54
+ /** URL to a generated or reference image. */
28
55
  interface ImageMetadata {
29
56
  url: string;
30
57
  [key: string]: unknown;
31
58
  }
59
+ /** A created character with its reference images. */
32
60
  interface GeminiOmniCharacter {
33
61
  id: string;
34
62
  name?: string;
63
+ /** Reference images associated with this character. */
35
64
  images?: ImageMetadata[];
36
65
  [key: string]: unknown;
37
66
  }
67
+ /** Result of a synchronous create-character call. */
38
68
  interface CreateCharacterResponse {
39
69
  id: string;
70
+ /** The created character; present on success. */
40
71
  character?: GeminiOmniCharacter;
41
72
  error?: string;
42
73
  [key: string]: unknown;
43
74
  }
75
+ /** Video duration in seconds. Longer durations consume more credits. */
44
76
  type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
77
+ /** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
45
78
  type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
79
+ /** Output resolution -- higher resolutions produce sharper video at higher cost. */
46
80
  type GeminiOmniTextToVideoResolution = '720p' | '1080p' | '4k';
81
+ /**
82
+ * A trimmed segment of a source video for use in text-to-video generation.
83
+ * The trimmed segment (start to ends) must be within 10 seconds.
84
+ * Each clip consumes 2 reference units toward the 7-unit limit.
85
+ */
47
86
  interface GeminiOmniTextToVideoClip {
87
+ /** Public source video URL. */
48
88
  url: string;
89
+ /** Trim start time in seconds (>= 0). */
49
90
  start: number;
91
+ /** Trim end time in seconds (must be > start, within 10 s of start). */
50
92
  ends: number;
51
93
  }
94
+ /**
95
+ * Parameters for multimodal video generation.
96
+ * Pre-create characters via `createCharacter` and audio voices via `createAudio`,
97
+ * then reference their IDs here.
98
+ *
99
+ * Reference units are shared: images (1 each) + video clips (2 each) + characters (1 each)
100
+ * must total 7 or fewer.
101
+ */
52
102
  interface TextToVideoParams {
103
+ /** Video generation prompt, max 20 000 characters. */
53
104
  prompt: string;
105
+ /** Output video duration in seconds. */
54
106
  duration_seconds: GeminiOmniTextToVideoDuration;
107
+ /** HTTPS callback URL for task completion notification. */
55
108
  callback_url?: string;
109
+ /** Reference image URLs, max 7. Each consumes 1 reference unit. */
56
110
  reference_image_urls?: string[];
111
+ /** Audio IDs from create-audio for narration voices, max 3. */
57
112
  audio_ids?: string[];
113
+ /** Source video clips for motion reference, max 1. Each consumes 2 reference units. */
58
114
  video_list?: GeminiOmniTextToVideoClip[];
115
+ /** Character IDs from create-character for consistent identity, max 3. Each consumes 1 reference unit. */
59
116
  character_ids?: string[];
60
117
  aspect_ratio?: GeminiOmniTextToVideoAspectRatio;
118
+ /** Defaults to 720p. */
61
119
  output_resolution?: GeminiOmniTextToVideoResolution;
120
+ /** Reproducibility seed in [0, 2 147 483 647]. */
62
121
  seed?: number;
63
122
  }
123
+ /** Acknowledgement returned by `create()` before the task starts processing. */
64
124
  interface TaskCreateResponse {
65
125
  id: string;
66
126
  status?: AsyncTaskStatus;
67
127
  }
128
+ /** URL to a generated video file. */
68
129
  interface VideoMetadata {
69
130
  url: string;
70
131
  }
132
+ /** Async text-to-video task result with lifecycle status. */
71
133
  interface TextToVideoResponse {
72
134
  id: string;
73
135
  status: AsyncTaskStatus;
136
+ /** Generated video files; populated once the task completes. */
74
137
  videos?: VideoMetadata[];
75
138
  error?: string;
76
139
  [key: string]: unknown;
77
140
  }
141
+ /** Narrowed response returned by `run()` once polling confirms completion. Videos are guaranteed present. */
78
142
  type CompletedTextToVideoResponse = TextToVideoResponse & {
79
143
  status: 'completed';
80
144
  videos: VideoMetadata[];
81
145
  };
82
146
 
147
+ /**
148
+ * Registers a reusable voice preset from a built-in voice identity.
149
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
150
+ */
83
151
  declare class CreateAudio {
84
152
  private readonly http;
85
153
  constructor(http: HttpClient);
154
+ /**
155
+ * Register a reusable voice preset (synchronous).
156
+ * @param params Voice preset parameters.
157
+ * @param options Per-request overrides.
158
+ * @returns The created audio voice preset.
159
+ */
86
160
  run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse>;
87
161
  }
88
162
 
163
+ /**
164
+ * Builds a reusable character from a reference image and description.
165
+ * Attach audio IDs to give the character a specific voice.
166
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
167
+ */
89
168
  declare class CreateCharacter {
90
169
  private readonly http;
91
170
  constructor(http: HttpClient);
171
+ /**
172
+ * Build a reusable character (synchronous).
173
+ * @param params Character creation parameters.
174
+ * @param options Per-request overrides.
175
+ * @returns The created character.
176
+ */
92
177
  run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse>;
93
178
  }
94
179
 
180
+ /**
181
+ * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.
182
+ * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.
183
+ */
95
184
  declare class TextToVideo {
96
185
  private readonly http;
97
186
  constructor(http: HttpClient);
187
+ /**
188
+ * Generate a video and wait until complete.
189
+ * @param params Text-to-video parameters.
190
+ * @param options Per-request and polling overrides.
191
+ * @returns The completed text-to-video result.
192
+ */
98
193
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
194
+ /**
195
+ * Create a text-to-video task; returns immediately with a task id.
196
+ * @param params Text-to-video parameters.
197
+ * @param options Per-request overrides.
198
+ * @returns The task creation result with id.
199
+ */
99
200
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
201
+ /**
202
+ * Fetch the current status of a text-to-video task.
203
+ * @param id The task id.
204
+ * @param options Per-request overrides.
205
+ * @returns The current text-to-video status.
206
+ */
100
207
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
101
208
  }
102
209
 
103
- declare class GeminiOmniClient {
210
+ /**
211
+ * Gemini Omni multimodal generation client for voice presets, character creation,
212
+ * and text-to-video with optional characters, audio voices, and reference media.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';
217
+ * const client = new GeminiOmniClient({ apiKey: 'sk-...' });
218
+ *
219
+ * // Create a voice preset, then generate a video using it
220
+ * const audio = await client.createAudio.run({
221
+ * audio_id: 'zephyr',
222
+ * name: 'Narrator',
223
+ * });
224
+ * const video = await client.textToVideo.run({
225
+ * prompt: 'A narrator walks through a futuristic city',
226
+ * duration_seconds: 6,
227
+ * audio_ids: [audio.audio!.id],
228
+ * });
229
+ * console.log(video.videos[0].url);
230
+ * ```
231
+ */
232
+ declare class GeminiOmniClient extends BaseClient {
233
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
104
234
  readonly createAudio: CreateAudio;
235
+ /** Builds a reusable character from a reference image and description (synchronous). */
105
236
  readonly createCharacter: CreateCharacter;
237
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
106
238
  readonly textToVideo: TextToVideo;
107
239
  constructor(options?: ClientOptions);
108
240
  }
package/dist/index.d.ts CHANGED
@@ -1,108 +1,240 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
+ /**
5
+ * One of 30 preset voice identities for audio creation.
6
+ * Each voice has a distinct pitch, cadence, and personality.
7
+ * Pass the chosen value to {@link CreateAudioParams.audio_id}.
8
+ */
4
9
  type GeminiOmniAudioVoice = 'achernar' | 'achird' | 'algenib' | 'algieba' | 'alnilam' | 'aoede' | 'autonoe' | 'callirrhoe' | 'charon' | 'despina' | 'enceladus' | 'erinome' | 'fenrir' | 'gacrux' | 'iapetus' | 'kore' | 'laomedeia' | 'leda' | 'orus' | 'puck' | 'pulcherrima' | 'rasalgethi' | 'sadachbia' | 'sadaltager' | 'schedar' | 'sulafat' | 'umbriel' | 'vindemiatrix' | 'zephyr' | 'zubenelgenubi';
10
+ /**
11
+ * Parameters for registering a reusable voice preset.
12
+ * The returned audio ID can be attached to characters or text-to-video params
13
+ * to control narration voice.
14
+ */
5
15
  interface CreateAudioParams {
16
+ /** Preset voice identity. See {@link GeminiOmniAudioVoice} for the full list. */
6
17
  audio_id: GeminiOmniAudioVoice | string;
18
+ /** Display name for the voice preset, max 210 characters. */
7
19
  name: string;
20
+ /** Describes vocal characteristics (pitch, tone, accent), max 20 000 characters. */
8
21
  voice_description?: string;
22
+ /** Example dialogue line demonstrating the voice style, max 120 characters. */
9
23
  example_dialogue?: string;
10
24
  }
25
+ /** A created voice preset with its server-assigned ID. */
11
26
  interface GeminiOmniAudio {
12
27
  id: string;
13
28
  name?: string;
14
29
  [key: string]: unknown;
15
30
  }
31
+ /** Result of a synchronous create-audio call. */
16
32
  interface CreateAudioResponse {
17
33
  id: string;
34
+ /** The created voice preset; present on success. */
18
35
  audio?: GeminiOmniAudio;
19
36
  error?: string;
20
37
  [key: string]: unknown;
21
38
  }
39
+ /**
40
+ * Parameters for building a reusable character from a reference image and description.
41
+ * The returned character ID can be passed to {@link TextToVideoParams.character_ids}
42
+ * for consistent identity across videos.
43
+ */
22
44
  interface CreateCharacterParams {
45
+ /** Appearance, identity, style, clothing, or personality description. */
23
46
  descriptions: string;
47
+ /** Character reference image URL, max 20 MB. */
24
48
  reference_image_url: string;
49
+ /** Audio IDs from create-audio to give the character a specific voice. */
25
50
  audio_ids?: string[];
51
+ /** Character display name, max 210 characters. */
26
52
  character_name?: string;
27
53
  }
54
+ /** URL to a generated or reference image. */
28
55
  interface ImageMetadata {
29
56
  url: string;
30
57
  [key: string]: unknown;
31
58
  }
59
+ /** A created character with its reference images. */
32
60
  interface GeminiOmniCharacter {
33
61
  id: string;
34
62
  name?: string;
63
+ /** Reference images associated with this character. */
35
64
  images?: ImageMetadata[];
36
65
  [key: string]: unknown;
37
66
  }
67
+ /** Result of a synchronous create-character call. */
38
68
  interface CreateCharacterResponse {
39
69
  id: string;
70
+ /** The created character; present on success. */
40
71
  character?: GeminiOmniCharacter;
41
72
  error?: string;
42
73
  [key: string]: unknown;
43
74
  }
75
+ /** Video duration in seconds. Longer durations consume more credits. */
44
76
  type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
77
+ /** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
45
78
  type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
79
+ /** Output resolution -- higher resolutions produce sharper video at higher cost. */
46
80
  type GeminiOmniTextToVideoResolution = '720p' | '1080p' | '4k';
81
+ /**
82
+ * A trimmed segment of a source video for use in text-to-video generation.
83
+ * The trimmed segment (start to ends) must be within 10 seconds.
84
+ * Each clip consumes 2 reference units toward the 7-unit limit.
85
+ */
47
86
  interface GeminiOmniTextToVideoClip {
87
+ /** Public source video URL. */
48
88
  url: string;
89
+ /** Trim start time in seconds (>= 0). */
49
90
  start: number;
91
+ /** Trim end time in seconds (must be > start, within 10 s of start). */
50
92
  ends: number;
51
93
  }
94
+ /**
95
+ * Parameters for multimodal video generation.
96
+ * Pre-create characters via `createCharacter` and audio voices via `createAudio`,
97
+ * then reference their IDs here.
98
+ *
99
+ * Reference units are shared: images (1 each) + video clips (2 each) + characters (1 each)
100
+ * must total 7 or fewer.
101
+ */
52
102
  interface TextToVideoParams {
103
+ /** Video generation prompt, max 20 000 characters. */
53
104
  prompt: string;
105
+ /** Output video duration in seconds. */
54
106
  duration_seconds: GeminiOmniTextToVideoDuration;
107
+ /** HTTPS callback URL for task completion notification. */
55
108
  callback_url?: string;
109
+ /** Reference image URLs, max 7. Each consumes 1 reference unit. */
56
110
  reference_image_urls?: string[];
111
+ /** Audio IDs from create-audio for narration voices, max 3. */
57
112
  audio_ids?: string[];
113
+ /** Source video clips for motion reference, max 1. Each consumes 2 reference units. */
58
114
  video_list?: GeminiOmniTextToVideoClip[];
115
+ /** Character IDs from create-character for consistent identity, max 3. Each consumes 1 reference unit. */
59
116
  character_ids?: string[];
60
117
  aspect_ratio?: GeminiOmniTextToVideoAspectRatio;
118
+ /** Defaults to 720p. */
61
119
  output_resolution?: GeminiOmniTextToVideoResolution;
120
+ /** Reproducibility seed in [0, 2 147 483 647]. */
62
121
  seed?: number;
63
122
  }
123
+ /** Acknowledgement returned by `create()` before the task starts processing. */
64
124
  interface TaskCreateResponse {
65
125
  id: string;
66
126
  status?: AsyncTaskStatus;
67
127
  }
128
+ /** URL to a generated video file. */
68
129
  interface VideoMetadata {
69
130
  url: string;
70
131
  }
132
+ /** Async text-to-video task result with lifecycle status. */
71
133
  interface TextToVideoResponse {
72
134
  id: string;
73
135
  status: AsyncTaskStatus;
136
+ /** Generated video files; populated once the task completes. */
74
137
  videos?: VideoMetadata[];
75
138
  error?: string;
76
139
  [key: string]: unknown;
77
140
  }
141
+ /** Narrowed response returned by `run()` once polling confirms completion. Videos are guaranteed present. */
78
142
  type CompletedTextToVideoResponse = TextToVideoResponse & {
79
143
  status: 'completed';
80
144
  videos: VideoMetadata[];
81
145
  };
82
146
 
147
+ /**
148
+ * Registers a reusable voice preset from a built-in voice identity.
149
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
150
+ */
83
151
  declare class CreateAudio {
84
152
  private readonly http;
85
153
  constructor(http: HttpClient);
154
+ /**
155
+ * Register a reusable voice preset (synchronous).
156
+ * @param params Voice preset parameters.
157
+ * @param options Per-request overrides.
158
+ * @returns The created audio voice preset.
159
+ */
86
160
  run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse>;
87
161
  }
88
162
 
163
+ /**
164
+ * Builds a reusable character from a reference image and description.
165
+ * Attach audio IDs to give the character a specific voice.
166
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
167
+ */
89
168
  declare class CreateCharacter {
90
169
  private readonly http;
91
170
  constructor(http: HttpClient);
171
+ /**
172
+ * Build a reusable character (synchronous).
173
+ * @param params Character creation parameters.
174
+ * @param options Per-request overrides.
175
+ * @returns The created character.
176
+ */
92
177
  run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse>;
93
178
  }
94
179
 
180
+ /**
181
+ * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.
182
+ * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.
183
+ */
95
184
  declare class TextToVideo {
96
185
  private readonly http;
97
186
  constructor(http: HttpClient);
187
+ /**
188
+ * Generate a video and wait until complete.
189
+ * @param params Text-to-video parameters.
190
+ * @param options Per-request and polling overrides.
191
+ * @returns The completed text-to-video result.
192
+ */
98
193
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
194
+ /**
195
+ * Create a text-to-video task; returns immediately with a task id.
196
+ * @param params Text-to-video parameters.
197
+ * @param options Per-request overrides.
198
+ * @returns The task creation result with id.
199
+ */
99
200
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
201
+ /**
202
+ * Fetch the current status of a text-to-video task.
203
+ * @param id The task id.
204
+ * @param options Per-request overrides.
205
+ * @returns The current text-to-video status.
206
+ */
100
207
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
101
208
  }
102
209
 
103
- declare class GeminiOmniClient {
210
+ /**
211
+ * Gemini Omni multimodal generation client for voice presets, character creation,
212
+ * and text-to-video with optional characters, audio voices, and reference media.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';
217
+ * const client = new GeminiOmniClient({ apiKey: 'sk-...' });
218
+ *
219
+ * // Create a voice preset, then generate a video using it
220
+ * const audio = await client.createAudio.run({
221
+ * audio_id: 'zephyr',
222
+ * name: 'Narrator',
223
+ * });
224
+ * const video = await client.textToVideo.run({
225
+ * prompt: 'A narrator walks through a futuristic city',
226
+ * duration_seconds: 6,
227
+ * audio_ids: [audio.audio!.id],
228
+ * });
229
+ * console.log(video.videos[0].url);
230
+ * ```
231
+ */
232
+ declare class GeminiOmniClient extends BaseClient {
233
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
104
234
  readonly createAudio: CreateAudio;
235
+ /** Builds a reusable character from a reference image and description (synchronous). */
105
236
  readonly createCharacter: CreateCharacter;
237
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
106
238
  readonly textToVideo: TextToVideo;
107
239
  constructor(options?: ClientOptions);
108
240
  }
package/dist/index.js CHANGED
@@ -38,15 +38,98 @@ var import_core4 = require("@runapi.ai/core");
38
38
 
39
39
  // src/resources/create-audio.ts
40
40
  var import_core = require("@runapi.ai/core");
41
+
42
+ // src/contract_gen.ts
43
+ var contract = {
44
+ "create-audio": {
45
+ "models": [
46
+ "gemini-omni-audio"
47
+ ],
48
+ "fields_by_model": {
49
+ "gemini-omni-audio": {
50
+ "audio_id": {
51
+ "required": true
52
+ },
53
+ "name": {
54
+ "required": true
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "create-character": {
60
+ "models": [
61
+ "gemini-omni-character"
62
+ ],
63
+ "fields_by_model": {
64
+ "gemini-omni-character": {
65
+ "descriptions": {
66
+ "required": true
67
+ },
68
+ "reference_image_url": {
69
+ "required": true
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "text-to-video": {
75
+ "models": [
76
+ "gemini-omni-text-to-video"
77
+ ],
78
+ "fields_by_model": {
79
+ "gemini-omni-text-to-video": {
80
+ "aspect_ratio": {
81
+ "enum": [
82
+ "16:9",
83
+ "9:16"
84
+ ]
85
+ },
86
+ "duration_seconds": {
87
+ "enum": [
88
+ 4,
89
+ 6,
90
+ 8,
91
+ 10
92
+ ],
93
+ "required": true,
94
+ "type": "integer"
95
+ },
96
+ "output_resolution": {
97
+ "enum": [
98
+ "720p",
99
+ "1080p",
100
+ "4k"
101
+ ]
102
+ },
103
+ "prompt": {
104
+ "required": true
105
+ },
106
+ "seed": {
107
+ "type": "integer"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ };
113
+
114
+ // src/resources/create-audio.ts
41
115
  var ENDPOINT = "/api/v1/gemini_omni/create_audio";
116
+ var MODEL = "gemini-omni-audio";
42
117
  var CreateAudio = class {
43
118
  constructor(http) {
44
119
  this.http = http;
45
120
  }
46
121
  http;
122
+ /**
123
+ * Register a reusable voice preset (synchronous).
124
+ * @param params Voice preset parameters.
125
+ * @param options Per-request overrides.
126
+ * @returns The created audio voice preset.
127
+ */
47
128
  async run(params, options) {
129
+ const body = (0, import_core.compactParams)(params);
130
+ (0, import_core.validateParams)(contract["create-audio"], { ...body, model: MODEL });
48
131
  return this.http.request("POST", ENDPOINT, {
49
- body: (0, import_core.compactParams)(params),
132
+ body,
50
133
  ...options
51
134
  });
52
135
  }
@@ -55,14 +138,23 @@ var CreateAudio = class {
55
138
  // src/resources/create-character.ts
56
139
  var import_core2 = require("@runapi.ai/core");
57
140
  var ENDPOINT2 = "/api/v1/gemini_omni/create_character";
141
+ var MODEL2 = "gemini-omni-character";
58
142
  var CreateCharacter = class {
59
143
  constructor(http) {
60
144
  this.http = http;
61
145
  }
62
146
  http;
147
+ /**
148
+ * Build a reusable character (synchronous).
149
+ * @param params Character creation parameters.
150
+ * @param options Per-request overrides.
151
+ * @returns The created character.
152
+ */
63
153
  async run(params, options) {
154
+ const body = (0, import_core2.compactParams)(params);
155
+ (0, import_core2.validateParams)(contract["create-character"], { ...body, model: MODEL2 });
64
156
  return this.http.request("POST", ENDPOINT2, {
65
- body: (0, import_core2.compactParams)(params),
157
+ body,
66
158
  ...options
67
159
  });
68
160
  }
@@ -72,11 +164,18 @@ var CreateCharacter = class {
72
164
  var import_core3 = require("@runapi.ai/core");
73
165
  var import_internal = require("@runapi.ai/core/internal");
74
166
  var ENDPOINT3 = "/api/v1/gemini_omni/text_to_video";
167
+ var MODEL3 = "gemini-omni-text-to-video";
75
168
  var TextToVideo = class {
76
169
  constructor(http) {
77
170
  this.http = http;
78
171
  }
79
172
  http;
173
+ /**
174
+ * Generate a video and wait until complete.
175
+ * @param params Text-to-video parameters.
176
+ * @param options Per-request and polling overrides.
177
+ * @returns The completed text-to-video result.
178
+ */
80
179
  async run(params, options) {
81
180
  const { id } = await this.create(params, options);
82
181
  const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
@@ -85,12 +184,26 @@ var TextToVideo = class {
85
184
  });
86
185
  return response;
87
186
  }
187
+ /**
188
+ * Create a text-to-video task; returns immediately with a task id.
189
+ * @param params Text-to-video parameters.
190
+ * @param options Per-request overrides.
191
+ * @returns The task creation result with id.
192
+ */
88
193
  async create(params, options) {
194
+ const body = (0, import_core3.compactParams)(params);
195
+ (0, import_core3.validateParams)(contract["text-to-video"], { ...body, model: MODEL3 });
89
196
  return this.http.request("POST", ENDPOINT3, {
90
- body: (0, import_core3.compactParams)(params),
197
+ body,
91
198
  ...options
92
199
  });
93
200
  }
201
+ /**
202
+ * Fetch the current status of a text-to-video task.
203
+ * @param id The task id.
204
+ * @param options Per-request overrides.
205
+ * @returns The current text-to-video status.
206
+ */
94
207
  async get(id, options) {
95
208
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
96
209
  ...options
@@ -99,15 +212,18 @@ var TextToVideo = class {
99
212
  };
100
213
 
101
214
  // src/client.ts
102
- var GeminiOmniClient = class {
215
+ var GeminiOmniClient = class extends import_core4.BaseClient {
216
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
103
217
  createAudio;
218
+ /** Builds a reusable character from a reference image and description (synchronous). */
104
219
  createCharacter;
220
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
105
221
  textToVideo;
106
222
  constructor(options = {}) {
107
- const http = (0, import_core4.createHttpClient)(options);
108
- this.createAudio = new CreateAudio(http);
109
- this.createCharacter = new CreateCharacter(http);
110
- this.textToVideo = new TextToVideo(http);
223
+ super(options);
224
+ this.createAudio = new CreateAudio(this.http);
225
+ this.createCharacter = new CreateCharacter(this.http);
226
+ this.textToVideo = new TextToVideo(this.http);
111
227
  }
112
228
  };
113
229
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class GeminiOmniClient {\n public readonly createAudio: CreateAudio;\n public readonly createCharacter: CreateCharacter;\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.createAudio = new CreateAudio(http);\n this.createCharacter = new CreateCharacter(http);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\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 CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAqD;;;ACCrD,kBAA8B;AAG9B,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,IAAAC,eAA8B;AAG9B,IAAMC,YAAW;AAEV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,IAAAC,eAA8B;AAC9B,sBAAkC;AAQlC,IAAMC,YAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,WAAO,+BAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,kBAAkB,IAAI,gBAAgB,IAAI;AAC/C,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;ADdA,IAAAC,eAUO;","names":["import_core","import_core","ENDPOINT","import_core","ENDPOINT","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/create-audio.ts","../src/contract_gen.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Gemini Omni multimodal generation client for voice presets, character creation,\n * and text-to-video with optional characters, audio voices, and reference media.\n *\n * @example\n * ```typescript\n * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';\n * const client = new GeminiOmniClient({ apiKey: 'sk-...' });\n *\n * // Create a voice preset, then generate a video using it\n * const audio = await client.createAudio.run({\n * audio_id: 'zephyr',\n * name: 'Narrator',\n * });\n * const video = await client.textToVideo.run({\n * prompt: 'A narrator walks through a futuristic city',\n * duration_seconds: 6,\n * audio_ids: [audio.audio!.id],\n * });\n * console.log(video.videos[0].url);\n * ```\n */\nexport class GeminiOmniClient extends BaseClient {\n /** Registers a reusable voice preset from a built-in voice identity (synchronous). */\n public readonly createAudio: CreateAudio;\n /** Builds a reusable character from a reference image and description (synchronous). */\n public readonly createCharacter: CreateCharacter;\n /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.createAudio = new CreateAudio(this.http);\n this.createCharacter = new CreateCharacter(this.http);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-audio';\n\n/**\n * Registers a reusable voice preset from a built-in voice identity.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a reusable voice preset (synchronous).\n * @param params Voice preset parameters.\n * @param options Per-request overrides.\n * @returns The created audio voice preset.\n */\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n const body = compactParams(params);\n validateParams(contract['create-audio'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","export const contract = {\n \"create-audio\": {\n \"models\": [\n \"gemini-omni-audio\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-audio\": {\n \"audio_id\": {\n \"required\": true\n },\n \"name\": {\n \"required\": true\n }\n }\n }\n },\n \"create-character\": {\n \"models\": [\n \"gemini-omni-character\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-character\": {\n \"descriptions\": {\n \"required\": true\n },\n \"reference_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"gemini-omni-text-to-video\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 4,\n 6,\n 8,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\",\n \"4k\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-character';\n\n/**\n * Builds a reusable character from a reference image and description.\n * Attach audio IDs to give the character a specific voice.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Build a reusable character (synchronous).\n * @param params Character creation parameters.\n * @param options Per-request overrides.\n * @returns The created character.\n */\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n const body = compactParams(params);\n validateParams(contract['create-character'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-text-to-video';\n\n/**\n * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.\n * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.\n */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text-to-video result.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video status.\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"],"mappings":"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","names":["import_core","import_core","ENDPOINT","MODEL","import_core","ENDPOINT","MODEL","import_core"]}
package/dist/index.mjs CHANGED
@@ -1,47 +1,146 @@
1
1
  // src/client.ts
2
- import { createHttpClient } from "@runapi.ai/core";
2
+ import { BaseClient } from "@runapi.ai/core";
3
+
4
+ // src/resources/create-audio.ts
5
+ import { compactParams, validateParams } from "@runapi.ai/core";
6
+
7
+ // src/contract_gen.ts
8
+ var contract = {
9
+ "create-audio": {
10
+ "models": [
11
+ "gemini-omni-audio"
12
+ ],
13
+ "fields_by_model": {
14
+ "gemini-omni-audio": {
15
+ "audio_id": {
16
+ "required": true
17
+ },
18
+ "name": {
19
+ "required": true
20
+ }
21
+ }
22
+ }
23
+ },
24
+ "create-character": {
25
+ "models": [
26
+ "gemini-omni-character"
27
+ ],
28
+ "fields_by_model": {
29
+ "gemini-omni-character": {
30
+ "descriptions": {
31
+ "required": true
32
+ },
33
+ "reference_image_url": {
34
+ "required": true
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "text-to-video": {
40
+ "models": [
41
+ "gemini-omni-text-to-video"
42
+ ],
43
+ "fields_by_model": {
44
+ "gemini-omni-text-to-video": {
45
+ "aspect_ratio": {
46
+ "enum": [
47
+ "16:9",
48
+ "9:16"
49
+ ]
50
+ },
51
+ "duration_seconds": {
52
+ "enum": [
53
+ 4,
54
+ 6,
55
+ 8,
56
+ 10
57
+ ],
58
+ "required": true,
59
+ "type": "integer"
60
+ },
61
+ "output_resolution": {
62
+ "enum": [
63
+ "720p",
64
+ "1080p",
65
+ "4k"
66
+ ]
67
+ },
68
+ "prompt": {
69
+ "required": true
70
+ },
71
+ "seed": {
72
+ "type": "integer"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ };
3
78
 
4
79
  // src/resources/create-audio.ts
5
- import { compactParams } from "@runapi.ai/core";
6
80
  var ENDPOINT = "/api/v1/gemini_omni/create_audio";
81
+ var MODEL = "gemini-omni-audio";
7
82
  var CreateAudio = class {
8
83
  constructor(http) {
9
84
  this.http = http;
10
85
  }
11
86
  http;
87
+ /**
88
+ * Register a reusable voice preset (synchronous).
89
+ * @param params Voice preset parameters.
90
+ * @param options Per-request overrides.
91
+ * @returns The created audio voice preset.
92
+ */
12
93
  async run(params, options) {
94
+ const body = compactParams(params);
95
+ validateParams(contract["create-audio"], { ...body, model: MODEL });
13
96
  return this.http.request("POST", ENDPOINT, {
14
- body: compactParams(params),
97
+ body,
15
98
  ...options
16
99
  });
17
100
  }
18
101
  };
19
102
 
20
103
  // src/resources/create-character.ts
21
- import { compactParams as compactParams2 } from "@runapi.ai/core";
104
+ import { compactParams as compactParams2, validateParams as validateParams2 } from "@runapi.ai/core";
22
105
  var ENDPOINT2 = "/api/v1/gemini_omni/create_character";
106
+ var MODEL2 = "gemini-omni-character";
23
107
  var CreateCharacter = class {
24
108
  constructor(http) {
25
109
  this.http = http;
26
110
  }
27
111
  http;
112
+ /**
113
+ * Build a reusable character (synchronous).
114
+ * @param params Character creation parameters.
115
+ * @param options Per-request overrides.
116
+ * @returns The created character.
117
+ */
28
118
  async run(params, options) {
119
+ const body = compactParams2(params);
120
+ validateParams2(contract["create-character"], { ...body, model: MODEL2 });
29
121
  return this.http.request("POST", ENDPOINT2, {
30
- body: compactParams2(params),
122
+ body,
31
123
  ...options
32
124
  });
33
125
  }
34
126
  };
35
127
 
36
128
  // src/resources/text-to-video.ts
37
- import { compactParams as compactParams3 } from "@runapi.ai/core";
129
+ import { compactParams as compactParams3, validateParams as validateParams3 } from "@runapi.ai/core";
38
130
  import { pollUntilComplete } from "@runapi.ai/core/internal";
39
131
  var ENDPOINT3 = "/api/v1/gemini_omni/text_to_video";
132
+ var MODEL3 = "gemini-omni-text-to-video";
40
133
  var TextToVideo = class {
41
134
  constructor(http) {
42
135
  this.http = http;
43
136
  }
44
137
  http;
138
+ /**
139
+ * Generate a video and wait until complete.
140
+ * @param params Text-to-video parameters.
141
+ * @param options Per-request and polling overrides.
142
+ * @returns The completed text-to-video result.
143
+ */
45
144
  async run(params, options) {
46
145
  const { id } = await this.create(params, options);
47
146
  const response = await pollUntilComplete(() => this.get(id, options), {
@@ -50,12 +149,26 @@ var TextToVideo = class {
50
149
  });
51
150
  return response;
52
151
  }
152
+ /**
153
+ * Create a text-to-video task; returns immediately with a task id.
154
+ * @param params Text-to-video parameters.
155
+ * @param options Per-request overrides.
156
+ * @returns The task creation result with id.
157
+ */
53
158
  async create(params, options) {
159
+ const body = compactParams3(params);
160
+ validateParams3(contract["text-to-video"], { ...body, model: MODEL3 });
54
161
  return this.http.request("POST", ENDPOINT3, {
55
- body: compactParams3(params),
162
+ body,
56
163
  ...options
57
164
  });
58
165
  }
166
+ /**
167
+ * Fetch the current status of a text-to-video task.
168
+ * @param id The task id.
169
+ * @param options Per-request overrides.
170
+ * @returns The current text-to-video status.
171
+ */
59
172
  async get(id, options) {
60
173
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
61
174
  ...options
@@ -64,15 +177,18 @@ var TextToVideo = class {
64
177
  };
65
178
 
66
179
  // src/client.ts
67
- var GeminiOmniClient = class {
180
+ var GeminiOmniClient = class extends BaseClient {
181
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
68
182
  createAudio;
183
+ /** Builds a reusable character from a reference image and description (synchronous). */
69
184
  createCharacter;
185
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
70
186
  textToVideo;
71
187
  constructor(options = {}) {
72
- const http = createHttpClient(options);
73
- this.createAudio = new CreateAudio(http);
74
- this.createCharacter = new CreateCharacter(http);
75
- this.textToVideo = new TextToVideo(http);
188
+ super(options);
189
+ this.createAudio = new CreateAudio(this.http);
190
+ this.createCharacter = new CreateCharacter(this.http);
191
+ this.textToVideo = new TextToVideo(this.http);
76
192
  }
77
193
  };
78
194
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class GeminiOmniClient {\n public readonly createAudio: CreateAudio;\n public readonly createCharacter: CreateCharacter;\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.createAudio = new CreateAudio(http);\n this.createCharacter = new CreateCharacter(http);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\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 CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/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","export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,wBAA4C;;;ACCrD,SAAS,qBAAqB;AAG9B,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,SAAS,iBAAAA,sBAAqB;AAG9B,IAAMC,YAAW;AAEV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,SAAS,iBAAAE,sBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAMC,YAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGC,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO,iBAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,kBAAkB,IAAI,gBAAgB,IAAI;AAC/C,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;AIdA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","ENDPOINT","compactParams","ENDPOINT"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/create-audio.ts","../src/contract_gen.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Gemini Omni multimodal generation client for voice presets, character creation,\n * and text-to-video with optional characters, audio voices, and reference media.\n *\n * @example\n * ```typescript\n * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';\n * const client = new GeminiOmniClient({ apiKey: 'sk-...' });\n *\n * // Create a voice preset, then generate a video using it\n * const audio = await client.createAudio.run({\n * audio_id: 'zephyr',\n * name: 'Narrator',\n * });\n * const video = await client.textToVideo.run({\n * prompt: 'A narrator walks through a futuristic city',\n * duration_seconds: 6,\n * audio_ids: [audio.audio!.id],\n * });\n * console.log(video.videos[0].url);\n * ```\n */\nexport class GeminiOmniClient extends BaseClient {\n /** Registers a reusable voice preset from a built-in voice identity (synchronous). */\n public readonly createAudio: CreateAudio;\n /** Builds a reusable character from a reference image and description (synchronous). */\n public readonly createCharacter: CreateCharacter;\n /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.createAudio = new CreateAudio(this.http);\n this.createCharacter = new CreateCharacter(this.http);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-audio';\n\n/**\n * Registers a reusable voice preset from a built-in voice identity.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a reusable voice preset (synchronous).\n * @param params Voice preset parameters.\n * @param options Per-request overrides.\n * @returns The created audio voice preset.\n */\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n const body = compactParams(params);\n validateParams(contract['create-audio'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","export const contract = {\n \"create-audio\": {\n \"models\": [\n \"gemini-omni-audio\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-audio\": {\n \"audio_id\": {\n \"required\": true\n },\n \"name\": {\n \"required\": true\n }\n }\n }\n },\n \"create-character\": {\n \"models\": [\n \"gemini-omni-character\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-character\": {\n \"descriptions\": {\n \"required\": true\n },\n \"reference_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"gemini-omni-text-to-video\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 4,\n 6,\n 8,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\",\n \"4k\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-character';\n\n/**\n * Builds a reusable character from a reference image and description.\n * Attach audio IDs to give the character a specific voice.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Build a reusable character (synchronous).\n * @param params Character creation parameters.\n * @param options Per-request overrides.\n * @returns The created character.\n */\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n const body = compactParams(params);\n validateParams(contract['create-character'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-text-to-video';\n\n/**\n * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.\n * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.\n */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text-to-video result.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video status.\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","export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n"],"mappings":"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","names":["compactParams","validateParams","ENDPOINT","MODEL","compactParams","validateParams","compactParams","validateParams","ENDPOINT","MODEL","compactParams","validateParams"]}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@runapi.ai/gemini-omni",
3
- "version": "0.2.6",
4
- "description": "RunAPI Gemini Omni SDK for audio, character, and video workflows in JavaScript, Ruby, and Go",
3
+ "runapi": {
4
+ "slug": "gemini-omni"
5
+ },
6
+ "version": "0.2.8",
7
+ "description": "RunAPI Gemini Omni SDK for audio, character, and video workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
5
8
  "main": "./dist/index.js",
6
9
  "module": "./dist/index.mjs",
7
10
  "types": "./dist/index.d.ts",
@@ -28,7 +31,7 @@
28
31
  "clean": "rm -rf dist"
29
32
  },
30
33
  "dependencies": {
31
- "@runapi.ai/core": "^0.2.5"
34
+ "@runapi.ai/core": "^0.2.11"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@types/node": "^20.0.0",
@@ -49,12 +52,17 @@
49
52
  "audio",
50
53
  "character",
51
54
  "video",
52
- "image",
53
55
  "api",
54
56
  "sdk",
55
57
  "typescript",
58
+ "python",
56
59
  "ruby",
57
- "golang"
60
+ "golang",
61
+ "java",
62
+ "maven",
63
+ "gradle",
64
+ "multimodal",
65
+ "ai-video"
58
66
  ],
59
67
  "author": "RunAPI",
60
68
  "license": "Apache-2.0",
@@ -62,5 +70,8 @@
62
70
  "repository": {
63
71
  "type": "git",
64
72
  "url": "git+https://github.com/runapi-ai/gemini-omni-sdk.git"
73
+ },
74
+ "bugs": {
75
+ "url": "https://github.com/runapi-ai/gemini-omni-sdk/issues"
65
76
  }
66
77
  }
@@ -68,6 +68,11 @@ runapi wait <task-id> --service gemini-omni --action text-to-video
68
68
  - Provider comparison: https://runapi.ai/providers/google
69
69
  - Browse all RunAPI models and skills: https://runapi.ai/models
70
70
 
71
+ ## Agent rules
72
+
73
+ - Integration work uses the target language SDK; one-off generation, manual smoke tests, debugging, or user-requested CLI runs use the RunAPI CLI skill: https://github.com/runapi-ai/cli-skill
74
+ - RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
75
+
71
76
  ## License
72
77
 
73
78
  Licensed under the Apache License, Version 2.0.
@@ -25,10 +25,19 @@ metadata:
25
25
 
26
26
  Create Gemini Omni voice resources, character resources, and text-to-video tasks through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
27
27
 
28
- ## Routing decision
28
+ ## Critical: Integration Runtime
29
29
 
30
- - One-off voice, character, or video generation for the user use the **CLI path** with the `runapi` binary.
31
- - Building an app, backend, worker, library, or production codebase use the **SDK integration path**.
30
+ - Integration work (app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production codebase) uses the **SDK integration path** for the target language.
31
+ - One-off generation, editing, transformation, manual smoke tests, debugging, or user-requested CLI runs use the **CLI path** with the `runapi` binary. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill.
32
+ - Never shell out to the `runapi` CLI as the production runtime integration layer.
33
+
34
+ ## SDK integration path
35
+
36
+ When integrating Gemini Omni into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37
+
38
+ - JavaScript / TypeScript: `@runapi.ai/gemini-omni`
39
+ - Ruby: `runapi-gemini-omni`
40
+ - Go: `github.com/runapi-ai/gemini-omni-sdk/go`
32
41
 
33
42
  ## Variants
34
43
 
@@ -38,7 +47,7 @@ Create Gemini Omni voice resources, character resources, and text-to-video tasks
38
47
 
39
48
  ## CLI path
40
49
 
41
- The `runapi` binary is the runtime dependency. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config.
50
+ The `runapi` binary is the one-off and manual testing runtime dependency. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config.
42
51
 
43
52
  Inspect the available commands and request fields with CLI help:
44
53
 
@@ -64,13 +73,9 @@ runapi wait <task-id> --service gemini-omni --action text-to-video
64
73
 
65
74
  Available commands: `create-audio`, `create-character`, `text-to-video`.
66
75
 
67
- ## SDK integration path
68
-
69
- When integrating Gemini Omni into an app, backend, worker, or library — not for one-off tasks — use a RunAPI SDK package:
76
+ ## Generated file storage
70
77
 
71
- - JavaScript / TypeScript: `@runapi.ai/gemini-omni`
72
- - Ruby: `runapi-gemini-omni`
73
- - Go: `github.com/runapi-ai/gemini-omni-sdk/go`
78
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
74
79
 
75
80
  ## References
76
81