---
title: "Record LLM usage log entry"
method: POST
path: "/llm-logs"
tags: ["LLM Logs"]
---

# Record LLM usage log entry

`POST /llm-logs`

## Request

- Base URL: `https://api.distill.io/v2`
- URL: `https://api.distill.io/v2/llm-logs`
- Auth: one of:
  - API key in cookie `connect.sid`
  - HTTP bearer
  - API key in query parameter `api_key`

Auth: Write — Workspace member with write access or higher.

## Request body

- object
  - `model` string, required
  - `task` string, required
  - `session_id` string, nullable
  - `duration` number, nullable
  - `retry` integer, nullable
  - `error` object, nullable
  - `usage` object, nullable
    - `inputTokens` number, required
    - `outputTokens` number, required
    - `cachedInputTokens` number, required
    - `cacheCreationInputTokens` number
    - `totalTokens` number, required
    - `reasoningTokens` number
    - `providerUsage` object
  - `meta` object, nullable
    - `user_id` string, uuid
    - `macro_id` string, uuid
    - `sieve_id` string, uuid
    - `sieve_data_id` string, uuid
    - `run_id` string

## Response `200`

Success

- object
  - `id` string, uuid, required
  - `ts` string, date-time, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden

---

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