---
title: "Stop performance trace"
method: POST
path: "/v1/browser/trace/stop"
tags: ["Browser"]
---

# Stop performance trace

`POST /v1/browser/trace/stop`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/browser/trace/stop`
- Auth: HTTP bearer

Stops the active trace and returns web vitals, performance metrics, and trace duration.

## Response `200`

Trace result with vitals and metrics

- TraceResult
  - `vitals` WebVitals, required
    - `lcp` number, nullable: Largest Contentful Paint (ms)
    - `fcp` number, nullable: First Contentful Paint (ms)
    - `cls` number, nullable: Cumulative Layout Shift
    - `tbt` number, nullable: Total Blocking Time (ms)
  - `metrics` PerformanceMetrics, required
    - `jsHeapUsedSize` number, nullable
    - `jsHeapTotalSize` number, nullable
    - `documents` integer, nullable
    - `frames` integer, nullable
    - `jsEventListeners` integer, nullable
    - `layoutCount` integer, nullable
    - `recalcStyleCount` integer, nullable
    - `layoutDuration` number, nullable
    - `recalcStyleDuration` number, nullable
    - `scriptDuration` number, nullable
    - `taskDuration` number, nullable
    - `timestamp` number, required
  - `durationMs` number, required

## Other responses

- `400`: Trace error (e.g. not tracing)
- `503`: Browser service not initialized

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
