Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.11.0"
".": "4.12.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 57
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-33021d52306cc82f369d7ad1d391bc94fd5a377d4a92be35ece073b73f64a454.yml
openapi_spec_hash: d70a1ddd98e8aff8e1d298ff9c21b343
config_hash: 6bdea3c3109ee75952f779d566c229ea
configured_endpoints: 59
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-a31e62dafc005582320d354e7aed335c8df690338ca539c055aa4a5637b9ad3b.yml
openapi_spec_hash: ab95f9ae7163b960171e68f4ff95da4e
config_hash: 95e64e640428abd4184a48762d9fd5f8
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 4.12.0 (2026-07-23)

Full Changelog: [v4.11.0...v4.12.0](https://github.com/runwayml/sdk-node/compare/v4.11.0...v4.12.0)

### Features

* **api:** add Model Router image and audio generation ([fcf6b45](https://github.com/runwayml/sdk-node/commit/fcf6b458f5dac025834a26b68098e175d0677916))
* **api:** expose generate image and audio endpoints ([babe552](https://github.com/runwayml/sdk-node/commit/babe5528cccd693ec6e30f94db59ffa5b3e708c0))


### Bug Fixes

* **client:** make generate.image and generate.audio responses awaitable ([331945f](https://github.com/runwayml/sdk-node/commit/331945fe026d13ea866d8888c00ec5195a3408c7))

## 4.11.0 (2026-07-21)

Full Changelog: [v4.10.0...v4.11.0](https://github.com/runwayml/sdk-node/compare/v4.10.0...v4.11.0)
Expand Down
20 changes: 20 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,26 @@ Methods:

- <code title="post /v1/generate/video">client.generate.video.<a href="./src/resources/generate/video.ts">create</a>({ ...params }) -> VideoCreateResponse</code>

## Image

Types:

- <code><a href="./src/resources/generate/image.ts">ImageCreateResponse</a></code>

Methods:

- <code title="post /v1/generate/image">client.generate.image.<a href="./src/resources/generate/image.ts">create</a>({ ...params }) -> ImageCreateResponse</code>

## Audio

Types:

- <code><a href="./src/resources/generate/audio.ts">AudioCreateResponse</a></code>

Methods:

- <code title="post /v1/generate/audio">client.generate.audio.<a href="./src/resources/generate/audio.ts">create</a>({ ...params }) -> AudioCreateResponse</code>

# Routers

Types:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runwayml/sdk",
"version": "4.11.0",
"version": "4.12.0",
"description": "The official TypeScript library for the RunwayML API",
"author": "RunwayML <dev-feedback@runwayml.com>",
"types": "dist/index.d.ts",
Expand Down
265 changes: 265 additions & 0 deletions src/resources/generate/audio.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import { RequestOptions } from '../../internal/request-options';
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../../lib/polling';

export class Audio extends APIResource {
/**
* Start an audio generation task using a saved Model Router config instead of
* naming a model. Set input.type to speech to speak promptText verbatim, or audio
* to generate audio described by promptText.
*/
create(
body: AudioCreateParams,
options?: RequestOptions,
): APIPromiseWithAwaitableTask<AudioCreateResponse> {
return wrapAsWaitableResource<AudioCreateResponse>(this._client)(
this._client.post('/v1/generate/audio', { body, ...options }),
);
}
}

export interface AudioCreateResponse {
/**
* The ID of the created task. Poll GET /v1/tasks/:id for the result.
*/
id: string;

/**
* Metadata describing which model the router selected and why.
*/
routing: AudioCreateResponse.Routing;
}

export namespace AudioCreateResponse {
/**
* Metadata describing which model the router selected and why.
*/
export interface Routing {
/**
* The slug of the router config that was applied to this request.
*/
configId: string;

/**
* Estimated cost, computed against current pricing.
*/
estimatedCost: Routing.EstimatedCost;

/**
* The public name of the model the router selected.
*/
model: string;

/**
* The provider of the selected model.
*/
provider: string;

/**
* Request-side defaults resolved for the routing response. Not necessarily
* identical to prepared model options.
*/
resolvedInput: Routing.ResolvedInput;

/**
* The resolved config settings the router used for this request.
*/
resolvedSettings: Routing.ResolvedSettings;
}

export namespace Routing {
/**
* Estimated cost, computed against current pricing.
*/
export interface EstimatedCost {
/**
* Estimated cost of the generation in credits.
*/
credits: number;
}

/**
* Request-side defaults resolved for the routing response. Not necessarily
* identical to prepared model options.
*/
export interface ResolvedInput {
/**
* The prompt mode the router routed for.
*/
type: 'speech' | 'audio';

/**
* How the selected model resolves the voice: the requested preset or
* reference-audio clone, the model default for voiceless speech, or none for
* general audio.
*/
voice: 'preset' | 'reference-audio' | 'default' | 'none';
}

/**
* The resolved config settings the router used for this request.
*/
export interface ResolvedSettings {
/**
* The single optimization preference the config selected, used as the soft
* weighting when scoring eligible models.
*/
optimizeFor: 'cost' | 'latency' | 'quality';

/**
* The applied maximum credits per generation for this request鈥檚 modality, or null
* if the config sets no ceiling.
*/
priceCeiling: number | null;
}
}
}

export interface AudioCreateParams {
/**
* The slug of a saved Model Router config to route this request with.
*/
configId: string;

/**
* Model-agnostic audio generation input. The router selects a model and maps these
* options to it.
*/
input: AudioCreateParams.Input;
}

export namespace AudioCreateParams {
/**
* Model-agnostic audio generation input. The router selects a model and maps these
* options to it.
*/
export interface Input {
/**
* For `speech`, the words to speak. For `audio`, a description of the desired
* output.
*/
promptText: string;

/**
* How promptText is interpreted: `speech` speaks it verbatim as a script; `audio`
* treats it as a description of the desired audio, which may combine speech,
* music, ambience, and sound effects.
*/
type: 'speech' | 'audio';

/**
* Desired output duration in seconds for `audio` generation. Models that cannot
* honor an explicit duration are excluded.
*/
duration?: number;

/**
* When true, the `audio` output is designed to loop seamlessly. Models without
* loop support are excluded.
*/
loop?: boolean;

/**
* Optional reference audio clips guiding `audio` generation, for models that
* support them. Reference each clip in promptText as @Audio1, @Audio2, and @Audio3
* in order.
*/
referenceAudios?: Array<Input.ReferenceAudio>;

/**
* The voice to speak with. When omitted, models that support a default voice
* remain eligible.
*/
voice?: Input.Preset | Input.ReferenceAudio;
}

export namespace Input {
export interface ReferenceAudio {
/**
* A HTTPS URL.
*/
uri: string;
}

/**
* A preset voice.
*/
export interface Preset {
/**
* A Runway preset voice id. Choosing a preset routes only to models that support
* preset voices.
*/
presetId:
| 'Maya'
| 'Arjun'
| 'Serene'
| 'Bernard'
| 'Billy'
| 'Mark'
| 'Clint'
| 'Mabel'
| 'Chad'
| 'Leslie'
| 'Eleanor'
| 'Elias'
| 'Elliot'
| 'Grungle'
| 'Brodie'
| 'Sandra'
| 'Kirk'
| 'Kylie'
| 'Lara'
| 'Lisa'
| 'Malachi'
| 'Marlene'
| 'Martin'
| 'Miriam'
| 'Monster'
| 'Paula'
| 'Pip'
| 'Rusty'
| 'Ragnar'
| 'Xylar'
| 'Maggie'
| 'Jack'
| 'Katie'
| 'Noah'
| 'James'
| 'Rina'
| 'Ella'
| 'Mariah'
| 'Frank'
| 'Claudia'
| 'Niki'
| 'Vincent'
| 'Kendrick'
| 'Myrna'
| 'Tom'
| 'Wanda'
| 'Benjamin'
| 'Kiana'
| 'Rachel';

type: 'preset';
}

/**
* Clone a voice from a reference audio clip, then speak promptText in that voice.
* Routes only to models that support voice cloning.
*/
export interface ReferenceAudio {
/**
* A HTTPS URL.
*/
audioUri: string;

type: 'reference-audio';
}
}
}

export declare namespace Audio {
export { type AudioCreateResponse as AudioCreateResponse, type AudioCreateParams as AudioCreateParams };
}
20 changes: 20 additions & 0 deletions src/resources/generate/generate.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import * as AudioAPI from './audio';
import { Audio, AudioCreateParams, AudioCreateResponse } from './audio';
import * as ImageAPI from './image';
import { Image, ImageCreateParams, ImageCreateResponse } from './image';
import * as VideoAPI from './video';
import { Video, VideoCreateParams, VideoCreateResponse } from './video';

export class Generate extends APIResource {
video: VideoAPI.Video = new VideoAPI.Video(this._client);
image: ImageAPI.Image = new ImageAPI.Image(this._client);
audio: AudioAPI.Audio = new AudioAPI.Audio(this._client);
}

Generate.Video = Video;
Generate.Image = Image;
Generate.Audio = Audio;

export declare namespace Generate {
export {
Video as Video,
type VideoCreateResponse as VideoCreateResponse,
type VideoCreateParams as VideoCreateParams,
};

export {
Image as Image,
type ImageCreateResponse as ImageCreateResponse,
type ImageCreateParams as ImageCreateParams,
};

export {
Audio as Audio,
type AudioCreateResponse as AudioCreateResponse,
type AudioCreateParams as AudioCreateParams,
};
}
Loading
Loading