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.8.0"
".": "4.9.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: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-caa255c8f1c6fd2b54d331eeacc13de517b8dbaba491ef94745d107798b5eb7a.yml
openapi_spec_hash: d9f7b43604b06f389e2fc45376d0a519
config_hash: 955a0e451964a44778c5c0f54ca1c994
configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-d934e6804620f70a9a7d88bb3acf27146b57860ed56691e390e46027b3c04d4a.yml
openapi_spec_hash: 132fc1ce816bcfd680a239dc1ed58c8e
config_hash: 7caf94f26186e1ee432efcaa0b590bab
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.9.0 (2026-07-06)

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

### Features

* **api:** add ad_localization recipe ([85101d8](https://github.com/runwayml/sdk-node/commit/85101d8c177a9053b631238adaabb3d38875dfaa))

## 4.8.0 (2026-07-06)

Full Changelog: [v4.7.0...v4.8.0](https://github.com/runwayml/sdk-node/compare/v4.7.0...v4.8.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Methods:

Types:

- <code><a href="./src/resources/recipes.ts">RecipeAdLocalizationResponse</a></code>
- <code><a href="./src/resources/recipes.ts">RecipeMarketingStockImageResponse</a></code>
- <code><a href="./src/resources/recipes.ts">RecipeMultiShotVideoResponse</a></code>
- <code><a href="./src/resources/recipes.ts">RecipeProductAdResponse</a></code>
Expand All @@ -225,6 +226,7 @@ Types:

Methods:

- <code title="post /v1/recipes/ad_localization">client.recipes.<a href="./src/resources/recipes.ts">adLocalization</a>({ ...params }) -> RecipeAdLocalizationResponse</code>
- <code title="post /v1/recipes/marketing_stock_image">client.recipes.<a href="./src/resources/recipes.ts">marketingStockImage</a>({ ...params }) -> RecipeMarketingStockImageResponse</code>
- <code title="post /v1/recipes/multi_shot_video">client.recipes.<a href="./src/resources/recipes.ts">multiShotVideo</a>({ ...params }) -> RecipeMultiShotVideoResponse</code>
- <code title="post /v1/recipes/product_ad">client.recipes.<a href="./src/resources/recipes.ts">productAd</a>({ ...params }) -> RecipeProductAdResponse</code>
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.8.0",
"version": "4.9.0",
"description": "The official TypeScript library for the RunwayML API",
"author": "RunwayML <dev-feedback@runwayml.com>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ import {
RealtimeSessions,
} from './resources/realtime-sessions';
import {
RecipeAdLocalizationParams,
RecipeAdLocalizationResponse,
RecipeMarketingStockImageParams,
RecipeMarketingStockImageResponse,
RecipeMultiShotVideoParams,
Expand Down Expand Up @@ -1133,12 +1135,14 @@ export declare namespace RunwayML {

export {
Recipes as Recipes,
type RecipeAdLocalizationResponse as RecipeAdLocalizationResponse,
type RecipeMarketingStockImageResponse as RecipeMarketingStockImageResponse,
type RecipeMultiShotVideoResponse as RecipeMultiShotVideoResponse,
type RecipeProductAdResponse as RecipeProductAdResponse,
type RecipeProductCampaignImageResponse as RecipeProductCampaignImageResponse,
type RecipeProductSwapResponse as RecipeProductSwapResponse,
type RecipeProductUgcResponse as RecipeProductUgcResponse,
type RecipeAdLocalizationParams as RecipeAdLocalizationParams,
type RecipeMarketingStockImageParams as RecipeMarketingStockImageParams,
type RecipeMultiShotVideoParams as RecipeMultiShotVideoParams,
type RecipeProductAdParams as RecipeProductAdParams,
Expand Down
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ export {
} from './realtime-sessions';
export {
Recipes,
type RecipeAdLocalizationResponse,
type RecipeMarketingStockImageResponse,
type RecipeMultiShotVideoResponse,
type RecipeProductAdResponse,
type RecipeProductCampaignImageResponse,
type RecipeProductSwapResponse,
type RecipeProductUgcResponse,
type RecipeAdLocalizationParams,
type RecipeMarketingStockImageParams,
type RecipeMultiShotVideoParams,
type RecipeProductAdParams,
Expand Down
77 changes: 77 additions & 0 deletions src/resources/recipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ import { RequestOptions } from '../internal/request-options';
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';

export class Recipes extends APIResource {
/**
* Localize an existing ad image for a target language, preserving visual creative
* while adapting on-screen messaging.
*/
adLocalization(
body: RecipeAdLocalizationParams,
options?: RequestOptions,
): APIPromiseWithAwaitableTask<RecipeAdLocalizationResponse> {
return wrapAsWaitableResource<RecipeAdLocalizationResponse>(this._client)(
this._client.post('/v1/recipes/ad_localization', { body, ...options }),
);
}

/**
* Generate a polished marketing stock image from a text brief and optional brand
* logo image.
Expand Down Expand Up @@ -83,6 +96,13 @@ export class Recipes extends APIResource {
}
}

export interface RecipeAdLocalizationResponse {
/**
* The ID of the task that was created. Use this to retrieve the task later.
*/
id: string;
}

export interface RecipeMarketingStockImageResponse {
/**
* The ID of the task that was created. Use this to retrieve the task later.
Expand Down Expand Up @@ -125,6 +145,61 @@ export interface RecipeProductUgcResponse {
id: string;
}

export interface RecipeAdLocalizationParams {
/**
* Reference ad image to localize. See [our docs](/assets/inputs#images) on image
* inputs.
*/
referenceImage: RecipeAdLocalizationParams.ReferenceImage;

/**
* Target language for the localized ad. Use ISO-style codes (e.g. "ja" for
* Japanese, "es" for Spanish).
*/
targetLanguage:
| 'ar'
| 'zh'
| 'zh-Hant'
| 'nl'
| 'en'
| 'fr'
| 'de'
| 'hi'
| 'id'
| 'it'
| 'ja'
| 'ko'
| 'pl'
| 'pt'
| 'ru'
| 'es'
| 'sv'
| 'th'
| 'tr'
| 'uk'
| 'vi'
| 'el';

/**
* Workflow version. Use a dated version (e.g. "2026-06") to pin behavior, or
* "unsafe-latest" to track the newest stable version (may break without notice).
*/
version: '2026-06' | 'unsafe-latest';
}

export namespace RecipeAdLocalizationParams {
/**
* Reference ad image to localize. See [our docs](/assets/inputs#images) on image
* inputs.
*/
export interface ReferenceImage {
/**
* A HTTPS URL.
*/
uri: string;
}
}

export interface RecipeMarketingStockImageParams {
/**
* Marketing image brief. Describe the subject, audience, channel, desired mood,
Expand Down Expand Up @@ -561,12 +636,14 @@ export namespace RecipeProductUgcParams {

export declare namespace Recipes {
export {
type RecipeAdLocalizationResponse as RecipeAdLocalizationResponse,
type RecipeMarketingStockImageResponse as RecipeMarketingStockImageResponse,
type RecipeMultiShotVideoResponse as RecipeMultiShotVideoResponse,
type RecipeProductAdResponse as RecipeProductAdResponse,
type RecipeProductCampaignImageResponse as RecipeProductCampaignImageResponse,
type RecipeProductSwapResponse as RecipeProductSwapResponse,
type RecipeProductUgcResponse as RecipeProductUgcResponse,
type RecipeAdLocalizationParams as RecipeAdLocalizationParams,
type RecipeMarketingStockImageParams as RecipeMarketingStockImageParams,
type RecipeMultiShotVideoParams as RecipeMultiShotVideoParams,
type RecipeProductAdParams as RecipeProductAdParams,
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.8.0'; // x-release-please-version
export const VERSION = '4.9.0'; // x-release-please-version
23 changes: 23 additions & 0 deletions tests/api-resources/recipes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@ const client = new RunwayML({
});

describe('resource recipes', () => {
test('adLocalization: only required params', async () => {
const responsePromise = client.recipes.adLocalization({
referenceImage: { uri: 'https://example.com/file' },
targetLanguage: 'ar',
version: '2026-06',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

test('adLocalization: required and optional params', async () => {
const response = await client.recipes.adLocalization({
referenceImage: { uri: 'https://example.com/file' },
targetLanguage: 'ar',
version: '2026-06',
});
});

test('marketingStockImage: only required params', async () => {
const responsePromise = client.recipes.marketingStockImage({ prompt: 'x', version: '2026-06' });
const rawResponse = await responsePromise.asResponse();
Expand Down
Loading