# Create a decision (OpenAI format)
URL: https://docs.munito.ai/api/createOpenAIDecision

POST /decisions

Preview. OpenAI's Decisions contract: ordered Predicate, Choice, and Score questions about one input, answered in the same order with probabilities. Use an OpenAI base URL of https://api.munito.ai/inference/v1 and call this path over HTTP. The models, rate limits, billing, and errors are those of Evaluate decisions, with OpenAI error envelopes. perplexity-ai/pplx-decider-v1.2 accepts up to 8 input_image parts whose image_url is a base64 data URL; an image link gets 400. blockbrain/cygnet is text only, and a request with an image gets 400.

```json
{
  "operationId": "createOpenAIDecision",
  "summary": "Create a decision (OpenAI format)",
  "tags": [
    "Decisions"
  ],
  "description": "Preview. OpenAI's Decisions contract: ordered Predicate, Choice, and Score questions about one input, answered in the same order with probabilities. Use an OpenAI base URL of https://api.munito.ai/inference/v1 and call this path over HTTP. The models, rate limits, billing, and errors are those of Evaluate decisions, with OpenAI error envelopes. perplexity-ai/pplx-decider-v1.2 accepts up to 8 input_image parts whose image_url is a base64 data URL; an image link gets 400. blockbrain/cygnet is text only, and a request with an image gets 400.",
  "parameters": [
    {
      "name": "munito-service-tier",
      "in": "header",
      "description": "priority, standard or flex. The response names the tier that is billed; see x-ratelimit-over-limit. See [Service tiers](https://docs.munito.ai/service-tiers).",
      "schema": {
        "type": "string",
        "enum": [
          "priority",
          "standard",
          "flex"
        ],
        "default": "standard"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "model",
            "input",
            "questions"
          ],
          "properties": {
            "model": {
              "type": "string",
              "description": "A decision model available to your account."
            },
            "input": {
              "description": "A string, or user messages whose content is a string or input_text and input_image parts. Images go to perplexity-ai/pplx-decider-v1.2 only.",
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              ]
            },
            "questions": {
              "type": "array",
              "description": "1 to 64 questions, in answer order.",
              "items": {
                "type": "object",
                "required": [
                  "type",
                  "instructions"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "predicate",
                      "choice",
                      "score"
                    ]
                  },
                  "instructions": {
                    "type": "string",
                    "description": "The question or rubric."
                  },
                  "name": {
                    "type": "string",
                    "description": "An optional name, returned with the answer."
                  },
                  "choices": {
                    "type": "array",
                    "description": "Choice only: 2 to 255 distinct values (string or boolean), each with an optional description.",
                    "items": {
                      "type": "object",
                      "required": [
                        "value"
                      ]
                    }
                  },
                  "levels": {
                    "type": "array",
                    "description": "Score only: 2 to 10 ordered levels, lowest first, each with a label and an optional description.",
                    "items": {
                      "type": "object",
                      "required": [
                        "label"
                      ]
                    }
                  }
                }
              }
            },
            "safety_identifier": {
              "type": "string",
              "description": "Up to 128 characters. Accepted and not used."
            }
          }
        },
        "example": {
          "model": "perplexity-ai/pplx-decider-v1.2",
          "input": "The parcel arrived with a crushed corner and the mug inside is broken.",
          "questions": [
            {
              "type": "predicate",
              "instructions": "Is the item damaged?"
            },
            {
              "type": "choice",
              "instructions": "What should we offer?",
              "choices": [
                {
                  "value": "refund"
                },
                {
                  "value": "replacement"
                }
              ]
            }
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Answers in question order. A predicate returns its probability. A choice returns the chosen value, its confidence, and the probability of each value. A score returns the expected level, its confidence, and the probability of each level.",
      "content": {
        "application/json": {
          "example": {
            "model": "perplexity-ai/pplx-decider-v1.2",
            "answers": [
              {
                "type": "predicate",
                "name": null,
                "probability": 0.99
              },
              {
                "type": "choice",
                "name": null,
                "choice": "replacement",
                "confidence": 0.21,
                "probabilities": [
                  {
                    "value": "refund",
                    "probability": 0.39
                  },
                  {
                    "value": "replacement",
                    "probability": 0.61
                  }
                ]
              }
            ],
            "usage": {
              "input_tokens": 138,
              "output_tokens": 0,
              "input_tokens_details": {
                "cached_tokens": 0,
                "cache_write_tokens": 0
              },
              "output_tokens_details": {
                "reasoning_tokens": 0
              },
              "total_tokens": 138
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid request or unavailable decision model, in an OpenAI error envelope."
    },
    "401": {
      "description": "Authentication failed, in an OpenAI error envelope."
    },
    "429": {
      "description": "Rate limit exceeded. Retry according to the Retry-After header."
    }
  }
}
```

# Shared API schemas
{
  "securitySchemes": {
    "BearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Your Munito API key."
    },
    "ApiKeyAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key",
      "description": "Your Munito API key."
    }
  }
}