# Answer typed questions

TypeSafe-compatible noul, choice and score questions. One to 64 questions, 2 to 255
choice options, 1 to 10 ordered score levels. State and descriptions may be text,
objects or arrays, within the shared 50 MiB body and structure limits. No streaming
or media assets. Box questions are recognized but rejected as unavailable before
provider I/O, including in mixed requests. Probabilities retain their native values.
Input/output counts are reported by the provider; additional cost and currency fields
use exact EUR pricing.
Unknown model IDs return catalog not_found (404) with issues and a suggestion;
mixed validation failures remain invalid_parameter (400). Unknown request fields are
ignored; unknown provider response fields are discarded. Identity and bounded Zstd
request compression are supported, including the official TypeSafe Python SDK default.
Body session_id overrides x-session-id. Opted-in capture stores the request envelope
as the sole input.messages entry, and the serialized decision response under the existing bounded content policy.

Administrative PII requirements are checked for each actual route, including fallbacks
and retries. This endpoint cannot redact its input: a matching requirement returns
`invalid_parameter` with a `not_available` issue at `$.model` before provider I/O.

No suitable example model is currently verified in the public catalog. Replace YOUR_MODEL_ID with an available model for this endpoint before sending a request.

`POST https://api.tokenlane.de/v1/systemone`

## Authorizations

[
  [
    {
      "name": "Authorization",
      "description": "API key as bearer token in the `Authorization` header: `Authorization: Bearer sk-tl-v1-…`. Existing `sk-eu-` keys remain valid. Missing, unknown or expired keys get 401 `authentication`.",
      "type": "http bearer",
      "location": "",
      "scopes": []
    }
  ]
]

Values starting with YOUR_ are placeholders. Replace them with appropriate values before sending.

## curl

```curl
curl --request POST \
  --url 'https://api.tokenlane.de/v1/systemone' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "YOUR_MODEL_ID",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}'
```

## node

```node
const response = await fetch("https://api.tokenlane.de/v1/systemone", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
    "Content-Type": "application/json",
  },
  body: `{
  "model": "YOUR_MODEL_ID",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}`,
});
console.log(await response.text());
```

## python

```python
import os
import urllib.request

body = (r'''{
  "model": "YOUR_MODEL_ID",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}''').encode("utf-8")

request = urllib.request.Request(
    "https://api.tokenlane.de/v1/systemone",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["TOKENLANE_API_KEY"],
        "Content-Type": "application/json",
    },
    data=body,
)

with urllib.request.urlopen(request) as response:
    print(response.read().decode("utf-8"))
```

## vercel

```vercel
// This operation uses HTTP directly.
const response = await fetch("https://api.tokenlane.de/v1/systemone", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
    "Content-Type": "application/json",
  },
  body: `{
  "model": "YOUR_MODEL_ID",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}`,
});
console.log(await response.text());
```

## header: Idempotency-Key (optional)

Explicit opt-in to encrypted response replay across gateway nodes. One 1..=255 printable ASCII value per logical operation, scoped to this API key ID. Reuse the same method, path and normalized body. Completed responses are retained for at most 10 minutes; replay is free and creates no generation. Conflicting content or unavailable replay returns 409. A successful replay carries Idempotent-Replayed: true and preserves the original request and generation IDs. See /docs/guides/idempotency.

### s0: string | null

{}

## Body: application/json

```json
{
  "model": "YOUR_MODEL_ID",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}
```

### s36: object

Evaluate up to 64 questions in one non-streaming inference call.
Box questions are recognized but rejected as unavailable before provider I/O.

{}

```json
{
  "model": "Qwen/Qwen3.5-2B",
  "questions": {
    "refund": {
      "instructions": "Is a refund requested?",
      "type": "noul"
    }
  },
  "state": {
    "ticket": "Please refund the duplicate charge."
  }
}
```

- model (required): s397

### s397: string

Public decision model ID or alias; required, including with the TypeSafe SDK.

{}

```json
"Qwen/Qwen3.5-2B"
```

- provider (optional): s398

### s398: object

Provider selection and data constraints, never forwarded upstream.

{}

- questions (required): s399

### s399: object

JSON object mapping names to entries of the declared value type.

{}

- * (optional): s1078

### s1078: oneOf

A named decision question. Probability answers use the same name and type.

{}

```json
{
  "criteria": {
    "billing": "Payments",
    "support": "Technical issues"
  },
  "instructions": "Which team?",
  "type": "choice"
}
```

oneOf: s1266

### s1266: object

Probability that a statement is true.

{}

- criteria (optional): s608

### s608: object | null

Optional descriptions of the two outcomes of a yes/no question.

{}

- false (optional): s1149

### s1149: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

### s7: string

{}

anyOf: s1287

### s1287: object

{}

- * (optional): s1339

### s1339: any

{}

anyOf: s1288

### s1288: array

{}

### s1340: any

{}

anyOf: s588

### s588: null

{}

- true (optional): s1150

### s1150: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

anyOf: s1289

### s1289: object

{}

- * (optional): s1341

### s1341: any

{}

anyOf: s1290

### s1290: array

{}

### s1342: any

{}

anyOf: s588

- instructions (optional): s609

### s609: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

anyOf: s1151

### s1151: object

{}

- * (optional): s1291

### s1291: any

{}

anyOf: s1152

### s1152: array

{}

### s1292: any

{}

anyOf: s588

- type (required): s610

### s610: string

Always `noul`.

"noul"

{}

oneOf: s1267

### s1267: object

Select one of the named alternatives.

{}

- criteria (required): s603

### s603: object

JSON object mapping names to entries of the declared value type.

{}

- * (optional): s1146

### s1146: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

anyOf: s1283

### s1283: object

{}

- * (optional): s1337

### s1337: any

{}

anyOf: s1284

### s1284: array

{}

### s1338: any

{}

anyOf: s588

- instructions (optional): s604

### s604: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

anyOf: s1147

### s1147: object

{}

- * (optional): s1285

### s1285: any

{}

anyOf: s1148

### s1148: array

{}

### s1286: any

{}

anyOf: s588

- type (required): s605

### s605: string

Always `choice`.

"choice"

{}

oneOf: s1268

### s1268: object

Rate the state against ordered levels.

{}

- criteria (required): s616

### s616: array

Ordered descriptions of one to ten levels, lowest first.

{"minItems":"1","maxItems":"10"}

### s1154: anyOf

Text or structured context. Nested JSON values retain their original representation.

{}

anyOf: s7

anyOf: s1295

### s1295: object

{}

- * (optional): s1345

### s1345: any

{}

anyOf: s1296

### s1296: array

{}

### s1346: any

{}

- instructions (optional): s617

### s617: anyOf

Text or structured guidance; null leaves it unspecified.

{}

anyOf: s7

anyOf: s1155

### s1155: object

{}

- * (optional): s1297

### s1297: any

{}

anyOf: s1156

### s1156: array

{}

### s1298: any

{}

anyOf: s588

- type (required): s618

### s618: string

Always `score`.

"score"

{}

oneOf: s1269

### s1269: object

Recognized vendor image bounding-box syntax; execution is unavailable.

{}

- instructions (required): s597

### s597: anyOf

Text or structured context. Nested JSON values retain their original representation.

{}

anyOf: s7

anyOf: s1144

### s1144: object

{}

- * (optional): s1281

### s1281: any

{}

anyOf: s1145

### s1145: array

{}

### s1282: any

{}

- type (required): s598

### s598: string

Always `box`.

"box"

{}

- session_id (optional): s400

### s400: string

Local session identifier; takes precedence over the x-session-id header.

{}

```json
"support-42"
```

- state (required): s401

### s401: anyOf

Text or structured context. Nested JSON values retain their original representation.

{}

anyOf: s7

anyOf: s1079

### s1079: object

{}

- * (optional): s1270

### s1270: any

{}

anyOf: s1080

### s1080: array

{}

### s1271: any

{}

## Response 200: application/json

Typed answers and exact EUR usage; x-generation-id identifies the persisted decision generation

```json
{
  "answers": {
    "refund": {
      "noul": 0.95,
      "type": "noul"
    }
  },
  "id": "gen-01k7tm9qz3f5c8x2v6b4n0m7hd",
  "model": "Qwen/Qwen3.5-2B",
  "usage": {
    "cost": 0.00000504,
    "currency": "EUR",
    "input_tokens": 120,
    "output_tokens": 12
  }
}
```

### s37: object

TypeSafe answer envelope with an additional gateway generation ID and EUR usage.

{}

```json
{
  "answers": {
    "refund": {
      "noul": 0.95,
      "type": "noul"
    }
  },
  "id": "gen-01k7tm9qz3f5c8x2v6b4n0m7hd",
  "model": "Qwen/Qwen3.5-2B",
  "usage": {
    "cost": 0.00000504,
    "currency": "EUR",
    "input_tokens": 120,
    "output_tokens": 12
  }
}
```

- answers (required): s402

### s402: object

JSON object mapping names to entries of the declared value type.

{}

- * (optional): s1081

### s1081: oneOf

One decision, preserving the provider's numeric probabilities without rescaling.

{}

```json
{
  "noul": 0.95,
  "type": "noul"
}
```

oneOf: s1272

### s1272: object

Probability of a true statement.

{}

- noul (required): s606

### s606: number

Finite probability between zero and one.

double

{"minimum":"0","maximum":"1"}

```json
0.95
```

- type (required): s607

### s607: string

Always `noul`.

"noul"

{}

oneOf: s1273

### s1273: object

A selected alternative and its distribution.

{}

- choice (required): s599

### s599: string

Name of a requested alternative with maximal probability.

{}

```json
"billing"
```

- confidence (required): s600

### s600: number

Finite confidence between zero and one.

double

{"minimum":"0","maximum":"1"}

```json
0.9
```

- probabilities (required): s601

### s601: object

JSON object mapping names to entries of the declared value type.

{}

- * (optional): s24

### s24: number

double

{}

- type (required): s602

### s602: string

Always `choice`.

"choice"

{}

oneOf: s1274

### s1274: object

A probability-weighted zero-based level.

{}

- confidence (required): s611

### s611: number

Finite confidence between zero and one.

double

{"minimum":"0","maximum":"1"}

```json
0.8
```

- legend (required): s612

### s612: object

Decimal zero-based level indices mapped to the original level descriptions.

{}

- * (optional): s1153

### s1153: anyOf

Text or structured context. Nested JSON values retain their original representation.

{}

anyOf: s7

anyOf: s1293

### s1293: object

{}

- * (optional): s1343

### s1343: any

{}

anyOf: s1294

### s1294: array

{}

### s1344: any

{}

- probabilities (required): s613

### s613: object

JSON object mapping names to entries of the declared value type.

{}

- * (optional): s24

- score (required): s614

### s614: number

Finite score between zero and the final level index; may be fractional.

double

{"minimum":"0"}

```json
1.7
```

- type (required): s615

### s615: string

Always `score`.

"score"

{}

- id (required): s403

### s403: string

Gateway generation ID, also returned in x-generation-id.

{}

```json
"gen-01k7tm9qz3f5c8x2v6b4n0m7hd"
```

- model (required): s404

### s404: string

Resolved public model ID.

{}

```json
"Qwen/Qwen3.5-2B"
```

- usage (required): s405

### s405: object

Native counts and exact EUR charge.

{}

```json
{
  "cost": 0.00000504,
  "currency": "EUR",
  "input_tokens": 120,
  "output_tokens": 12
}
```

- cost (required): s593

### s593: number

Exact EUR charge, emitted from integer pico accounting.

double

{}

```json
0.00000504
```

- currency (required): s594

### s594: string

Customer currency, always EUR.

{}

```json
"EUR"
```

- input_tokens (required): s595

### s595: integer

Reported input tokens; estimated values never determine the bill.

int64

{"minimum":"0"}

```json
120
```

- output_tokens (required): s596

### s596: integer

Reported output tokens, even when the model profile prices them at zero.

int64

{"minimum":"0"}

```json
12
```

## Response 400: application/json

Recognized upstream 400/422 request rejections are non-retryable client errors. Invalid JSON, invalid fields with collected issues, or context limit exceeded

```json
{
  "error": {
    "code": 400,
    "message": "deepseek/deepseek-v4.1-flsh is not a valid model ID",
    "metadata": {
      "docs_url": "/docs#description/model-not-found",
      "issues": [
        {
          "code": "unknown_model",
          "message": "deepseek/deepseek-v4.1-flsh is not a valid model ID",
          "path": "$.model"
        }
      ],
      "remedy_hint": "Did you mean deepseek/deepseek-v4.1-flash?",
      "request_id": "req_01k7tm9qz3f5c8x2v6b4n0m7hd",
      "retryable": false,
      "type": "model_not_found"
    }
  },
  "user_id": "org_01k7tm2c4e6g8j0k2m4p6r8t0v"
}
```

### s3: object

Every response with an HTTP status of 400 or higher has this shape, OpenRouter's error
format. Everything the gateway adds is inside `error.metadata`, so OpenRouter clients see
nothing unfamiliar. See "Errors" in the introduction for all error types.

{}

```json
{
  "error": {
    "code": 400,
    "message": "deepseek/deepseek-v4.1-flsh is not a valid model ID",
    "metadata": {
      "docs_url": "/docs#description/model-not-found",
      "issues": [
        {
          "code": "unknown_model",
          "message": "deepseek/deepseek-v4.1-flsh is not a valid model ID",
          "path": "$.model"
        }
      ],
      "remedy_hint": "Did you mean deepseek/deepseek-v4.1-flash?",
      "request_id": "req_01k7tm9qz3f5c8x2v6b4n0m7hd",
      "retryable": false,
      "type": "model_not_found"
    }
  },
  "user_id": "org_01k7tm2c4e6g8j0k2m4p6r8t0v"
}
```

- error (required): s238

### s238: object

What went wrong.

{}

```json
{
  "code": 400,
  "message": "temperature must be at most 2, got 5 (and 1 more)",
  "metadata": {
    "docs_url": "/docs#description/invalid-parameter",
    "issues": [
      {
        "code": "out_of_range",
        "message": "temperature must be at most 2, got 5",
        "path": "$.temperature"
      },
      {
        "code": "invalid_value",
        "message": "messages[1].role must be one of system, developer, user, assistant, tool, got \"bot\"",
        "path": "$.messages[1].role"
      }
    ],
    "request_id": "req_01k7tm9qz3f5c8x2v6b4n0m7hd",
    "retryable": false,
    "type": "invalid_parameter"
  }
}
```

- code (required): s633

### s633: integer

The HTTP status of the response, as a number.

int32

{"minimum":"0"}

```json
400
```

- message (required): s634

### s634: string

What went wrong, in English. With several problems: the first one and how many more
follow; all of them are in `metadata.issues`. The text may change; match on
`metadata.type` instead.

{}

```json
"temperature must be at most 2, got 5"
```

- metadata (optional): s635

### s635: object

Details for programs: error type, request ID, every problem, a suggested fix and, for
provider errors, which provider failed. Always present on gateway errors.

{}

```json
{
  "docs_url": "/docs#description/rate-limited",
  "provider_error": {
    "category": "rate_limited",
    "provider_name": "deepinfra",
    "retry_after": 2,
    "retryable": true,
    "status": 429
  },
  "provider_name": "deepinfra",
  "remedy_hint": "Retry after the Retry-After interval, or allow fallbacks to other providers (provider.allow_fallbacks).",
  "request_id": "req_01k7tm9qz3f5c8x2v6b4n0m7hd",
  "retry_after": 2,
  "retryable": true,
  "type": "rate_limited"
}
```

- available_providers (optional): s639

### s639: array

Providers that serve the model (when `provider.only` excluded all of them).

{}

```json
[
  "deepinfra",
  "open-inference"
]
```

- docs_url (required): s640

### s640: string

Link to the section of this error type in the documentation.

{}

```json
"/docs#description/model-not-found"
```

- failed_routing_step (optional): s641

### s641: string

The routing step that left no route (routing errors only).

{}

```json
"Filter by Max Price"
```

- issues (optional): s642

### s642: array

Every problem found in the request, so all can be fixed at once (at most 20); for
routing errors one entry per excluded route, for `no_provider_available` one per failed
attempt.

{}

### s123: object

One problem in the request, one reason a route was excluded, or one failed attempt.

{}

```json
{
  "code": "invalid_url",
  "message": "messages[2].content[0].image_url.url must be an http(s) URL or a base64 data URL",
  "path": "$.messages[2].content[0].image_url.url"
}
```

- code (required): s636

### s636: string

Kind of problem, stable for programs.

"required", "invalid_type", "invalid_value", "out_of_range", "empty", "invalid_url", "invalid_base64", "unsupported_media_type", "media_type_mismatch", "media_too_large", "too_many_media", "unsupported_media_transport", "media_fetch_failed", "unknown_tool", "unknown_model", "not_available", "not_allowed", "route_excluded", "bridge_failed", "provider_failed"

{}

```json
"out_of_range"
```

- message (required): s637

### s637: string

The problem in English, naming the field and, if short, the value sent.

{}

```json
"temperature must be at most 2, got 5"
```

- path (required): s638

### s638: string

Where the problem is: JSONPath of the field in the request body, for example
`$.messages[2].content[0].image_url.url`, or `query.<name>` for a query parameter.

{}

```json
"$.temperature"
```

- provider_error (optional): s643

### s643: oneOf

Safe provider diagnostics, identical for HTTP errors and terminal stream events.

{}

oneOf: s1158

### s1158: object

Provider diagnostics without provider-authored text. HTTP and terminal SSE errors use
this same structure; arbitrary upstream messages and metadata are discarded.

{}

```json
{
  "category": "rate_limited",
  "provider_name": "deepinfra",
  "retry_after": 2,
  "retryable": true,
  "status": 429
}
```

- category (required): s1299

### s1299: string

Gateway classification from HTTP status and recognized dialect identifiers.

"rate_limited", "overloaded", "invalid_request", "context_length", "content_filtered", "authentication", "billing", "timeout", "unavailable", "unknown"

{}

```json
"rate_limited"
```

- code (optional): s1300

### s1300: string

Exact identifier from the configured dialect's fixed list; arbitrary values vanish.

{}

```json
"rate_limit_exceeded"
```

- provider_name (required): s1301

### s1301: string

Configured provider name, never a name supplied by the upstream body.

{}

```json
"deepinfra"
```

- retry_after (optional): s1302

### s1302: integer

Bounded seconds from the upstream Retry-After header, when present and numeric.

int64

{"minimum":"0"}

```json
2
```

- retryable (required): s1303

### s1303: boolean

Whether the classified failure can be transient. Unknown failures are not promised retryable.

{}

- status (optional): s1304

### s1304: integer

Actual HTTP status received from the upstream, including 200 for native errors.
Absent when no HTTP status is available.

int32

{"minimum":"0"}

```json
429
```

oneOf: s588

- provider_name (optional): s644

### s644: string

The provider that failed, as in the response field `provider` (provider errors only).

{}

```json
"deepinfra"
```

- raw (optional): s645

### s645: string

Reserved OpenRouter compatibility field. The gateway never fills it: provider
free text is deliberately withheld. Use provider_error instead.

{}

```json
""
```

- remedy_hint (optional): s646

### s646: string

A concrete fix, for example the closest model ID to a mistyped one.

{}

```json
"Did you mean deepseek/deepseek-v4.1-flash?"
```

- request_id (required): s647

### s647: string

ID of the request, the same as the `x-request-id` response header. Quote it when
contacting support.

{}

```json
"req_01k7tm9qz3f5c8x2v6b4n0m7hd"
```

- requested_providers (optional): s648

### s648: array

Providers named in `provider.only` (when it excluded all routes).

{}

```json
[
  "scaleway"
]
```

- retry_after (optional): s649

### s649: integer

Seconds to wait before retrying; also sent as the `Retry-After` header (429 and 503).

int64

{"minimum":"0"}

```json
2
```

- retryable (required): s650

### s650: boolean

Whether sending the identical request again can succeed (for example after a timeout
or rate limit), as opposed to errors that need a changed request.

{}

- routing_funnel (optional): s651

### s651: array

How routing narrowed down the providers: each step with the number of routes left
(routing errors only, same format as OpenRouter).

{}

### s200: object

One routing step, as in OpenRouter's `routing_funnel`.

{}

```json
{
  "endpoint_count": 0,
  "reason": "provider.max_price",
  "step": "Filter by Max Price"
}
```

- endpoint_count (required): s979

### s979: integer

Number of routes (providers of the model) left after the step.

{"minimum":"0"}

```json
2
```

- reason (optional): s980

### s980: string

The request field the step filtered on.

{}

```json
"provider.only"
```

- step (required): s981

### s981: string

Name of the step, as at OpenRouter.

{}

```json
"Initial Endpoints"
```

- type (required): s652

### s652: string

Stable error type to match on in code; see "Errors" in the introduction. Messages may
change, the type does not.

"invalid_request", "invalid_parameter", "unsupported_parameter", "context_length_exceeded", "authentication", "insufficient_credits", "workspace_budget_exceeded", "permission_denied", "moderation", "model_not_found", "no_endpoint", "not_found", "method_not_allowed", "timeout", "payload_too_large", "media_fetch_failed", "rate_limited", "provider_error", "idempotency_conflict", "idempotency_in_progress", "idempotency_unavailable", "provider_invalid_response", "no_provider_available", "byok_invalid_credential", "byok_rate_limited", "byok_unavailable", "feature_unavailable", "internal"

{}

```json
"invalid_parameter"
```

- user_id (optional): s239

### s239: string | null

Organization of the API key, if the key was recognized.

{}

```json
"org_01k7tm2c4e6g8j0k2m4p6r8t0v"
```

## Response 401: application/json

Missing, invalid or expired API key

## Response 402: application/json

Insufficient key or organization credit for the bounded reservation

## Response 403: application/json

Organization, workspace or key policy forbids this model

## Response 404: application/json

Unknown model or no eligible decision route; metadata.issues and remedy_hint explain how to fix it

## Response 408: application/json

Request upload or upstream response timed out

## Response 409: application/json

idempotency_conflict: this key has different request content; use a new key. idempotency_in_progress: the original is running; respect Retry-After. idempotency_unavailable: no safe replay is possible; do not silently recompute. See remedy_hint.

## Response 413: application/json

Body or parsed JSON exceeds its memory limit

## Response 429: application/json

Customer or provider rate limit; Retry-After gives seconds to wait

## Response 500: application/json

Unexpected gateway error

## Response 501: application/json

feature_unavailable: A required feature is permanently unconfigured on this gateway, for example encrypted idempotency replay without its encryption key, PII redaction without a detector, or BYOK import without import keys. Ask the operator to configure it or remove the optional feature from the request. Retrying the identical request cannot enable the feature: retryable is false and no Retry-After header is sent. Temporary cache, database, detector or provider outages, pending imports and missing or revoked individual customer credentials retain their existing error types.

## Response 502: application/json

Safe provider error or invalid decision/usage response

## Response 503: application/json

Providers failed, memory is busy, or gateway is shutting down
