> ## 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

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

The APIpie AI plugin syncs data locally. Use `corsair.apipie.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>

## Images

Path: `apipie.db.images.search`

```ts theme={null}
const rows = await corsair.apipie.db.images.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 |
| `prompt`         | `string` | equals, contains, startsWith, endsWith, in |
| `model`          | `string` | equals, contains, startsWith, endsWith, in |
| `url`            | `string` | equals, contains, startsWith, endsWith, in |
| `revised_prompt` | `string` | equals, contains, startsWith, endsWith, 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).*

***

## Model Details

Path: `apipie.db.modelDetails.search`

```ts theme={null}
const rows = await corsair.apipie.db.modelDetails.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 |
| `type`                   | `string`  | equals, contains, startsWith, endsWith, in |
| `subtype`                | `string`  | equals, contains, startsWith, endsWith, in |
| `route`                  | `string`  | equals, contains, startsWith, endsWith, in |
| `description`            | `string`  | equals, contains, startsWith, endsWith, in |
| `abortable`              | `boolean` | equals                                     |
| `moderationRequired`     | `boolean` | equals                                     |
| `supports_multipart`     | `boolean` | equals                                     |
| `instruct_type`          | `string`  | equals, contains, startsWith, endsWith, in |
| `quantization`           | `string`  | equals, contains, startsWith, endsWith, in |
| `pool`                   | `string`  | equals, contains, startsWith, endsWith, in |
| `mmlu`                   | `number`  | equals, gt, gte, lt, lte, in               |
| `output_vector_size`     | `number`  | equals, gt, gte, lt, lte, in               |
| `max_tokens`             | `number`  | equals, gt, gte, lt, lte, in               |
| `max_response_tokens`    | `number`  | equals, gt, gte, lt, lte, in               |
| `max_images_per_prompt`  | `number`  | equals, gt, gte, lt, lte, in               |
| `max_audio_per_prompt`   | `number`  | equals, gt, gte, lt, lte, in               |
| `max_audio_length_hours` | `number`  | equals, gt, gte, lt, lte, in               |
| `max_videos_per_prompt`  | `number`  | equals, gt, gte, lt, lte, in               |
| `max_video_length`       | `number`  | equals, gt, gte, lt, lte, in               |
| `max_pdf_size_mb`        | `number`  | equals, gt, gte, lt, lte, in               |
| `latency`                | `string`  | equals, contains, startsWith, endsWith, in |
| `query_count`            | `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: `apipie.db.models.search`

```ts theme={null}
const rows = await corsair.apipie.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 |
| `model`               | `string` | equals, contains, startsWith, endsWith, in |
| `provider`            | `string` | equals, contains, startsWith, endsWith, in |
| `type`                | `string` | equals, contains, startsWith, endsWith, in |
| `subtype`             | `string` | equals, contains, startsWith, endsWith, in |
| `route`               | `string` | equals, contains, startsWith, endsWith, in |
| `description`         | `string` | equals, contains, startsWith, endsWith, in |
| `avg_cost`            | `string` | equals, contains, startsWith, endsWith, in |
| `input_cost`          | `string` | equals, contains, startsWith, endsWith, in |
| `output_cost`         | `string` | equals, contains, startsWith, endsWith, in |
| `price_type`          | `string` | equals, contains, startsWith, endsWith, in |
| `latency`             | `string` | equals, contains, startsWith, endsWith, in |
| `query_count`         | `string` | equals, contains, startsWith, endsWith, in |
| `max_tokens`          | `number` | equals, gt, gte, lt, lte, in               |
| `max_response_tokens` | `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).*

***
