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

# API

> API reference for TypeSafe: every `typesafe.api.*` operation with input and output types.

Every `typesafe.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Models

### list

`models.list`

List the TypeSafe model names and aliases this key can use, such as jev-latest

**Risk:** `read`

```ts theme={null}
await corsair.typesafe.api.models.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `models` | `object[]` | Yes | — |

> **models full type**
>
> ```ts theme={null}
> {
>   name: string,
>   description: string,
>   release_date: string
> }[]
> ```

***

## System One

### ask

`systemOne.ask`

Ask Jev typed questions about text, JSON or images in one call: yes/no (probability), choice (one option), score (ordered levels) or box (locate in an image). Answers come back with calibrated probabilities.

**Risk:** `read`

```ts theme={null}
await corsair.typesafe.api.systemOne.ask({ state: { message: 'I was charged twice for my order.' }, questions: { billing: { type: 'noul', instructions: 'Is `message` about billing?' }, urgency: { type: 'score', instructions: 'How urgent is `message`?', criteria: ['Can wait', 'Needs attention this week', 'Needs attention today'] } } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `string` | Yes | Model name or alias from models.list. jev-latest moves with each release; pin a version such as jev-1.14.0 to keep answers stable. |
| `state` | `object[]` | Yes | The content every question is about: text, or JSON with descriptive keys. Leave out fields no question needs. |
| `questions` | `object` | Yes | Questions keyed by a name you choose; answers come back under the same names. Questions run in parallel and cannot see each other. |
| `assets` | `object` | No | Images keyed by a placeholder string. Each placeholder in state, instructions or criteria is replaced by its image. Images are experimental at TypeSafe. |
| `longContext` | `boolean` | No | Raise the context limit from 64k (32k per question) to 262k tokens. Slower and less accurate, same price per token. |

> **state full type**
>
> ```ts theme={null}
> string | {
> } | any[]
> ```

> **questions full type**
>
> ```ts theme={null}
> {
> }
> ```

> **assets full type**
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `string` | Yes | Versioned model that answered |
| `answers` | `object` | Yes | — |
| `usage` | `object` | Yes | — |

> **answers full type**
>
> ```ts theme={null}
> {
> }
> ```

> **usage full type**
>
> ```ts theme={null}
> {
>   input_tokens: number,
>   output_tokens: number
> }
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.