---
title: "Track Usage"
method: POST
path: "/api/v1/intelligence/prompts/track-usage"
tags: ["prompts-ddd", "Admin - Prompts"]
---

# Track Usage

`POST /api/v1/intelligence/prompts/track-usage`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/intelligence/prompts/track-usage`
- Auth: none declared

Track usage of a prompt (called by services after using a prompt).

## Headers

- `Authorization` string

## Request body

- UsageTracking: Model for tracking prompt usage.
  - `prompt_id` string, required: Prompt ID
  - `company_id` integer, nullable
  - `asset_id` integer, nullable
  - `model_used` string, nullable
  - `input_data` object, nullable
  - `output_data` object, nullable
  - `tokens_used` integer, nullable
  - `response_time_ms` integer, nullable
  - `was_successful` boolean
  - `error_message` string, nullable

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

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