Langfuse JS/TS SDKs
    Preparing search index...

    Interface ObservationV2

    An observation from the v2 API with field-group-based selection. Core fields are always present. Other fields are included only when their field group is requested.

    interface ObservationV2 {
        bookmarked?: boolean;
        completionStartTime?: string | null;
        costDetails?: Record<string, number>;
        createdAt?: string;
        endTime: string | null;
        environment?: string | null;
        id: string;
        input?: unknown;
        internalModelId?: string | null;
        latency?: number | null;
        level?: ObservationLevel;
        metadata?: unknown;
        modelId?: string | null;
        modelParameters?: unknown;
        name?: string | null;
        output?: unknown;
        parentObservationId: string | null;
        projectId: string;
        promptId?: string | null;
        promptName?: string | null;
        promptVersion?: number | null;
        providedModelName?: string | null;
        public?: boolean;
        sessionId?: string | null;
        startTime: string;
        statusMessage?: string | null;
        timeToFirstToken?: number | null;
        totalCost?: number | null;
        traceId: string | null;
        type: string;
        updatedAt?: string;
        usageDetails?: Record<string, number>;
        userId?: string | null;
        version?: string | null;
    }
    Index

    Properties

    bookmarked?: boolean

    Whether the observation is bookmarked

    completionStartTime?: string | null

    The completion start time of the observation

    costDetails?: Record<string, number>

    The cost details of the observation. Key is the cost metric name, value is the cost in USD.

    createdAt?: string

    The creation timestamp of the observation

    endTime: string | null

    The end time of the observation

    environment?: string | null

    The environment from which this observation originated

    id: string

    The unique identifier of the observation

    input?: unknown

    The input data of the observation

    internalModelId?: string | null

    The internal model ID matched by Langfuse

    latency?: number | null

    The latency in seconds

    The level of the observation

    metadata?: unknown

    Additional metadata of the observation

    modelId?: string | null

    The matched model ID

    modelParameters?: unknown

    The parameters of the model used for the observation

    name?: string | null

    The name of the observation

    output?: unknown

    The output data of the observation

    parentObservationId: string | null

    The parent observation ID

    projectId: string

    The project ID this observation belongs to

    promptId?: string | null

    The prompt ID associated with the observation

    promptName?: string | null

    The prompt name associated with the observation

    promptVersion?: number | null

    The prompt version associated with the observation

    providedModelName?: string | null

    The model name as provided by the user

    public?: boolean

    Whether the observation is public

    sessionId?: string | null

    The session ID associated with the observation

    startTime: string

    The start time of the observation

    statusMessage?: string | null

    The status message of the observation

    timeToFirstToken?: number | null

    The time to first token in seconds

    totalCost?: number | null

    The total cost of the observation in USD

    traceId: string | null

    The trace ID associated with the observation

    type: string

    The type of the observation (e.g. GENERATION, SPAN, EVENT)

    updatedAt?: string

    The last update timestamp of the observation

    usageDetails?: Record<string, number>

    The usage details of the observation. Key is the usage metric name, value is the number of units consumed.

    userId?: string | null

    The user ID associated with the observation

    version?: string | null

    The version of the observation