Open History to see the last commit
1---
2id: getVideoJobStatus
3title: getVideoJobStatus
4---
5
6# Function: getVideoJobStatus()
7
8```ts
9function getVideoJobStatus<TAdapter>(options): Promise<{
10 error?: string;
11 progress?: number;
12 status: "pending" | "processing" | "completed" | "failed";
13 url?: string;
14}>;
15```
16
17Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:447](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L447)
18
19**`Experimental`**
20
21Get video job status - returns the current status, progress, and URL if available.
22
23This function combines status checking and URL retrieval. If the job is completed,
24it will automatically fetch and include the video URL.
25
26 Video generation is an experimental feature and may change.
27
28## Type Parameters
29
30### TAdapter
31
32`TAdapter` *extends* [`VideoAdapter`](../interfaces/VideoAdapter.md)\<`string`, `any`, `any`, `any`\>
33
34## Parameters
35
36### options
37
38#### adapter
39
40`TAdapter` & `object`
41
42#### jobId
43
44`string`
45
46## Returns
47
48`Promise`\<\{
49 `error?`: `string`;
50 `progress?`: `number`;
51 `status`: `"pending"` \| `"processing"` \| `"completed"` \| `"failed"`;
52 `url?`: `string`;
53\}\>
54
55## Example
56
57```ts
58import { getVideoJobStatus } from '@tanstack/ai'
59import { openaiVideo } from '@tanstack/ai-openai'
60
61const result = await getVideoJobStatus({
62 adapter: openaiVideo('sora-2'),
63 jobId: 'job-123'
64})
65
66console.log('Status:', result.status)
67console.log('Progress:', result.progress)
68if (result.url) {
69 console.log('Video URL:', result.url)
70}
71```