# is_model_usage_event

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_session_stats/is_model_usage_event)

Report whether a custom-stream payload is a nested model-usage event.

Lets a client consume its own event whatever `record_model_usage_event` made
of it. A duplicate of a request the message stream already recorded is still
this client's event, not a payload for the unrelated handlers downstream.

## Signature

```python
is_model_usage_event(
    data: object,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `data` | `object` | Yes | A `custom` stream payload. |

## Returns

`bool`

`True` when the payload claims to be a nested model-usage event.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/_session_stats.py#L1222)