---
title: "Create Ai Cost Snapshot"
method: POST
path: "/api/admin/ai-costs/snapshot"
tags: ["Admin"]
---

# Create Ai Cost Snapshot

`POST /api/admin/ai-costs/snapshot`

## Request

- Base URL: `https://api.flagpost.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.flagpost.ai/api/admin/ai-costs/snapshot`
- Auth: none declared

Pull Langfuse for a UTC day and upsert into ai_cost_daily_snapshots.

## Headers

- `x-task-secret` string, nullable

## Request body

- SnapshotRequest
  - `date` string, nullable: UTC day YYYY-MM-DD; defaults to today UTC
  - `finalize` boolean
  - `force` boolean

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/flagpost/apis/flagpost-api.md) - [All operations](https://skmtc.dev/flagpost/apis/flagpost-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flagpost/apis/flagpost-api/revisions/0308cef485ca?raw)
