> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinkplatform.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Choose User guide for browser tasks, Developers for CLI, SDK and external agents, and Administration for organization management.
> Confirm identity and organization/project context before operations. Documentation access does not grant ThinkPlatform permissions.
> Review side effects, verify changes with a read, and do not blindly retry an operation with an uncertain outcome.
> Use documented UI steps for the web app and documented public CLI or SDK interfaces for automation. Follow each page’s prerequisites and authentication requirements.

# Agent cost commands

> Inspect agent usage, task configuration, schedules, and cost attribution.

These examples assume an authenticated active saved profile with the intended organization and project. Confirm it with `tp context show` before running commands. Add root `--json` before the command when machine parsing needs JSON output; use root `--profile <name>` only to override the active profile.

Run commands using the active saved profile:

```bash theme={"system"}
tp --help
```

When `tp` is not on `PATH`, run from `thinkplatform-lib` with `.venv/bin/tp` or pass `--tp-bin /absolute/path/to/.venv/bin/tp` to the collector. The collector auto-detects the repository `.venv/bin/tp`.

All commands in this reference are read-only.

## Context and profile

```bash theme={"system"}
tp profile list
tp profile show PROFILE
tp context show
```

Confirm that `org_id` and `project_id` match the requested scope. Do not silently switch the active profile.

## Cost and attribution

Use explicit dates:

```bash theme={"system"}
tp costs overview \
  --from YYYY-MM-DD --to YYYY-MM-DD

tp costs allocation \
  --from YYYY-MM-DD --to YYYY-MM-DD --group-by project

tp costs allocation \
  --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_model

tp costs allocation \
  --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_agent

tp costs allocation \
  --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_task

tp costs allocation \
  --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_user

tp costs budgets
```

Useful options:

* `--provider openai|azure_openai|azure|all`
* `--metric ActualCost|AmortizedCost`
* `--force-refresh` when stale cached provider data would materially affect the result
* `--exclude-unallocated` only for a focused view; retain unallocated cost in the reconciliation

### Fallback for older CLI installations

```bash theme={"system"}
tp raw get \
  /api/organizations/ORG_ID/costs/allocation \
  --query from=YYYY-MM-DD \
  --query to=YYYY-MM-DD \
  --query groupBy=project_model
```

The server must also support the requested grouping. If it does not, record the missing dimension as a limitation and use tasks, Agents, and provider breakdowns as secondary evidence.

## Agent and task configuration

```bash theme={"system"}
tp agents list --limit 200 --include-tools
tp agents teams list
tp agents models
tp skills list --limit 200
tp skills get SKILL_ID
tp tasks list \
  --activity-from FROM_ISO --activity-to TO_ISO --limit 200 --offset 0
tp tasks list \
  --thread-id THREAD_ID --activity-from FROM_ISO --activity-to TO_ISO
tp tasks get TASK_ID
tp tasks messages TASK_ID --summary
```

Only retrieve raw task messages after selecting an anomalous task:

```bash theme={"system"}
tp tasks messages TASK_ID
```

Do not paste raw message content into the report. Report sizes, repetition, tool names, and short paraphrases.

## Schedules and triggers

```bash theme={"system"}
tp automation schedules list
tp automation schedules agent-log APP_ID \
  --from FROM_ISO --to TO_ISO --limit 500 --summary
tp hooks list
tp webhooks list
tp tasks followups TASK_ID --include-inactive
```

Inspect:

* interval/trigger and enabled status;
* target Agent and schedule prompt;
* run count, status mix, attempts, repeated task IDs, and errors;
* overlapping schedules, Hooks, Webhooks, and task follow-ups that can trigger the same work.

## Data-context investigation

After message summaries indicate file-heavy tool use, inspect only the implicated paths:

```bash theme={"system"}
tp datalake tree --path REMOTE_PATH
tp datalake list --path REMOTE_PATH
tp datalake preview --path REMOTE_FILE
```

Look for repeated reads of large or numerous files, raw PDFs/images requiring conversion, and missing curated indexes or summaries. Do not enumerate the entire Data Lake without evidence that it is required.

## Snapshot collector

```bash theme={"system"}
tp-agent-cost-snapshot --help
```

The default top-task and schedule summaries are bounded. Increase limits deliberately when the initial ranking shows a long tail that matters.

Read `collection_warnings`, `derived.dimension_coverage`, and `derived.collection_coverage` before conclusions. Scheduler `status_counts` describe enqueue records, not downstream task outcomes; correlate them with task status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.