# dev.cocore.compute.modelActivity

> Published by [cocore.dev](https://lexicon.garden/identity/did:plc:5quuhkmwe2q4k3azfsgg7kdz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.modelActivity)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.modelActivity/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.modelActivity/examples)

## Definitions

### `dev.cocore.compute.modelActivity`

**Type**: `query`

Aggregate receipt activity per model and per time window. Walks the most-recent indexed receipts (capped at 5000), groups by `body.model`, and tallies requests + tokens across the hour/day/week/month windows, with per-provider breakdowns.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `models` | `array` | Yes |  |
| `generatedAt` | `string` (datetime) | Yes |  |

## Raw Schema

```json
{
  "id": "dev.cocore.compute.modelActivity",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "generatedAt",
            "models"
          ],
          "properties": {
            "models": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "modelId",
                  "totals",
                  "byProvider"
                ],
                "properties": {
                  "totals": {
                    "ref": "dev.cocore.defs#activityWindows",
                    "type": "ref"
                  },
                  "modelId": {
                    "type": "string"
                  },
                  "byProvider": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "did",
                        "stats"
                      ],
                      "properties": {
                        "did": {
                          "type": "string",
                          "format": "did"
                        },
                        "stats": {
                          "ref": "dev.cocore.defs#activityWindows",
                          "type": "ref"
                        }
                      }
                    }
                  }
                }
              }
            },
            "generatedAt": {
              "type": "string",
              "format": "datetime"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Aggregate receipt activity per model and per time window. Walks the most-recent indexed receipts (capped at 5000), groups by `body.model`, and tallies requests + tokens across the hour/day/week/month windows, with per-provider breakdowns."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
