For the complete documentation index, see llms.txt. This page is also available as Markdown.

Decisions

Create Decisions

post

Evaluates shared evidence (input) against a list of typed questions and returns structured answers instead of generated text. Served by OpenAI's Decisions API (gpt-6-luna, currently in public beta). FastRouter adds id, model and usage (with cost, chat_id and provider) to the response.

Question types

  • predicate: the probability (0 to 1) that a yes/no condition is true.

  • choice: one option from an unordered set, with a probability per option and a confidence.

  • score: a rating against ordered levels (lowest first), returned as the probability-weighted average of the 0-based level indices, with a probability per level and a confidence.

  • Give every question a unique name; it is echoed on its answer. A duplicate name is rejected with 400.

Behavior

  • One answer per question, in request order. A question the model declines comes back as {"type": "refusal", "name": "..."}; check type before reading probability, choice or score.

  • Images must be inline base64 data URLs in input_image parts. Hosted image URLs and file_id inputs are not supported.

  • Billed on input tokens only, so usage.output_tokens is always 0; usage.cost reports the charge in USD.

  • BYOK OpenAI keys, including custom hosts, are honoured. The upstream call is capped at about 15 seconds; a slower request fails with 502.

Response format

  • The response follows the shape of the request. A Decisions-shaped body (input plus a questions array) is answered with an answers array; a TypeSafe systemone-shaped body (state plus a questions object) is answered with answers keyed by question id.

  • Set response_format to "decisions" or "systemone" to override. This changes only the response; the request keeps its own schema.

  • Alias path: /api/v1/systemone (same behavior).

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
modelstringRequired

Decision model. gpt-6-luna is currently the only model served on this endpoint.

Example: gpt-6-luna
inputone ofRequired

Shared evidence for all questions: a text string, or an array of user messages containing input_text and input_image parts. Forwarded to the provider byte-for-byte.

stringOptional
or
response_formatone ofOptional

Overrides the response shape. By default the response follows the shape of the request, so a Decisions-shaped body is answered in the Decisions shape (an ordered answers array). systemone returns answers as a map keyed by question name in the TypeSafe systemone shape, with a legend on score answers. Accepted as a plain string or as an object {"type": "..."}. Aliases: decision/openai = decisions, system_one/typesafe = systemone. Any other value (e.g. json_object) is ignored. It changes only the response; the request keeps its own schema.

string · enumOptionalPossible values:
or
Responses
200

Decisions evaluated. The body shape depends on response_format.

application/json
or
post/api/v1/decisions
POST /api/v1/decisions HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 458

{
  "model": "gpt-6-luna",
  "input": "I was charged twice for my order.",
  "questions": [
    {
      "type": "choice",
      "name": "department",
      "instructions": "Which department should handle this complaint?",
      "choices": [
        {
          "value": "billing",
          "description": "Payments, invoices, and refunds."
        },
        {
          "value": "technical",
          "description": "Problems using the product."
        },
        {
          "value": "shipping",
          "description": "Delivery and tracking."
        },
        {
          "value": "other",
          "description": "Requests outside these categories."
        }
      ]
    }
  ]
}
{
  "answers": [
    {
      "type": "choice",
      "name": "department",
      "choice": "billing",
      "probabilities": [
        {
          "value": "billing",
          "probability": 1
        },
        {
          "value": "technical",
          "probability": 0
        },
        {
          "value": "shipping",
          "probability": 0
        },
        {
          "value": "other",
          "probability": 0
        }
      ],
      "confidence": 1
    }
  ],
  "id": "fr_64320228-976f-40d3-91b6-1f81b3c5c10f",
  "model": "gpt-6-luna",
  "usage": {
    "input_tokens": 145,
    "output_tokens": 0,
    "total_tokens": 145,
    "cost": 0.0000145,
    "chat_id": "fr_64320228-976f-40d3-91b6-1f81b3c5c10f",
    "provider": "openai"
  }
}

Last updated