Agentic Platform
Documentation API reference Tools Skills

Tools

AI Decisions Gateway

ai_decisions_gateway MCP

Classify text with typed questions and get each answer's confidence

Answer typed questions about a text with OpenAI's Decisions API, which picks answers instead of writing them: faster and cheaper than ai_gateway for classifying, routing, flagging or scoring, and every answer comes with how sure the model is. Use ai_gateway when something has to be written. The text to judge goes in user_prompt. The questions go in structured_output_json_schema, one per field, with the field's description as its question, and system_prompt holds framing shared by every question. A field name cannot contain a dot. Put a description on every field: a field without one is asked by its name. Each field must be one of: boolean (yes/no); enum of strings or whole numbers (pick one, up to 255 options); array of an enum (yes/no per option); number with minimum 0 and maximum 1 (the probability itself); integer levels 0..N with a description per level in anyOf/const (a score, up to 10 levels); or an object of these. At most 200 questions per text, counting one per option of an array field. structured_output mirrors the schema, with each field replaced by {"value": ..., "confidence": ..., "probabilities": ..., "score": ...}, so it does not validate against the schema itself. confidence runs from 0 to 1; a probability field has none, being a probability already. A score's value is its continuous score rounded to the nearest level, which can land between two likely levels on one the model gave no weight to: read probabilities for the likeliest level.

Playground

POST
item
prefeed

List of agent pre-calls whose results are injected into the user prompt before the LLM runs.

user_prompt required

The text to judge. Put the questions in structured_output_json_schema and system_prompt: a question written here is judged as text, not asked.

config
prefeed

List of agent pre-calls whose results are injected into the user prompt before the LLM runs.

system_prompt

Framing shared by every question: what the texts are and what they are judged for.

structured_output_json_schema required

A JSON Schema of "type": "object" whose properties are the questions: each property is one question, its description is the question asked, and its type is the kind of answer. Each field must be one of: boolean (yes/no); enum of strings or whole numbers (pick one, up to 255 options); array of an enum (yes/no per option); number with minimum 0 and maximum 1 (the probability itself); integer levels 0..N with a description per level in anyOf/const (a score, up to 10 levels); or an object of these. See the example for one field of each kind.

model_settings

A model on OpenAI's Decisions API.

boolean_threshold

How likely a yes has to be before a boolean field is true, from 0 to 1. Raise it where a false positive is the expensive mistake.

model required

The model, by its bare name (no provider prefix).

Credits

Fixed cost per call plus input tokens only -- no output tokens. Prefeed agents are billed on top, at their own rates.

These usage SKUs can be charged on a call.

SKU Credits Description
Tool call 1 per request Charged once per successful item, on top of any usage below.
GPT-6 Luna (Decisions) (standard), input 100 per million tokens Tokens the model reads from the prompt you send.

Schemas

item is what you send, config how the tool behaves, and the response is what you get back.

Item

object
Properties
prefeed array

List of agent pre-calls whose results are injected into the user prompt before the LLM runs.

Items: PrefeedCall

Default: []

user_prompt string required

The text to judge. Put the questions in structured_output_json_schema and system_prompt: a question written here is judged as text, not asked.

Example: "My parcel never arrived and nobody answers. Refund me now!"

Example
{
  "prefeed": [],
  "user_prompt": "My parcel never arrived and nobody answers. Refund me now!"
}

Type Definitions

1 type

These are the available sub-object types that can be used in the properties above.

PrefeedCall object
#

A pre-call to an agent whose result is injected into the user prompt before the LLM runs.

description string required

Description of the prefeed result (used as context label in the prompt)

agent string required

Agent ID to call

item object required

Item payload for the agent

config object

Optional config payload for the agent

Default: {}

Configuration

object
Properties
prefeed array

List of agent pre-calls whose results are injected into the user prompt before the LLM runs.

Items: PrefeedCall

Default: []

system_prompt string

Framing shared by every question: what the texts are and what they are judged for.

Default: ""

structured_output_json_schema object required

A JSON Schema of "type": "object" whose properties are the questions: each property is one question, its description is the question asked, and its type is the kind of answer. Each field must be one of: boolean (yes/no); enum of strings or whole numbers (pick one, up to 255 options); array of an enum (yes/no per option); number with minimum 0 and maximum 1 (the probability itself); integer levels 0..N with a description per level in anyOf/const (a score, up to 10 levels); or an object of these. See the example for one field of each kind.

Example: {"properties": {"team": {"description": "Which team should handle this ticket?", "enum": ["billing", "logistics", "tech"]}, "angry": {"description": "Is the customer angry?", "type": "boolean"}, "topics": {"description": "Which topics does the ticket raise?", "items": {"enum": ["refund", "delay", "damage"]}, "type": "array"}, "refund_likelihood": {"description": "How likely is the customer to ask for a refund?", "maximum": 1, "minimum": 0, "type": "number"}, "severity": {"anyOf": [{"const": 0, "description": "cosmetic"}, {"const": 1, "description": "annoying"}, {"const": 2, "description": "blocking"}, {"const": 3, "description": "data loss"}], "description": "How severe is the issue?", "type": "integer"}}, "required": ["team", "angry", "topics", "refund_likelihood", "severity"], "type": "object"}

model_settings OpenAIDecisionsSettings

The decision model and how it turns probabilities into answers

Type: OpenAIDecisionsSettings

Example
{
  "prefeed": [],
  "system_prompt": "",
  "structured_output_json_schema": {
    "properties": {
      "team": {
        "description": "Which team should handle this ticket?",
        "enum": [
          "billing",
          "logistics",
          "tech"
        ]
      },
      "angry": {
        "description": "Is the customer angry?",
        "type": "boolean"
      },
      "topics": {
        "description": "Which topics does the ticket raise?",
        "items": {
          "enum": [
            "refund",
            "delay",
            "damage"
          ]
        },
        "type": "array"
      },
      "refund_likelihood": {
        "description": "How likely is the customer to ask for a refund?",
        "maximum": 1,
        "minimum": 0,
        "type": "number"
      },
      "severity": {
        "anyOf": [
          {
            "const": 0,
            "description": "cosmetic"
          },
          {
            "const": 1,
            "description": "annoying"
          },
          {
            "const": 2,
            "description": "blocking"
          },
          {
            "const": 3,
            "description": "data loss"
          }
        ],
        "description": "How severe is the issue?",
        "type": "integer"
      }
    },
    "required": [
      "team",
      "angry",
      "topics",
      "refund_likelihood",
      "severity"
    ],
    "type": "object"
  },
  "model_settings": {
    "boolean_threshold": 0.5,
    "model": "gpt-6-luna"
  }
}

Type Definitions

2 types

These are the available sub-object types that can be used in the properties above.

OpenAIDecisionsSettings object
#

A model on OpenAI's Decisions API.

boolean_threshold number

How likely a yes has to be before a boolean field is true, from 0 to 1. Raise it where a false positive is the expensive mistake.

Default: 0.5

min 0.0, max 1.0

model string required

The model, by its bare name (no provider prefix).

PrefeedCall object
#

A pre-call to an agent whose result is injected into the user prompt before the LLM runs.

description string required

Description of the prefeed result (used as context label in the prompt)

agent string required

Agent ID to call

item object required

Item payload for the agent

config object

Optional config payload for the agent

Default: {}

Response

object

The answers, each with how sure the model is

Properties
structured_output object required

The schema's fields, each replaced by {value, confidence, probabilities, score}; keys that do not apply to a field are left out.

Example
{
  "structured_output": {}
}

Endpoints

POST http://agents.botify.com/{organization}/{project}/ai_decisions_gateway/process
POST http://agents.botify.com/{organization}/{project}/ai_decisions_gateway/batch_process
POST http://agents.botify.com/{organization}/{project}/ai_decisions_gateway/async_process
POST http://agents.botify.com/{organization}/{project}/ai_decisions_gateway/async_batch_process

See running a long job in the background for the polling flow.

cURL

curl -X POST "http://agents.botify.com/{organization}/{project}/ai_decisions_gateway/process" \
  -H "Authorization: Bearer $BOTIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "item": {
    "user_prompt": "My parcel never arrived and nobody answers. Refund me now!"
  },
  "config": {
    "structured_output_json_schema": {
      "properties": {
        "team": {
          "description": "Which team should handle this ticket?",
          "enum": [
            "billing",
            "logistics",
            "tech"
          ]
        },
        "angry": {
          "description": "Is the customer angry?",
          "type": "boolean"
        },
        "topics": {
          "description": "Which topics does the ticket raise?",
          "items": {
            "enum": [
              "refund",
              "delay",
              "damage"
            ]
          },
          "type": "array"
        },
        "refund_likelihood": {
          "description": "How likely is the customer to ask for a refund?",
          "maximum": 1,
          "minimum": 0,
          "type": "number"
        },
        "severity": {
          "anyOf": [
            {
              "const": 0,
              "description": "cosmetic"
            },
            {
              "const": 1,
              "description": "annoying"
            },
            {
              "const": 2,
              "description": "blocking"
            },
            {
              "const": 3,
              "description": "data loss"
            }
          ],
          "description": "How severe is the issue?",
          "type": "integer"
        }
      },
      "required": [
        "team",
        "angry",
        "topics",
        "refund_likelihood",
        "severity"
      ],
      "type": "object"
    }
  }
}'

Over MCP

This tool is exposed as the MCP tool ai_decisions_gateway. An MCP client passes organization, project and item as tool arguments. Set up MCP →

Raw metadata