Decisions (OpenAI wire)
POST /v1/decisionsOpenAI'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 the result.
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 as fallback; the answer names the model that served, and fallback_from when the first was unavailable. Text input only. Model-backed, not deterministic.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
model | string (one of: gpt-6-luna) | no | Defaults to gpt-6-luna. |
input | string | array | yes | The 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. |
questions | array | yes | Each 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.
Example response
{}
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 AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
inputandquestionsare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool runs a model, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Model-backed: the answer is generated by a model, so the same input can produce different wording.
- A
GETorHEADto /v1/decisions returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB and a streamed response are not replayed).
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?.(false); // keep your own spending ceiling in code
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
POST /v1/judgeAsk a typed question about any content and get an answer your code can branch on, not prose to parse. Send state (the co…
Image generation
POST /api/image-genGenerate an image from a text prompt using GPT Image 2 (low quality, 1024x1024). No API key needed; pay per call via x40…
Image generation (HD)
POST /api/image-gen-hdGenerate a higher-quality image from a text prompt using GPT Image 2 (medium quality, 1024x1024). No API key needed; pay…
Image generation (Premium)
POST /api/image-gen-premiumGenerate a larger image from a text prompt using GPT Image 2 (medium quality): 1536x1024 landscape by default, 1024x1536…
LLM inference
POST /api/llmLLM inference proxy - send an OpenAI-format chat/completions request and get a response from GPT-4o-mini. Supports visio…
LLM inference (Premium)
POST /api/llm-premiumLLM inference proxy (Premium tier) - o3 or o3-mini reasoning models. Supports vision (up to 2 image URLs) and structured…