## Get a run

`client.generations.retrieve(stringrunID, RequestOptionsoptions?): GenerationRetrieveResponse`

**get** `/runs/{runId}`

Returns status and completed output URLs for a public API run, including action runs started through POST /runs/action.

### Parameters

- `runID: string`

  Run identifier

### Returns

- `GenerationRetrieveResponse`

  - `created_at: number`

  - `progress: number`

  - `run_id: string`

    Run identifier

  - `status: "pending" | "running" | "completed" | "failed"`

    - `"pending"`

    - `"running"`

    - `"completed"`

    - `"failed"`

  - `charged_cost?: number`

    Cost charged in USD

  - `completed_at?: number`

  - `error_code?: string`

    Machine-readable run error code

  - `error_message?: string`

    Human-readable run error message

  - `outputs?: Array<Output>`

    - `output_id: string`

      Run output identifier

    - `type: "imageUrl" | "videoUrl" | "audioUrl" | 2 more`

      Run output media type

      - `"imageUrl"`

      - `"videoUrl"`

      - `"audioUrl"`

      - `"text"`

      - `"documentUrl"`

    - `url: string`

      Run output URL or text content

  - `poll_url?: string`

    URL to poll pending/running runs or fetch completed/failed run details.

  - `started_at?: number`

### Example

```typescript
import FLORA from '@flora-ai/flora';

const client = new FLORA({
  apiKey: process.env['FLORA_API_KEY'], // This is the default and can be omitted
});

const generation = await client.generations.retrieve('run_abc123');

console.log(generation.run_id);
```

#### Response

```json
{
  "created_at": 0,
  "progress": 0,
  "run_id": "run_abc123",
  "status": "pending",
  "charged_cost": 0,
  "completed_at": 0,
  "error_code": "provider_error",
  "error_message": "The provider failed to complete the generation.",
  "outputs": [
    {
      "output_id": "output_1",
      "type": "imageUrl",
      "url": "https://media.flora.ai/output.png"
    }
  ],
  "poll_url": "https://example.com",
  "started_at": 0
}
```
