CostRecord

  • The customer, by customerId or externalCustomerId. When both are given, customerId is used.

    Properties: 2
  • cost: an amount you were charged, in amount and currency. usage: a model call's tokens, in vendor, model and usage, priced from the model price list unless you give costOverride.

  • cost records, required: decimal amount in major units (dollars for USD).

  • usage records: what the call cost, instead of pricing its tokens from the price list.

    Properties: 2
  • cost records, required: USD or your company's own currency (any case). Amounts in your currency are converted to USD at your exchange rate.

  • Your unique ID for this record. A record whose key was used before is skipped. Keys don't expire.

  • Your own key-value data, kept with the record and returned as sent.

    Properties: 1
  • The model, as your vendor names it. Required for usage records; dated and prefixed names find their base model's price.

  • The product, by productId or externalProductId. When both are given, productId is used.

    Properties: 2
  • When the cost was incurred (ISO 8601). Default when the request arrives.

  • The trace the cost belongs to. A signal sent with the same data.trace_id lends it its product and event name.

  • Required for usage records. On a cost record, token counts are kept for reporting.

    Properties: 5
  • Who served it, e.g. anthropic or openai. Required for usage records.