JavaScript & TypeScript
Get Run By Id
Get a run by its ID.
Usage
Copy
import Itzam from "itzam";
const itzam = new Itzam("YOUR_API_KEY");
const response = await itzam.getRunById(runId);
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
runId | string | Yes | The ID of the run to get. |
Return Value
The getRunById
method returns the following object:
Copy
type GetRunByIdResponse = {
id: string; // The ID of the run
origin: string; // Origin of the run (WEB is it's from Playground, SDK is it's from the SDK)
status: string; // Status of the run (RUNNING | COMPLETED | FAILED)
input: string; // The user's input
output: string | null; // The model's output
prompt: string; // The system prompt
inputTokens: number; // The number of input tokens used for this run
outputTokens: number; // The number of output tokens used for this run
cost: string; // The cost in USD
durationInMs: number; // The duration of the run in milliseconds
threadId: string | null; // The thread ID of the run
model: {
name: string; // The name of the model
tag: string; // The tag of the model
};
attachments: Array<{
id: string; // The ID of the attachment
url: string; // The URL of the attachment
mimeType: string; // The MIME type of the attachment
}>;
knowledge: Array<{
id: string; // The ID of the knowledge
title: string | null; // The title of the knowledge
url: string | null; // The URL of the knowledge
type: string | null; // The type of the knowledge
}>;
workflowId: string; // The ID of the workflow
createdAt: string; // The date and time the run was created/executed
};
On this page
Assistant
Responses are generated using AI and may contain mistakes.