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

# Non-LLM Usage

> Track search, speech, vector database, workflow, and other non-LLM costs beside model spend.

Production agents spend money outside model APIs. Search, speech, vector stores, enrichment APIs, workflow runners, and hosted tools can all change margin.

Pylva tracks these sources with raw usage metrics.

## Report usage, not price

Your application reports what happened. Pylva prices it later from the dashboard.

### TypeScript

```ts theme={null}
import { reportUsage } from "@pylva/sdk";

reportUsage({
  customer_id: "acme-corp",
  step: "search_web",
  metric: "search_requests",
  value: 1,
});
```

### Python

```python theme={null}
from pylva import report_usage

report_usage(
    customer_id="acme-corp",
    step="search_web",
    metric="search_requests",
    value=1,
)
```

## Good metric names

Choose metric names that match the vendor unit you pay for.

| Vendor category | Example metric    | Example step       |
| --------------- | ----------------- | ------------------ |
| Search API      | `search_requests` | `retrieve_context` |
| Text to speech  | `characters`      | `speak_answer`     |
| Speech to text  | `audio_seconds`   | `transcribe_call`  |
| Vector database | `vector_queries`  | `retrieve_context` |
| Workflow runner | `executions`      | `run_tool`         |

## Pricing workflow

1. The SDK sends a metric event.
2. Pylva records the source and flags missing pricing if needed.
3. You configure a dashboard pricing rule for the metric.
4. Future events are priced automatically.
5. Historical gaps can be backfilled when pricing is available.

## Best practices

* Keep metric names stable.
* Use one unit per metric.
* Avoid embedding vendor names into `customer_id` or `step_name`.
* Do not send raw user content in metadata.
