---
title: "Get project factory cost"
method: GET
path: "/experimental/projects/{projectId}/factory/metrics/cost"
tags: ["Projects"]
---

# Get project factory cost

`GET /experimental/projects/{projectId}/factory/metrics/cost`

## Request

- Base URL: `https://api.tessl.io`
- URL: `https://api.tessl.io/experimental/projects/{projectId}/factory/metrics/cost`
- Auth: none declared

Sums the Tessl credits of this project's finished runs on factory PRs in the requested window (`filter[timestamp][gte]` to the exclusive `filter[timestamp][lt]`, at most 90 days, the last 7 days when neither is given) and in the window of the same length just before it, by run creation time. A factory PR is one a project run produced; its earliest producing run is the opening run, which always counts. Every other run on it created before the PR merged is a follow-up; one created at or after the merge is not counted, and a PR with no recorded merge counts every follow-up. `prsOpened` counts the PRs whose opening run is in the window. A run on several PRs splits its credits evenly between them. `series` has one point per UTC day that the current window touches, zeros included, and its points, each split into `firstRunCredits` and `followUpCredits`, add up to `current`. `GET .../factory/metrics/cost/prs` lists the PRs behind these totals and `.../cost/breakdown` groups them.

## Path parameters

- `projectId` string, uuid, required

## Query parameters

- `filter[timestamp][gte]` string, date-time
- `filter[timestamp][lt]` string, date-time

## Headers

- `Authorization` string

## Response `200`

Default Response

- object
  - `links` object, required
    - `self` string, uri, required
  - `data` object, required
    - `id` string, uuid, required
    - `type` 'project-factory-cost', required
    - `attributes` object, required
      - `current` object, required
        - `start` string, date-time, required
        - `end` string, date-time, required
        - `prsOpened` integer, required
        - `prCredits` number, required
        - `firstRunCredits` number, required
        - `followUpCredits` number, required
      - `previous` object, required
        - `start` string, date-time, required
        - `end` string, date-time, required
        - `prsOpened` integer, required
        - `prCredits` number, required
        - `firstRunCredits` number, required
        - `followUpCredits` number, required
      - `series` object[], required
        - `day` string, required
        - `prsOpened` integer, required
        - `prCredits` number, required
        - `firstRunCredits` number, required
        - `followUpCredits` number, required

## Other responses

- `401`: Unauthorized
- `403`: Default Response
- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2026-10-29** `06d2142ed144`: 1 info
  - api operation id `getProjectFactoryMetricCost` was added
- **2026-10-29** `68c1ace37d92`: 2 info
  - added the required property `data/attributes/series/items/firstRunCredits` to the response with the `200` status
  - added the required property `data/attributes/series/items/followUpCredits` to the response with the `200` status
- **2026-10-27** `e39470442d44`: 3 info
  - added the new optional `query` request parameter `filter[timestamp][gte]`
  - added the new optional `query` request parameter `filter[timestamp][lt]`
  - added the required property `data/attributes/series` to the response with the `200` status
- **2026-10-27** `e13cd45ac8bd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tessl/apis/tessl-api/changes/experimental/projects/:projectId/factory/metrics/cost/get.md)

---

[API](https://skmtc.dev/tessl/apis/tessl-api.md) - [All operations](https://skmtc.dev/tessl/apis/tessl-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tessl/apis/tessl-api/revisions/4fa2a17154e4?raw)
