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

# Evaluate state against typed questions (TypeSafe System One)

> Mirrors TypeSafe AI's native `POST /v1/systemone` exactly, so the official TypeSafe SDKs work by pointing `TYPESAFE_BASE_URL` at this API. Send a `state` plus a map of typed `questions` (noul, choice, score) and receive one typed `answer` per question with probabilities and confidence. Requires a model whose `output_modality` is `evaluation` (typesafe-ai/jev); text models return 400. Billed on `usage.input_tokens` only; output tokens are reported but free. State and questions share a budget of roughly 32,000 tokens.



## OpenAPI

````yaml /openapi.yaml post /v1/systemone
openapi: 3.1.0
info:
  title: Impossibl AI API
  version: 0.0.1
  description: >
    The Impossibl AI API is one API for all AI providers, OpenAI-compatible
    across OpenAI,

    Anthropic, Google, xAI, and more (`GET /v1/models` lists the full catalog),

    billed from a prepaid credit balance.


    Usage is billed at the model rates published by GET /v1/models with no usage
    markup.

    Prepaid credit purchases charge a separate fixed 5% platform fee before tax.


    **Get started**

    Create a workspace key at https://impossibl.com/dashboard, then call a model
    with

    `Authorization: Bearer <key>` and a full model ID from `GET /v1/models`.

    The walkthrough is at https://impossibl.com/docs/quickstart.


    Agents can create a funded account and initial key with `POST /v1/accounts`.

    The current API continues to use `/v1`; there is no `/v2` base URL.

    Conversation history is managed by your application. Provider-specific SDK

    endpoints and fields outside this specification are not guaranteed
    compatible.
servers:
  - url: https://api.impossibl.com
    description: Production
  - url: http://localhost:8787
    description: Local dev
security:
  - BearerKey: []
paths:
  /v1/systemone:
    post:
      summary: Evaluate state against typed questions (TypeSafe System One)
      description: >-
        Mirrors TypeSafe AI's native `POST /v1/systemone` exactly, so the
        official TypeSafe SDKs work by pointing `TYPESAFE_BASE_URL` at this API.
        Send a `state` plus a map of typed `questions` (noul, choice, score) and
        receive one typed `answer` per question with probabilities and
        confidence. Requires a model whose `output_modality` is `evaluation`
        (typesafe-ai/jev); text models return 400. Billed on
        `usage.input_tokens` only; output tokens are reported but free. State
        and questions share a budget of roughly 32,000 tokens.
      operationId: evaluateSystemOne
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemOneRequest'
      responses:
        '200':
          description: >-
            One answer per question, keyed by the ids you chose, plus the
            concrete model version and token usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '404':
          $ref: '#/components/responses/UnknownModel'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/ProviderNotConfigured'
components:
  schemas:
    SystemOneRequest:
      type: object
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          example: typesafe-ai/jev
        state:
          description: >-
            The content to evaluate — a plain string, or structured data such as
            a record or chat log.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        questions:
          type: object
          minProperties: 1
          description: Question ids you choose; answers come back under the same ids.
          additionalProperties:
            $ref: '#/components/schemas/SystemOneQuestion'
    SystemOneResponse:
      type: object
      required:
        - model
        - answers
        - usage
      properties:
        model:
          type: string
          example: jev-1.13.0
          description: The concrete model version that answered.
        answers:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SystemOneAnswer'
        usage:
          type: object
          required:
            - input_tokens
            - output_tokens
          properties:
            input_tokens:
              type: integer
              minimum: 0
              description: The billed count.
            output_tokens:
              type: integer
              minimum: 0
              description: Reported by TypeSafe; not billed.
        request_id:
          type: string
    SystemOneQuestion:
      type: object
      required:
        - type
        - instructions
      description: >-
        A typed question. `noul` is yes/no (criteria optional, `{true, false}`
        descriptions); `choice` picks one option (criteria required, option ->
        description or null); `score` rates along an ordered rubric (criteria
        required, array of at least 2 levels, low to high).
      properties:
        type:
          type: string
          enum:
            - noul
            - choice
            - score
        instructions:
          $ref: '#/components/schemas/SystemOneEntry'
        criteria:
          description: Shape depends on `type` — see the description above.
          oneOf:
            - type: object
              additionalProperties:
                $ref: '#/components/schemas/SystemOneEntry'
            - type: array
              minItems: 2
              items:
                $ref: '#/components/schemas/SystemOneEntry'
    SystemOneAnswer:
      type: object
      required:
        - type
      description: >-
        Matches its question's `type`. `noul` carries `noul` (0..1, probability
        of yes) and no confidence. `choice` carries `choice`, `confidence` and
        `probabilities`. `score` carries `score`, `confidence`, `legend` (level
        index -> description) and `probabilities`.
      properties:
        type:
          type: string
          enum:
            - noul
            - choice
            - score
        noul:
          type: number
          minimum: 0
          maximum: 1
        choice:
          type: string
        score:
          type: number
        confidence:
          type: number
          minimum: 0
          maximum: 1
        legend:
          type: object
          additionalProperties:
            type: string
        probabilities:
          type: object
          additionalProperties:
            type: number
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                Common types include authentication_error,
                invalid_request_error, insufficient_quota, billing_required,
                permission_error, upstream_error, and provider_not_configured.
    SystemOneEntry:
      description: >-
        Free-form content the model reads. A string, or JSON structure
        (object/array) when the content is already structured.
      oneOf:
        - type: string
        - type: object
          additionalProperties: true
        - type: array
          items: {}
        - type: 'null'
  responses:
    BadRequest:
      description: Malformed request (bad JSON, or missing required fields).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: '`model` and `messages` are required'
              type: invalid_request_error
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid API key
              type: authentication_error
    InsufficientCredits:
      description: >-
        Available credits or postpaid headroom cannot cover the request's
        balance check, which can include estimated input cost. Top up or reduce
        the request size.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Insufficient credits. Top up to continue.
              type: insufficient_quota
    UnknownModel:
      description: The requested `model` id is not in the registry (see GET /v1/models).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: 'Unknown model: foo/bar'
              type: invalid_request_error
    UpstreamError:
      description: The upstream provider returned an error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: 'permission-denied: ...'
              type: upstream_error
    ProviderNotConfigured:
      description: The provider for this model has no API key configured on the gateway.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: 'Provider not configured: missing OPENAI_API_KEY'
              type: provider_not_configured
  securitySchemes:
    BearerKey:
      type: http
      scheme: bearer
      description: Gateway API key (`imp-rt-...`) from POST /v1/accounts or /v1/keys.

````