---
title: "Record performance metrics from client"
method: POST
path: "/_temps/speed"
tags: ["Performance"]
---

# Record performance metrics from client

`POST /_temps/speed`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/_temps/speed`
- Auth: none declared

## Query parameters

- `temps_key` string

## Headers

- `x-temps-analytics-key` string, nullable

## Request body

- SpeedMetricsPayload: Speed metrics payload for recording web vitals
  - `cls` number, float, nullable: Cumulative Layout Shift (score)
  - `fcp` number, float, nullable: First Contentful Paint (milliseconds)
  - `fid` number, float, nullable: First Input Delay (milliseconds)
  - `inp` number, float, nullable: Interaction to Next Paint (milliseconds)
  - `language` string, nullable: Browser language
  - `lcp` number, float, nullable: Largest Contentful Paint (milliseconds)
  - `pathname` string, nullable: Page pathname
  - `query` string, nullable: Query string
  - `referrer` string, nullable: The referrer of the page measured (`document.referrer` when it loaded, `""` when it had none), so the project's referrer rules and the spam list apply to its samples as they apply to its page view. Older SDKs omit it; their samples follow the session's latest page view of the same path instead.
  - `screenHeight` integer, nullable: Screen height in pixels
  - `screenWidth` integer, nullable: Screen width in pixels
  - `sessionId` string, nullable: Client-generated session id fallback (see `visitor_id`).
  - `ttfb` number, float, nullable: Time to First Byte (milliseconds)
  - `viewportHeight` integer, nullable: Viewport height in pixels
  - `viewportWidth` integer, nullable: Viewport width in pixels
  - `visitorId` string, nullable: Client-generated visitor id, used only when the request carries no Temps-issued `_temps_visitor_id` cookie — i.e. Temps is used purely as an analytics backend for an app it doesn't deploy/proxy (gotempsh/temps#848).

## Response `204`

Metrics recorded successfully

## Other responses

- `400`: Bad request
- `404`: Host not found in route table
- `500`: Internal server error

## Changes

- **2026-10-30** `0c5d6f73ba5b`: 1 info
  - added the new optional request property `referrer`
- **2026-09-07** `c2a1f69745e7`: 4 info
  - added the new optional `header` request parameter `x-temps-analytics-key`
  - added the new optional `query` request parameter `temps_key`
  - added the new optional request property `sessionId`
  - added the new optional request property `visitorId`
- **2026-09-07** `7a3103561bd0`: 4 warning
  - deleted the `header` request parameter `x-temps-analytics-key`
  - deleted the `query` request parameter `temps_key`
  - removed the request property `sessionId`
  - removed the request property `visitorId`
- **2026-09-07** `7fcff272f099`: 4 info
  - added the new optional `header` request parameter `x-temps-analytics-key`
  - added the new optional `query` request parameter `temps_key`
  - added the new optional request property `sessionId`
  - added the new optional request property `visitorId`
- **2026-09-07** `c1fa498b6377`: 4 warning
  - deleted the `header` request parameter `x-temps-analytics-key`
  - deleted the `query` request parameter `temps_key`
  - removed the request property `sessionId`
  - removed the request property `visitorId`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/_temps/speed/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
