---
title: "Run span-02"
description: "Answer typed questions about a state with span-02, Respan's decision model. Each question is `choice`, `noul` (yes/no), `score` or `number`, and each answer carries its probability distribution and confidence. One request can mix all four types."
---

<a id="playground-button:docs/apis/gateway/run-span-02"></a>

**POST** `https://api.respan.ai/api/v1/decisions`

Answer typed questions about a state with span-02, Respan's decision model. Each question is `choice`, `noul` (yes/no), `score` or `number`, and each answer carries its probability distribution and confidence. One request can mix all four types.

Set a thinking deadline with `reasoning.budget_ms`: span-02 thinks until then and answers with its best decision so far. The body is the System One format, so a System One client works by changing the URL. span-02 runs on Respan credits only and is priced per input and output token; thought tokens aren't billed. Streaming is unsupported.

## Servers

`https://api.respan.ai`: Respan API Server

<a id="request.auth"></a>

## Authentication

<a id="request.auth.Authorization"></a>

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


<a id="request"></a>

## Request body

A request body is required.

### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | Reference: `#/components/schemas/Span2DecisionRequest` |
| <a id="request.body.model"></a>`model` | `string` | Optional | Use `span-02` or `respan/span-02`. Omit for `span-02`.<br />Default: `span-02`<br />Example: `"span-02"` |
| <a id="request.body.state"></a>`state` | `string or object or array<any>` | Required in parent | What the questions are about: text or any JSON value. |
| `state (oneOf 1)` | `string` | Schema variant | - |
| `state (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `state (oneOf 3)` | `array<any>` | Schema variant | - |
| `state (oneOf 3)[]` | `any` | Array item | - |
| <a id="request.body.questions"></a>`questions` | `object` | Required in parent | Your question ids mapped to questions. Answers come back under the same ids. |
| `questions.<key>` | `object or object or object or object` | Map value | - |
| `questions.<key> (oneOf 1)` | `object` | Schema variant | Select an option from the supplied criteria.<br />Reference: `#/components/schemas/TypeSafeChoiceQuestion` |
| `questions.<key> (oneOf 1).type` | `string` | Required in parent | Allowed: `"choice"` |
| `questions.<key> (oneOf 1).instructions` | `string or null or object or array<any>` | Optional | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 1).instructions (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 1).instructions (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 1).instructions (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 1).instructions (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 1).criteria` | `object` | Required in parent | Option names mapped to descriptions. Use null for an option without a description.<br />Maximum properties: `255` |
| `questions.<key> (oneOf 1).criteria.<key>` | `string or null or object or array<any>` | Map value | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 1).criteria.<key> (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 1).criteria.<key> (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 1).criteria.<key> (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 1).criteria.<key> (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 2)` | `object` | Schema variant | A yes/no judgment expressed as a probability.<br />Reference: `#/components/schemas/TypeSafeNoulQuestion` |
| `questions.<key> (oneOf 2).type` | `string` | Required in parent | Allowed: `"noul"` |
| `questions.<key> (oneOf 2).instructions` | `string or null or object or array<any>` | Optional | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 2).instructions (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 2).instructions (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 2).instructions (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 2).instructions (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 2).criteria` | `object or null` | Optional | Optional guidance for yes and no. |
| `questions.<key> (oneOf 2).criteria.true` | `string or null or object or array<any>` | Optional | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 2).criteria.true (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 2).criteria.true (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 2).criteria.true (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 2).criteria.true (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 2).criteria.false` | `string or null or object or array<any>` | Optional | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 2).criteria.false (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 2).criteria.false (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 2).criteria.false (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 2).criteria.false (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 3)` | `object` | Schema variant | Evaluate the state on an ordered rubric.<br />Reference: `#/components/schemas/TypeSafeScoreQuestion` |
| `questions.<key> (oneOf 3).type` | `string` | Required in parent | Allowed: `"score"` |
| `questions.<key> (oneOf 3).instructions` | `string or null or object or array<any>` | Optional | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 3).instructions (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 3).instructions (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 3).instructions (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 3).instructions (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 3).criteria` | `array<string or object or array<any>>` | Required in parent | Rubric levels in order, starting at index 0.<br />Minimum items: `2`<br />Maximum items: `10` |
| `questions.<key> (oneOf 3).criteria[]` | `string or object or array<any>` | Array item | Text or structured context supplied to Jev.<br />Reference: `#/components/schemas/TypeSafeContent` |
| `questions.<key> (oneOf 3).criteria[] (oneOf 1)` | `string` | Schema variant | - |
| `questions.<key> (oneOf 3).criteria[] (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 3).criteria[] (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 3).criteria[] (oneOf 3)[]` | `any` | Array item | - |
| `questions.<key> (oneOf 4)` | `object` | Schema variant | Ask for a number. span-02 answers with the number itself, so no options are listed.<br />Reference: `#/components/schemas/Span2NumberQuestion` |
| `questions.<key> (oneOf 4).type` | `string` | Required in parent | Allowed: `"number"` |
| `questions.<key> (oneOf 4).instructions` | `string or null or object or array<any>` | Required in parent | Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.<br />Reference: `#/components/schemas/TypeSafeEntry` |
| `questions.<key> (oneOf 4).instructions (oneOf 1)` | `string or null` | Schema variant | - |
| `questions.<key> (oneOf 4).instructions (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `questions.<key> (oneOf 4).instructions (oneOf 3)` | `array<any>` | Schema variant | - |
| `questions.<key> (oneOf 4).instructions (oneOf 3)[]` | `any` | Array item | - |
| <a id="request.body.images"></a>`images` | `array<string>` | Optional | Up to 4 images, as data URIs or base64. span-02 sees them before the text.<br />Maximum items: `4` |
| `images[]` | `string` | Array item | - |
| <a id="request.body.reasoning"></a>`reasoning` | `object` | Optional | How span-02 thinks before it answers. The thought itself is never returned, and its tokens aren't billed.<br />Reference: `#/components/schemas/Span2Reasoning` |
| `reasoning.mode` | `string` | Optional | `auto` thinks only when span-02 is unsure, `on` thinks for every question, `off` never thinks.<br />Allowed: `"auto"`, `"on"`, `"off"`<br />Default: `auto` |
| `reasoning.budget_ms` | `integer` | Optional | Thinking time for the request in milliseconds. span-02 thinks until then, then answers with its best decision so far. `0` means no deadline; a per-question cap on thought length still applies.<br />Default: `0`<br />Minimum: `0`<br />Maximum: `600000` |
| <a id="request.body.respan_params"></a>`respan_params` | `object` | Optional | Respan parameters for the request log, such as `customer_identifier`.<br />Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "$ref": "#/components/schemas/Span2DecisionRequest"
}
```

</details>

##### Example


```json
{
  "model": "span-02",
  "state": {
    "customer_message": "My package arrived damaged and nobody answers my emails. I want a refund now.",
    "order": {
      "id": 123,
      "days_late": 4
    }
  },
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "returns": "Exchanges, wrong or damaged items",
        "shipping": "Delivery status, delays, lost packages",
        "billing": "Charges, invoices, payment problems"
      }
    },
    "wants_refund": {
      "type": "noul",
      "instructions": "Does the customer ask for a refund?"
    },
    "frustration": {
      "type": "score",
      "instructions": "How frustrated is the customer?",
      "criteria": [
        "Calm or positive",
        "Mildly annoyed",
        "Angry or threatening to leave"
      ]
    },
    "days_late": {
      "type": "number",
      "instructions": "How many days late is the order?"
    }
  },
  "reasoning": {
    "mode": "auto"
  }
}
```


<a id="response"></a>

## Responses

### 200

Answers keyed by question id. The example is the captured response to the request shown; probabilities can vary slightly between calls.

<a id="response.response-header"></a>

#### Response headers


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="response.response-header.X-Respan-Log-Id"></a>`X-Respan-Log-Id` | `string` | Optional | ID of the Respan request log for this call. |


#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Reference: `#/components/schemas/Span2DecisionResponse` |
| <a id="response.body.model"></a>`model` | `string` | Required in parent | The model that answered.<br />Allowed: `"span-02"` |
| <a id="response.body.answers"></a>`answers` | `object` | Required in parent | Answers keyed by the ids in `questions`. |
| `answers.<key>` | `object or object or object or object` | Map value | - |
| `answers.<key> (oneOf 1)` | `object` | Schema variant | Reference: `#/components/schemas/TypeSafeChoiceAnswer` |
| `answers.<key> (oneOf 1).type` | `string` | Required in parent | Allowed: `"choice"` |
| `answers.<key> (oneOf 1).choice` | `string` | Required in parent | Selected option name. |
| `answers.<key> (oneOf 1).probabilities` | `object` | Required in parent | - |
| `answers.<key> (oneOf 1).probabilities.<key>` | `number` | Map value | Minimum: `0`<br />Maximum: `1` |
| `answers.<key> (oneOf 1).confidence` | `number` | Required in parent | Minimum: `0`<br />Maximum: `1` |
| `answers.<key> (oneOf 2)` | `object` | Schema variant | Reference: `#/components/schemas/TypeSafeNoulAnswer` |
| `answers.<key> (oneOf 2).type` | `string` | Required in parent | Allowed: `"noul"` |
| `answers.<key> (oneOf 2).noul` | `number` | Required in parent | Probability of yes: 0 means no, 1 means yes.<br />Minimum: `0`<br />Maximum: `1` |
| `answers.<key> (oneOf 3)` | `object` | Schema variant | Reference: `#/components/schemas/TypeSafeScoreAnswer` |
| `answers.<key> (oneOf 3).type` | `string` | Required in parent | Allowed: `"score"` |
| `answers.<key> (oneOf 3).score` | `number` | Required in parent | Probability-weighted level index; may be fractional. |
| `answers.<key> (oneOf 3).legend` | `object` | Required in parent | Level indices mapped to rubric descriptions. |
| `answers.<key> (oneOf 3).legend.<key>` | `string or object or array<any>` | Map value | Text or structured context supplied to Jev.<br />Reference: `#/components/schemas/TypeSafeContent` |
| `answers.<key> (oneOf 3).legend.<key> (oneOf 1)` | `string` | Schema variant | - |
| `answers.<key> (oneOf 3).legend.<key> (oneOf 2)` | `object` | Schema variant | Additional properties are allowed |
| `answers.<key> (oneOf 3).legend.<key> (oneOf 3)` | `array<any>` | Schema variant | - |
| `answers.<key> (oneOf 3).legend.<key> (oneOf 3)[]` | `any` | Array item | - |
| `answers.<key> (oneOf 3).probabilities` | `object` | Required in parent | - |
| `answers.<key> (oneOf 3).probabilities.<key>` | `number` | Map value | Minimum: `0`<br />Maximum: `1` |
| `answers.<key> (oneOf 3).confidence` | `number` | Required in parent | Minimum: `0`<br />Maximum: `1` |
| `answers.<key> (oneOf 4)` | `object` | Schema variant | Reference: `#/components/schemas/Span2NumberAnswer` |
| `answers.<key> (oneOf 4).type` | `string` | Required in parent | Allowed: `"number"` |
| `answers.<key> (oneOf 4).number` | `number or null` | Required in parent | The answer as a number, or null if the model's text is not a number. |
| `answers.<key> (oneOf 4).text` | `string` | Required in parent | The answer as the model wrote it. |
| `answers.<key> (oneOf 4).confidence` | `number` | Required in parent | How sure span-02 is of the answer.<br />Minimum: `0`<br />Maximum: `1` |
| <a id="response.body.usage"></a>`usage` | `object` | Optional | Billed token counts. Thought tokens aren't billed. |
| `usage.input_tokens` | `integer` | Optional | - |
| `usage.output_tokens` | `integer` | Optional | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/Span2DecisionResponse"
}
```

</details>

##### Example


```json
{
  "model": "span-02",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "returns",
      "confidence": 0.969893,
      "probabilities": {
        "returns": 0.9799287,
        "shipping": 0.012929817,
        "billing": 0.00714149
      }
    },
    "wants_refund": {
      "type": "noul",
      "noul": 0.99997675
    },
    "frustration": {
      "type": "score",
      "score": 1.9921819,
      "legend": {
        "0": "Calm or positive",
        "1": "Mildly annoyed",
        "2": "Angry or threatening to leave"
      },
      "probabilities": {
        "0": 0.00009271287,
        "1": 0.0076327343,
        "2": 0.9922746
      },
      "confidence": 0.9882728
    },
    "days_late": {
      "type": "number",
      "number": 4,
      "text": "4",
      "confidence": 0.9999089
    }
  },
  "usage": {
    "input_tokens": 580,
    "output_tokens": 1
  }
}
```


<a id="response.error"></a>

### 400

Invalid request: an unknown model, `stream: true`, or questions the model rejects. Correct the request before retrying.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

##### Example


```json
{
  "detail": "Unknown model `gpt-5.5`. Use `span-02`, or omit `model`."
}
```


### 402

The organization has no Respan credits. Add credits to call span-02.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

### 403

Missing, invalid or expired Respan API key.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

### 429

The organization's span-02 rate limit was reached. Retry with exponential backoff.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

### 504

span-02 didn't answer in time. Retry; if it persists, send fewer questions or a shorter state.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Run span-02",
  "operationId": "createDecisions",
  "tags": [
    "Respan Models"
  ],
  "security": [
    {
      "RespanApiKey": []
    }
  ],
  "description": "Answer typed questions about a state with span-02, Respan's decision model. Each question is `choice`, `noul` (yes/no), `score` or `number`, and each answer carries its probability distribution and confidence. One request can mix all four types.\n\nSet a thinking deadline with `reasoning.budget_ms`: span-02 thinks until then and answers with its best decision so far. The body is the System One format, so a System One client works by changing the URL. span-02 runs on Respan credits only and is priced per input and output token; thought tokens aren't billed. Streaming is unsupported.",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Span2DecisionRequest"
        },
        "example": {
          "model": "span-02",
          "state": {
            "customer_message": "My package arrived damaged and nobody answers my emails. I want a refund now.",
            "order": {
              "id": 123,
              "days_late": 4
            }
          },
          "questions": {
            "department": {
              "type": "choice",
              "instructions": "Which team should handle this ticket?",
              "criteria": {
                "returns": "Exchanges, wrong or damaged items",
                "shipping": "Delivery status, delays, lost packages",
                "billing": "Charges, invoices, payment problems"
              }
            },
            "wants_refund": {
              "type": "noul",
              "instructions": "Does the customer ask for a refund?"
            },
            "frustration": {
              "type": "score",
              "instructions": "How frustrated is the customer?",
              "criteria": [
                "Calm or positive",
                "Mildly annoyed",
                "Angry or threatening to leave"
              ]
            },
            "days_late": {
              "type": "number",
              "instructions": "How many days late is the order?"
            }
          },
          "reasoning": {
            "mode": "auto"
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Answers keyed by question id. The example is the captured response to the request shown; probabilities can vary slightly between calls.",
      "headers": {
        "X-Respan-Log-Id": {
          "description": "ID of the Respan request log for this call.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Span2DecisionResponse"
          },
          "example": {
            "model": "span-02",
            "answers": {
              "department": {
                "type": "choice",
                "choice": "returns",
                "confidence": 0.969893,
                "probabilities": {
                  "returns": 0.9799287,
                  "shipping": 0.012929817,
                  "billing": 0.00714149
                }
              },
              "wants_refund": {
                "type": "noul",
                "noul": 0.99997675
              },
              "frustration": {
                "type": "score",
                "score": 1.9921819,
                "legend": {
                  "0": "Calm or positive",
                  "1": "Mildly annoyed",
                  "2": "Angry or threatening to leave"
                },
                "probabilities": {
                  "0": 0.00009271287,
                  "1": 0.0076327343,
                  "2": 0.9922746
                },
                "confidence": 0.9882728
              },
              "days_late": {
                "type": "number",
                "number": 4,
                "text": "4",
                "confidence": 0.9999089
              }
            },
            "usage": {
              "input_tokens": 580,
              "output_tokens": 1
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid request: an unknown model, `stream: true`, or questions the model rejects. Correct the request before retrying.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          },
          "example": {
            "detail": "Unknown model `gpt-5.5`. Use `span-02`, or omit `model`."
          }
        }
      }
    },
    "402": {
      "description": "The organization has no Respan credits. Add credits to call span-02.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "403": {
      "description": "Missing, invalid or expired Respan API key.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "429": {
      "description": "The organization's span-02 rate limit was reached. Retry with exponential backoff.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "504": {
      "description": "span-02 didn't answer in time. Retry; if it persists, send fewer questions or a shorter state.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "schemas": {
    "Span2DecisionRequest": {
      "type": "object",
      "required": [
        "state",
        "questions"
      ],
      "properties": {
        "model": {
          "type": "string",
          "default": "span-02",
          "description": "Use `span-02` or `respan/span-02`. Omit for `span-02`.",
          "example": "span-02"
        },
        "state": {
          "description": "What the questions are about: text or any JSON value.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "array",
              "items": {}
            }
          ]
        },
        "questions": {
          "type": "object",
          "description": "Your question ids mapped to questions. Answers come back under the same ids.",
          "additionalProperties": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TypeSafeChoiceQuestion"
              },
              {
                "$ref": "#/components/schemas/TypeSafeNoulQuestion"
              },
              {
                "$ref": "#/components/schemas/TypeSafeScoreQuestion"
              },
              {
                "$ref": "#/components/schemas/Span2NumberQuestion"
              }
            ]
          }
        },
        "images": {
          "type": "array",
          "maxItems": 4,
          "description": "Up to 4 images, as data URIs or base64. span-02 sees them before the text.",
          "items": {
            "type": "string"
          }
        },
        "reasoning": {
          "$ref": "#/components/schemas/Span2Reasoning"
        },
        "respan_params": {
          "type": "object",
          "additionalProperties": true,
          "description": "Respan parameters for the request log, such as `customer_identifier`."
        }
      }
    },
    "Span2DecisionResponse": {
      "type": "object",
      "required": [
        "model",
        "answers"
      ],
      "properties": {
        "model": {
          "type": "string",
          "enum": [
            "span-02"
          ],
          "description": "The model that answered."
        },
        "answers": {
          "type": "object",
          "description": "Answers keyed by the ids in `questions`.",
          "additionalProperties": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TypeSafeChoiceAnswer"
              },
              {
                "$ref": "#/components/schemas/TypeSafeNoulAnswer"
              },
              {
                "$ref": "#/components/schemas/TypeSafeScoreAnswer"
              },
              {
                "$ref": "#/components/schemas/Span2NumberAnswer"
              }
            ]
          }
        },
        "usage": {
          "type": "object",
          "description": "Billed token counts. Thought tokens aren't billed.",
          "properties": {
            "input_tokens": {
              "type": "integer"
            },
            "output_tokens": {
              "type": "integer"
            }
          }
        }
      }
    },
    "Span2NumberAnswer": {
      "type": "object",
      "required": [
        "type",
        "number",
        "text",
        "confidence"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "number"
          ]
        },
        "number": {
          "type": "number",
          "nullable": true,
          "description": "The answer as a number, or null if the model's text is not a number."
        },
        "text": {
          "type": "string",
          "description": "The answer as the model wrote it."
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "How sure span-02 is of the answer."
        }
      }
    },
    "Span2NumberQuestion": {
      "type": "object",
      "description": "Ask for a number. span-02 answers with the number itself, so no options are listed.",
      "required": [
        "type",
        "instructions"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "number"
          ]
        },
        "instructions": {
          "$ref": "#/components/schemas/TypeSafeEntry"
        }
      }
    },
    "Span2Reasoning": {
      "type": "object",
      "description": "How span-02 thinks before it answers. The thought itself is never returned, and its tokens aren't billed.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "auto",
            "on",
            "off"
          ],
          "default": "auto",
          "description": "`auto` thinks only when span-02 is unsure, `on` thinks for every question, `off` never thinks."
        },
        "budget_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 600000,
          "default": 0,
          "description": "Thinking time for the request in milliseconds. span-02 thinks until then, then answers with its best decision so far. `0` means no deadline; a per-question cap on thought length still applies."
        }
      }
    },
    "TypeSafeChoiceAnswer": {
      "type": "object",
      "required": [
        "type",
        "choice",
        "probabilities",
        "confidence"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "choice"
          ]
        },
        "choice": {
          "type": "string",
          "description": "Selected option name."
        },
        "probabilities": {
          "type": "object",
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "TypeSafeChoiceQuestion": {
      "type": "object",
      "description": "Select an option from the supplied criteria.",
      "required": [
        "type",
        "criteria"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "choice"
          ]
        },
        "instructions": {
          "$ref": "#/components/schemas/TypeSafeEntry"
        },
        "criteria": {
          "type": "object",
          "description": "Option names mapped to descriptions. Use null for an option without a description.",
          "additionalProperties": {
            "$ref": "#/components/schemas/TypeSafeEntry"
          },
          "maxProperties": 255
        }
      }
    },
    "TypeSafeContent": {
      "description": "Text or structured context supplied to Jev.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "array",
          "items": {}
        }
      ]
    },
    "TypeSafeEntry": {
      "description": "Question instructions or rubric descriptions. Accepts text, an object, an array, or null. See https://docs.typesafe.ai/primitives/advanced.",
      "oneOf": [
        {
          "type": "string",
          "nullable": true
        },
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "array",
          "items": {}
        }
      ]
    },
    "TypeSafeNoulAnswer": {
      "type": "object",
      "required": [
        "type",
        "noul"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "noul"
          ]
        },
        "noul": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Probability of yes: 0 means no, 1 means yes."
        }
      }
    },
    "TypeSafeNoulQuestion": {
      "type": "object",
      "description": "A yes/no judgment expressed as a probability.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "noul"
          ]
        },
        "instructions": {
          "$ref": "#/components/schemas/TypeSafeEntry"
        },
        "criteria": {
          "type": "object",
          "description": "Optional guidance for yes and no.",
          "properties": {
            "true": {
              "$ref": "#/components/schemas/TypeSafeEntry"
            },
            "false": {
              "$ref": "#/components/schemas/TypeSafeEntry"
            }
          },
          "nullable": true
        }
      }
    },
    "TypeSafeScoreAnswer": {
      "type": "object",
      "required": [
        "type",
        "score",
        "legend",
        "probabilities",
        "confidence"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "score"
          ]
        },
        "score": {
          "type": "number",
          "description": "Probability-weighted level index; may be fractional."
        },
        "legend": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/components/schemas/TypeSafeContent"
          },
          "description": "Level indices mapped to rubric descriptions."
        },
        "probabilities": {
          "type": "object",
          "additionalProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "TypeSafeScoreQuestion": {
      "type": "object",
      "description": "Evaluate the state on an ordered rubric.",
      "required": [
        "type",
        "criteria"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "score"
          ]
        },
        "instructions": {
          "$ref": "#/components/schemas/TypeSafeEntry"
        },
        "criteria": {
          "type": "array",
          "minItems": 2,
          "items": {
            "$ref": "#/components/schemas/TypeSafeContent"
          },
          "description": "Rubric levels in order, starting at index 0.",
          "maxItems": 10
        }
      }
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
