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

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Decide with Jiffy (System One)

> System One API: send a state and typed questions (`noul`, `choice`, `score`); get a calibrated probability for each answer. Charged per input token: the state counts once per question.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/systemone
openapi: 3.1.0
info:
  title: Feyn API
  version: 1.0.0
  description: Fine-tuned models, chat completions, traces and scores on api.feyn.ai.
servers:
  - url: https://api.feyn.ai
security:
  - bearerAuth: []
paths:
  /v1/systemone:
    post:
      summary: Decide with Jiffy (System One)
      description: >-
        System One API: send a state and typed questions (`noul`, `choice`,
        `score`); get a calibrated probability for each answer. Charged per
        input token: the state counts once per question.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - questions
              properties:
                model:
                  type: string
                  enum:
                    - jiffy-1.0
                    - jiffy-latest
                  default: jiffy-1.0
                state:
                  description: >-
                    What the questions are about: text, or JSON (read
                    compactly).
                  oneOf:
                    - type: string
                    - type: object
                    - type: array
                questions:
                  type: object
                  description: Up to 64 questions keyed by your own names.
                  additionalProperties:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - noul
                          - choice
                          - score
                      instructions:
                        type: string
                        description: The question. For `noul`, a yes/no question.
                      criteria:
                        description: >-
                          `choice`: each option name and its description (or
                          null), 2 to 255. `score`: an array of 2 to 10 ordered
                          levels. `noul` (optional): `{"true": ..., "false":
                          ...}`.
                        oneOf:
                          - type: object
                          - type: array
            example:
              model: jiffy-1.0
              state: >-
                I was charged twice for my subscription this month. Please
                refund the extra charge.
              questions:
                refund:
                  type: noul
                  instructions: Does this message request a refund?
                team:
                  type: choice
                  instructions: Which team should handle this ticket?
                  criteria:
                    billing: Charges, invoices and refunds
                    technical: Bugs and outages
                    account: Login and settings
                urgency:
                  type: score
                  instructions: How urgent is this message?
                  criteria:
                    - Can wait
                    - Needs attention this week
                    - Needs attention today
      responses:
        '200':
          description: One answer per question.
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                    example: jiffy-1.0
                  answers:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - noul
                            - choice
                            - score
                        noul:
                          type: number
                          description: '`noul`: the probability of yes.'
                        choice:
                          type: string
                          description: '`choice`: the most likely option.'
                        probabilities:
                          type: object
                          additionalProperties:
                            type: number
                          description: >-
                            `choice`: each option's probability. `score`: each
                            level's, keyed "0", "1", .... They sum to 1.
                        confidence:
                          type: number
                          description: >-
                            `choice` and `score`: 0 to 1, from how spread out
                            `probabilities` is.
                        score:
                          type: number
                          description: '`score`: the probability-weighted level number.'
                        legend:
                          type: object
                          additionalProperties: {}
                          description: >-
                            `score`: each level number mapped to its
                            description.
                  usage:
                    type: object
                    properties:
                      input_tokens:
                        type: integer
                        description: >-
                          Charged tokens: state plus question, for each
                          question.
                      output_tokens:
                        type: integer
                        description: Always 0.
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '402':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
        '529':
          description: Jiffy is overloaded; retry after a short delay.
components:
  responses:
    Error:
      description: An error. See the errors guide for each status.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
                - auth_error
                - billing_error
                - permission_error
                - rate_limit_error
                - api_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A workspace API key (`fn_...`).

````

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