Overview

The getRunById method allows you to get a run by its ID.

Usage

import Itzam from "itzam";

const itzam = new Itzam("YOUR_API_KEY");

const response = await itzam.getRunById(runId);

Parameters

ParameterTypeDescription
runIdstringThe ID of the run to get.

Return Value

The getRunById method returns the following object:

type GetRunByIdResponse = {
  origin: string; // Origin of the run (WEB | 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
  groupId: string | null; // The group ID of the run
  model: {
    name: string; // The name of the model
    tag: string; // The tag of the model
  };
  workflowId: string; // The ID of the workflow
  createdAt: string; // The date and time the run was created/executed
};