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

# Database

> OpenRouter local sync: searchable entities, `.search()` filters, and operators.

The OpenRouter plugin syncs data locally. Use `corsair.openrouter.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

<Info>
  **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy).
</Info>

## Generations

Path: `openrouter.db.generations.search`

```ts theme={null}
const rows = await corsair.openrouter.db.generations.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field               | Type     | Operators                                  |
| ------------------- | -------- | ------------------------------------------ |
| `entity_id`         | `string` | equals, contains, startsWith, endsWith, in |
| `id`                | `string` | equals, contains, startsWith, endsWith, in |
| `model`             | `string` | equals, contains, startsWith, endsWith, in |
| `provider`          | `string` | equals, contains, startsWith, endsWith, in |
| `total_cost`        | `number` | equals, gt, gte, lt, lte, in               |
| `prompt_tokens`     | `number` | equals, gt, gte, lt, lte, in               |
| `completion_tokens` | `number` | equals, gt, gte, lt, lte, in               |
| `created_at`        | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Models

Path: `openrouter.db.models.search`

```ts theme={null}
const rows = await corsair.openrouter.db.models.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `string` | equals, contains, startsWith, endsWith, in |
| `name`           | `string` | equals, contains, startsWith, endsWith, in |
| `description`    | `string` | equals, contains, startsWith, endsWith, in |
| `context_length` | `number` | equals, gt, gte, lt, lte, in               |
| `created`        | `number` | equals, gt, gte, lt, lte, in               |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Providers

Path: `openrouter.db.providers.search`

```ts theme={null}
const rows = await corsair.openrouter.db.providers.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field          | Type     | Operators                                  |
| -------------- | -------- | ------------------------------------------ |
| `entity_id`    | `string` | equals, contains, startsWith, endsWith, in |
| `slug`         | `string` | equals, contains, startsWith, endsWith, in |
| `name`         | `string` | equals, contains, startsWith, endsWith, in |
| `headquarters` | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***
