OpenMayhem Decisions API
The Decisions API from OpenMayhem — 2 operation(s) for decisions.
The Decisions API from OpenMayhem — 2 operation(s) for decisions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/openmayhem-ai:openmayhem-ai-decisions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OpenMayhem Decisions API
version: 1.0.0
description: 'Pay-per-use AI inference over a decentralised provider network. OpenAI-compatible where an equivalent exists. Billing is reserve-then-settle from prepaid credit; every charge settles against a provider-signed receipt. Human docs: https://openmayhem.ai/docs (each page also at /docs/.md).'
servers:
- url: https://api.openmayhem.ai/v1
security:
- bearerAuth: []
tags:
- name: Decisions
paths:
/decisions:
post:
summary: Typed policy decision
description: Requires the DECISIONS scope. Native Laya and the Flash JEV decision model evaluate application state against typed choice, score, or yes-or-no questions. Flash JEV may also use /decisions/flash-jev. These endpoints are synchronous, not OpenAI chat endpoints.
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/MinAttTier'
- $ref: '#/components/parameters/MinCtx'
- $ref: '#/components/parameters/Quant'
- $ref: '#/components/parameters/PreferProviders'
- $ref: '#/components/parameters/Hedge'
- $ref: '#/components/parameters/MinTokS'
- $ref: '#/components/parameters/MaxWaitMs'
- $ref: '#/components/parameters/MaxRetailCostUsd'
- $ref: '#/components/parameters/MaxInputPricePerMillionUsd'
- $ref: '#/components/parameters/MaxOutputPricePerMillionUsd'
- $ref: '#/components/parameters/MaxRepresentativeRequestPriceUsd'
- $ref: '#/components/parameters/EstimateId'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- model
- state
- questions
properties:
model:
type: string
description: Catalog model id (vendor/model).
state:
description: A string, object, or message array containing the state to evaluate.
questions:
type: object
description: Question map. Every entry declares type choice, score, or noul and its instructions; choice and score questions also declare criteria.
additionalProperties: true
checkpoint:
type: string
enum:
- english
- multilingual
- typed-decisions
task:
type: string
enum:
- typed_decisions
lang:
type: string
minLength: 1
maxLength: 128
auto_task_detection:
type: boolean
default: false
email:
type: object
shortlist:
type: object
temperature:
type: object
limits:
type: object
additionalProperties:
description: Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}.
responses:
'200':
description: Typed answers, checkpoint routing, receipt-backed usage.cost, and openmayhem request evidence.
'400':
description: Contract violation; nothing charged.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'402':
description: Insufficient credit.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'403':
description: Scope, allowlist, spend limit or account restriction.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'429':
description: Rate limit; wait Retry-After seconds.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'503':
description: No provider capacity; retry with backoff.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
tags:
- Decisions
operationId: postDecisions
x-operation-id-source: derived
/decisions/flash-jev:
post:
summary: Flash JEV typed decisions
description: Requires the DECISIONS scope. Uses openmayhem/flash-jev, a platform-side typed-decision view of the canonical Qwen3.8 Flash-Next chat model. The request is charged at Flash-Next's current input and output token rates; there is no separate tariff. It asks Flash for probabilities in strict JSON and applies the same mechanical validation, bounded normalization (sum error at most 0.051), lexical tie break, weighted score, and request-sourced score legend used in the published evaluation. Confidence is a deterministic concentration display, not an independently calibrated forecast. No label-specific correction is applied. Invalid outputs return 502 after the signed model usage is charged; do not retry an ambiguous outcome as new work. Maximum input is 64,000 exact model tokens across state and questions, and 32,000 for state plus any single question. At most 64 named questions. The decision result is synchronous and does not stream.
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/MinAttTier'
- $ref: '#/components/parameters/MinCtx'
- $ref: '#/components/parameters/Quant'
- $ref: '#/components/parameters/PreferProviders'
- $ref: '#/components/parameters/Hedge'
- $ref: '#/components/parameters/MinTokS'
- $ref: '#/components/parameters/MaxWaitMs'
- $ref: '#/components/parameters/MaxRetailCostUsd'
- $ref: '#/components/parameters/MaxInputPricePerMillionUsd'
- $ref: '#/components/parameters/MaxOutputPricePerMillionUsd'
- $ref: '#/components/parameters/MaxRepresentativeRequestPriceUsd'
- $ref: '#/components/parameters/EstimateId'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- model
- state
- questions
properties:
model:
type: string
enum:
- openmayhem/flash-jev
state:
oneOf:
- type: string
- type: object
- type: array
questions:
type: object
minProperties: 1
maxProperties: 64
description: Map of question IDs to {type, instructions, criteria?}. type is noul, choice or score; choice criteria maps labels to descriptions, and score criteria is an ordered description array.
additionalProperties:
type: object
responses:
'200':
description: decision.result with named, validated decisions; usage.cost and signed receipt evidence.
'400':
description: Contract violation; nothing charged.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'402':
description: Insufficient credit.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'403':
description: Scope, allowlist, spend limit or account restriction.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'413':
description: The exact model tokenizer found an input above the 64k total or 32k per-question limit; nothing charged.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'429':
description: Rate limit; wait Retry-After seconds.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'502':
description: The model produced invalid decision JSON or probabilities; signed usage may still be charged.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'503':
description: No provider capacity; retry with backoff.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
tags:
- Decisions
operationId: postDecisionsFlashJev
x-operation-id-source: derived
components:
schemas:
ErrorEnvelope:
type: object
description: Most errors. Failures before body parsing (missing/invalid key, oversized body) are the flat inner object without the error wrapper.
properties:
error:
type: object
required:
- statusCode
- message
properties:
statusCode:
type: integer
message:
type: string
code:
$ref: '#/components/schemas/ErrorCode'
retryAfterSeconds:
type: integer
retryable:
type: boolean
description: 'Screening errors: false for a confirmed policy denial; true when review is temporarily unavailable.'
request_id:
type: string
description: Correlation ID for the request, including a screening refusal before purchase.
policy:
type: string
enum:
- minor_sexual_exploitation
- targeted_violence
- fraud
- credential_theft
description: Confirmed content_policy_violation only.
model:
type: string
description: 'price_ceiling_exceeded only: the model of the request.'
field:
type: string
enum:
- max_input_price_per_million_usd
- max_output_price_per_million_usd
- max_representative_request_price_usd
description: 'price_ceiling_exceeded only: the ceiling the price is above.'
ceiling:
type: string
description: 'price_ceiling_exceeded only: the ceiling in USD.'
current:
type: string
description: 'price_ceiling_exceeded only: the model''s current retail price in that unit, as exact USD.'
details:
type: array
description: '422 only: each invalid field.'
items:
type: object
properties:
path: {}
message:
type: string
ErrorCode:
type: string
description: Stable machine-readable cause.
enum:
- content_policy_violation
- policy_review_unavailable
- missing_api_key
- invalid_api_key
- insufficient_scope
- model_not_allowed
- key_spend_limit_exceeded
- request_cost_limit_exceeded
- retail_cost_limit_exceeded
- price_ceiling_exceeded
- account_not_active
- insufficient_credit
- invalid_content_length
- request_body_too_large
- contract_attribute_required
- invalid_request
- invalid_catalog_filter
- invalid_routing_control
- routing_control_not_public
- routing_control_not_supported_for_endpoint
- incompatible_routing_constraints
- validation_failed
- model_not_found
- job_not_found
- request_not_found
- artifact_not_found
- artifact_expired
- endpoint_not_supported
- token_count_unsupported
- token_count_failed
- idempotency_in_flight
- idempotency_conflict
- idempotency_replay_unavailable
- rate_limited
- client_closed
- state_conflict
- upstream_error
- capacity_unavailable
- no_provider_satisfies_attestation_tier
- no_provider_satisfies_quant
- context_requirement_unavailable
- preferred_provider_unavailable
- context_capacity_unavailable
- no_provider_within_price_band
- confidential_compute_unavailable
- api_key_verification_unavailable
UsdDecimal:
type: string
pattern: ^(0|[1-9][0-9]*)(\.[0-9]{1,6})?$
example: '0.50'
description: Non-negative decimal USD string with at most 6 decimal places, parsed with exact fixed-point arithmetic.
parameters:
Hedge:
name: X-Mayhem-Hedge
in: header
required: false
schema:
type: integer
enum:
- 0
- 1
default: 0
description: Text generation only. Set to 1 to request hedged dispatch across eligible routes, or 0 to disable it. It cannot be combined with X-Mayhem-Prefer-Providers.
MaxOutputPricePerMillionUsd:
name: X-OpenMayhem-Max-Output-Price-Per-Million-Usd
in: header
required: false
schema:
$ref: '#/components/schemas/UsdDecimal'
description: Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the model's retail output price per one million tokens (pricing.completion_per_million_au) is higher. The catalog filter max_output_price_per_million_usd takes the same number. It has no effect on a model without an output token rate.
MinAttTier:
name: X-Mayhem-Min-Att-Tier
in: header
required: false
schema:
oneOf:
- type: integer
minimum: 1
maximum: 4
- type: string
enum:
- T1
- T2
- T3
- T4
description: Minimum acceptable provider attestation tier. Unlike the catalog's exact attestation_tier filter, dispatch accepts this tier or any higher tier.
PreferProviders:
name: X-Mayhem-Prefer-Providers
in: header
required: false
schema:
type: string
pattern: ^[0-9a-fA-F]{64}(\s*,\s*[0-9a-fA-F]{64}){0,63}$
description: 'Ordered, comma-separated provider public keys. This is a strict provider set: failover follows the listed order and does not fall back outside the set.'
MinTokS:
name: X-Mayhem-Min-Tok-S
in: header
required: false
schema:
type: number
exclusiveMinimum: 0
description: Minimum sustained throughput in the endpoint's native measured unit per second. For text this is tokens per second; other endpoint families use their Core-defined native unit.
EstimateId:
name: X-OpenMayhem-Estimate
in: header
required: false
schema:
type: string
minLength: 16
description: An estimate_id from POST /estimates. When present, it must match this key, model, body and routing controls; execution refuses a higher live maximum before holding credit.
MaxInputPricePerMillionUsd:
name: X-OpenMayhem-Max-Input-Price-Per-Million-Usd
in: header
required: false
schema:
$ref: '#/components/schemas/UsdDecimal'
description: Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the model's retail input price per one million tokens (pricing.prompt_per_million_au) is higher. The catalog filter max_input_price_per_million_usd takes the same number. It has no effect on a model without an input token rate.
Quant:
name: X-Mayhem-Quant
in: header
required: false
schema:
type: string
minLength: 1
maxLength: 32
example: nvfp4
description: Require one canonical quantization bucket; matching is case-insensitive after normalization.
MaxWaitMs:
name: X-Mayhem-Max-Wait-Ms
in: header
required: false
schema:
type: integer
minimum: 0
maximum: 60000
description: Maximum time in milliseconds to wait for an eligible provider admission. This is not the inference or asynchronous job runtime limit.
MaxRetailCostUsd:
name: X-OpenMayhem-Max-Cost-Usd
in: header
required: false
schema:
$ref: '#/components/schemas/UsdDecimal'
description: Maximum retail USD hold for this request, with at most 6 decimal places. The request is rejected before spend if its worst case is higher. The stricter of this value and the API key's per-request cap wins. This never controls the private wholesale X-Mayhem-Max-Price-Au limit.
MaxRepresentativeRequestPriceUsd:
name: X-OpenMayhem-Max-Representative-Request-Price-Usd
in: header
required: false
schema:
$ref: '#/components/schemas/UsdDecimal'
description: Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the retail price of the model's representative request (pricing.representative_request_au) is higher. The catalog filter max_representative_request_price_usd takes the same number. Use it for media, audio, video and workflow models.
MinCtx:
name: X-Mayhem-Min-Ctx
in: header
required: false
schema:
type: integer
minimum: 1
maximum: 4294967295
description: Text generation only. Minimum provider context capacity in tokens. The effective floor is never lower than the request's calculated input plus output requirement.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: API key from the dashboard, format sk-om-v1-...