runs

Record run costs

Changed on

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.

post/v1/projects/{project_id}/runs/{run_id}/cost-items

Request

  • Base URL
    https://api.connic.co
  • Auth
    HTTP bearer

Path parameters

project_id, string uuid required

ID of the project the API key belongs to.

run_id, string uuid required

Run ID from GET /runs.

Request body

RunCostItemsRequest required
items, RunCostItemInput[] required

Response

Successful Response

PublicRunCostItemResponse[] required
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.

Changes