---
title: "Record run costs"
method: POST
path: "/v1/projects/{project_id}/runs/{run_id}/cost-items"
tags: ["runs"]
---

# Record run costs

`POST /v1/projects/{project_id}/runs/{run_id}/cost-items`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/runs/{run_id}/cost-items`
- Auth: HTTP bearer

Records costs from outside connic on a run, such as a translation or OCR service.

The items show on the run and count in its cost, in Budgets, spend alerts and limits, and dashboards. connic never bills them.
An item with an `external_id` that the run already holds replaces that item, so retries and corrected prices don't count twice.
A run holds at most 1000 items; each request records 1 to 100.

Required permission: `runs.costs.record`.

## Path parameters

- `project_id` string, uuid, required
- `run_id` string, uuid, required

## Request body

- RunCostItemsRequest
  - `items` RunCostItemInput[], required
    - `source` string, required: Where the cost comes from, for example `translation`.
    - `amount` union, required: Amount in `currency`.
      - number
      - string
    - `currency` 'EUR' | 'USD', required
    - `description` string, nullable: Short note on what the cost is for.
    - `quantity` union: How much was used, for example translated characters.
      - number
      - string
    - `unit` string, nullable: Unit of `quantity`, for example `characters`.
    - `external_id` string, nullable: Your identifier for the cost. Recording the same `external_id` on a run again replaces the item.

## Response `200`

Successful Response

- PublicRunCostItemResponse[]
  - `id` string, uuid, required
  - `source` string, required: Where the cost comes from, for example `translation` or `ocr`.
  - `description` string, nullable, required: Short note on what the cost is for. Empty after the run is deleted.
  - `amount` string, required: Amount as a decimal string with 12 decimal places.
  - `currency` 'EUR' | 'USD', required
  - `quantity` string, nullable, required: How much was used, as a decimal string, for example translated characters.
  - `unit` string, nullable, required: Unit of `quantity`, for example `characters` or `pages`.
  - `external_id` string, nullable, required: Your identifier for the cost. Recording the same `external_id` on a run again replaces the item.
  - `occurred_at` string, date-time, required: When the item was first recorded. Budgets count it in this period.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

## Changes

- **2026-11-21** `93c92c49aafa`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/connic/apis/connic-api/changes/v1/projects/:project_id/runs/:run_id/cost-items/post.md)

---

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