---
title: "Record which API key was used for a task"
method: POST
path: "/api/keys/report-usage"
tags: ["API Keys"]
---

# Record which API key was used for a task

`POST /api/keys/report-usage`

## Request body

- object
  - `keyType` string, required
  - `keySuffix` string, required
  - `keyIndex` integer, required
  - `taskId` string, uuid
  - `scope` string
  - `scopeId` string

## Response `200`

Usage recorded

- object
  - `success` true, required
  - `message` string, required

## Other responses

- `400` — Validation error
- `401` — Unauthorized

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/versions/ef761849166b/schema)
