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

# Answer typed questions about an input (OpenAI Decisions)

> Mirrors OpenAI's native `POST /v1/decisions` exactly, so the official OpenAI SDKs work by pointing `OPENAI_BASE_URL` at this API. Send an `input` (text, or user messages with `input_text`/base64 `input_image` parts) plus an array of typed `questions` (predicate, choice, score), each with a unique `name`, and receive one typed answer per question with probabilities. Requires openai/gpt-6-luna-decisions; other models return 400. Billed on `usage.input_tokens` only ($0.10/M, $0.20/M above 272K input tokens); output and cache tokens are never billed. OpenAI's own validation errors are returned as 400.



## OpenAPI

````yaml /openapi.yaml post /v1/decisions
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/decisions:
    post:
      summary: Answer typed questions about an input (OpenAI Decisions)
      description: >-
        Mirrors OpenAI's native `POST /v1/decisions` exactly, so the official
        OpenAI SDKs work by pointing `OPENAI_BASE_URL` at this API. Send an
        `input` (text, or user messages with `input_text`/base64 `input_image`
        parts) plus an array of typed `questions` (predicate, choice, score),
        each with a unique `name`, and receive one typed answer per question
        with probabilities. Requires openai/gpt-6-luna-decisions; other models
        return 400. Billed on `usage.input_tokens` only ($0.10/M, $0.20/M above
        272K input tokens); output and cache tokens are never billed. OpenAI's
        own validation errors are returned as 400.
      operationId: createDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionsRequest'
      responses:
        '200':
          description: >-
            One answer per question, in order, each echoing its question's name,
            plus token usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionsResponse'
        '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:
    DecisionsRequest:
      type: object
      required:
        - model
        - input
        - questions
      properties:
        model:
          type: string
          example: openai/gpt-6-luna-decisions
        input:
          description: >-
            Text, or user messages whose content holds `input_text` and
            `input_image` (base64 data URL) parts.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        questions:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - type
              - name
              - instructions
            properties:
              type:
                type: string
                enum:
                  - predicate
                  - choice
                  - score
              name:
                type: string
                description: Unique within the request; the answer echoes it.
              instructions:
                type: string
              choices:
                type: array
                minItems: 2
                description: Required for `choice`.
                items:
                  type: object
                  required:
                    - value
                  properties:
                    value:
                      type: string
                    description:
                      type: string
              levels:
                type: array
                description: Required for `score`, ordered lowest to highest.
                items:
                  type: object
                  required:
                    - label
                  properties:
                    label:
                      type: string
                    description:
                      type: string
    DecisionsResponse:
      type: object
      required:
        - model
        - answers
        - usage
      properties:
        model:
          type: string
          example: gpt-6-luna
        answers:
          type: array
          items:
            type: object
            required:
              - type
              - name
            description: >-
              `predicate` carries `probability` (0..1). `choice` carries
              `choice`, `confidence` and `probabilities` [{value, probability}].
              `score` carries `score` (probability-weighted 0-based level
              index), `confidence` and `probabilities` [{value, label,
              probability}]. `refusal` carries only `name`.
            properties:
              type:
                type: string
                enum:
                  - predicate
                  - choice
                  - score
                  - refusal
              name:
                type: string
              probability:
                type: number
                minimum: 0
                maximum: 1
              choice:
                type: string
              score:
                type: number
              confidence:
                type: number
                minimum: 0
                maximum: 1
              probabilities:
                type: array
                items:
                  type: object
        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: Always 0.
            total_tokens:
              type: integer
              minimum: 0
    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.
  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.

````

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