Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References

RunFinishedEvent

Interface: RunFinishedEvent

Defined in: packages/typescript/ai/src/types.ts:812

Emitted when a run completes successfully.

@ag-ui/core provides: threadId, runId, result? TanStack AI adds: model?, finishReason?, usage?

Extends

  • RunFinishedEvent

Indexable

ts
[k: string]: unknown
[k: string]: unknown

Properties

finishReason?

ts
optional finishReason: "length" | "stop" | "content_filter" | "tool_calls" | null;
optional finishReason: "length" | "stop" | "content_filter" | "tool_calls" | null;

Defined in: packages/typescript/ai/src/types.ts:816

Why the generation stopped


model?

ts
optional model: string;
optional model: string;

Defined in: packages/typescript/ai/src/types.ts:814

Model identifier for multi-model support


usage?

ts
optional usage: object;
optional usage: object;

Defined in: packages/typescript/ai/src/types.ts:818

Token usage statistics

completionTokens

ts
completionTokens: number;
completionTokens: number;

promptTokens

ts
promptTokens: number;
promptTokens: number;

totalTokens

ts
totalTokens: number;
totalTokens: number;