Skip to content

Decisions (OpenAI wire)

$0.001 per callUSDC via x402POST /v1/decisions

OpenAI's Decisions API on its own wire: point an OpenAI SDK's base URL here and client.decisions.create works unchanged, paid per call. Send POST /v1/decisions with the required fields input and questions and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with model, answers and usage.

Send input (text, or user messages with input_text parts) and questions; get back answers your code can branch on. predicate returns the probability a condition holds; choice returns one of your values with probabilities and confidence; score returns a probability-weighted position on your ordered levels. Up to 8 questions per call. Served by gpt-6-luna, with jev-latest, Microsoft Decision-1 and Gemini Decision-1 as fallbacks; the answer names the model that served, and fallback_from when the first was unavailable. Text input only. Model-backed, not deterministic.

Category: AI & computeTags: ai classify judgment routing openai decisions

Try in playground →

Parameters

NameTypeRequiredDescription
modelstring (one of: gpt-6-luna)noDefaults to gpt-6-luna.
inputstring | arrayyesThe content to evaluate: a string, or user messages with input_text parts. Up to 8000 characters. Also accepted as text, data, str, string, body, content.
questionsarrayyesEach has type (predicate/choice/score), a unique name and instructions; choice adds choices [{value, description}], score adds levels [{label, description}] lowest first.

Example request

curl -i -X POST https://agent402.tools/v1/decisions \
  -H "Content-Type: application/json" \
  -d '{"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."}]}]}'

Without payment this returns HTTP 402 Payment Required with the exact price for decisions; any x402 v2 or MPP client pays it and retries.

Watch a call get paid

RequestPOST /v1/decisions
402$0.001 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "model": "gpt-6-luna",
  "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
    }
  ],
  "usage": {
    "input_tokens": 145,
    "output_tokens": 0,
    "total_tokens": 145
  }
}
FieldTypeAlways presentIn the example
modelstringnogpt-6-luna
answersarray of objectsno1 item in the example
usageobjectno3 fields: input_tokens, output_tokens, total_tokens

From an MCP client

catalog.call {
  "slug": "decisions",
  "params": {
    "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."
          }
        ]
      }
    ]
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for decisions; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.14.1.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/v1/decisions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "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."
          }
        ]
      }
    ]
  }),
});

Related tools

Typed judgment

$0.001POST /v1/judge

Ask a typed question about any content and get an answer your code can branch on, not prose to parse.

Judge long documents (preview)

$0.02POST /v1/judge/long

The typed questions of /v1/judge over a document of up to 900 KB (about 262k tokens), in one call.

Judge images (preview)

$0.003POST /v1/judge/vision

Ask typed questions about up to 4 images (PNG or JPEG) and get answers your code can branch on: noul (yes/no.

Image generation

$0.03POST /api/image-gen

Generate an image from a text prompt using GPT Image 2.6 Flare (low quality, 1024x1024).

Image generation (HD)

$0.10POST /api/image-gen-hd

Generate a higher-quality image from a text prompt using GPT Image 2.6 Flare (medium quality, 1024x1024).

Image generation (Premium)

$0.15POST /api/image-gen-premium

Generate a larger image from a text prompt using GPT Image 2.6 Sunburst (medium quality): 1536x1024 landscape.