--- title: Models | Scenario Docs description: API reference for enhanced model methods. --- The `models` resource is enhanced so that `retrieve()` returns a response where `response.model` has a `.run()` method. All original methods (`create`, `retrieve`, `update`, `list`, `delete`) are inherited. --- ## `client.models.retrieve(modelID)` Get a model by ID. Returns an enhanced response where `response.model` has `.run()`. **Signature** ``` client.models.retrieve( modelID: string, query?: ModelRetrieveParams | null, options?: RequestOptions, ): APIPromise ``` **Parameters** | Name | Type | Description | | --------- | ----------------------------- | -------------------------- | | `modelID` | `string` | The model ID to retrieve. | | `query?` | `ModelRetrieveParams \| null` | Optional query parameters. | **Returns** `APIPromise` — the standard retrieve response with `model` enhanced: | Property | Type | Description | | -------- | ------------------------------------------- | ---------------------------------------- | | `model` | `ModelRetrieveResponse.Model & ModelEntity` | All original model fields plus `.run()`. | **Example** ``` import Scenario from '@scenario-labs/sdk'; const client = new Scenario({ apiKey: '...' }); const { model } = await client.models.retrieve('model_...'); console.log(model.id); // original field console.log(model.name); // original field ``` --- ## `model.run(params)` Available on `response.model` after calling `client.models.retrieve()`. Generates with this model. Shortcut for `client.generate.runModel(model.id, params)` — no need to repeat the model ID. Returns an enhanced response where `response.job` has `.wait()`. See [Jobs](/sdk-helpers/jobs/index.md) for the full `.wait()` reference. **Signature** ``` response.model.run( params: GenerateRunModelParams, options?: RequestOptions, ): APIPromise> ``` **Parameters** | Name | Type | Description | | ---------------- | --------- | --------------------------------------------- | | `params.body` | `object` | Model-specific inputs (prompt, images, etc.). | | `params.dryRun?` | `unknown` | If set, validates without executing. | **Returns** `APIPromise>` — a generate response where `response.job` has `.wait()`. **Example** ``` import Scenario from '@scenario-labs/sdk'; const client = new Scenario({ apiKey: '...' }); const { model } = await client.models.retrieve('model_...'); const response = await model.run({ body: { prompt: 'a medieval shield with dragon emblem' }, }); const completed = await response.job.wait(); console.log(completed.status); // 'success' console.log(completed.metadata?.assetIds); ``` Tip `model.run()` is equivalent to `client.generate.runModel(model.id, params)` — use whichever is more convenient. Both return the same enhanced response.