{
  "info": {
    "x-guidance": "Before planning or calling service operations, read and follow /SKILL.md, referenced by info.x-agent-skill.url on this origin. Explain the demo-only terms and obtain explicit user confirmation before submitting evaluation data or signing payments. Reading the skill and OpenAPI contract is allowed before confirmation. Neither TypeSafe nor Baking Bad accepts responsibility or liability. Never use this service in production or for consequential real-world decisions, even with user confirmation or high model confidence. For demonstrations, combine questions about the same synthetic state into one evaluation where practical; keep instructions and criteria concise. Prefer supported x402 batch settlement within the authorized budget and obtain the exact price from the live 402 challenge for the unchanged request body. Every response carries the Api-Version header, defined once in components.headers.apiVersion; it is the info.version of the document served at /openapi.json. Track it on responses and refetch the document when it changes; use HEAD /openapi.json when there is no recent response and If-None-Match to revalidate a cached ETag. Every response also carries a Link header with rel=\"service-desc\" pointing at /openapi.json. Request and answer schemas are aligned with TypeSafe's public OpenAPI at https://api.typesafe.ai/openapi.json (checked 2026-09-18); where its prose docs differ on optional fields, the live schema defines the accepted shape. This service forwards declared upstream response statuses only: upstream authentication failures, overload status 529, and other undeclared failures become an opaque 503. Never supply a TypeSafe API key to this service. Jev 1.13 documentation gives a 64k-token total context limit and a 32k-token limit for state plus the longest question; the service also limits request bodies to 1 MiB.",
    "title": "Jev",
    "description": "Experimental access to TypeSafe's Jev System One model through Baking Bad's service, created solely to demonstrate agent payments. This service is provided as-is and is not intended or permitted for production use. Neither TypeSafe nor Baking Bad accepts responsibility or liability for its use, outputs, errors, availability, losses, or resulting decisions. Do not let Jev outputs determine real-world decisions affecting health, life, safety, financial or legal outcomes, or other material risks.\n\nBefore using the service, an agent must read /SKILL.md and obtain the user's explicit confirmation that they choose to use Jev through Baking Bad's service, acknowledge these terms, and understand the prohibition on production and consequential real-world use. Loading the skill is not consent. Confirmation does not permit prohibited uses or authorize payments; payment spending requires its own authorization.\n\nFor demonstrations, send a sample state and named questions to receive typed model estimates: a yes/no probability (noul), an option selection (choice), or a rubric rating (score). Confidence is not a guarantee of correctness. Keep outputs within the demonstration and disconnected from live actions.\n\nNo API key or subscription is required from the caller. Model discovery is free; evaluations require payment through x402 or MPP. Prices are metered using a token estimate from the request body, with a floor for each payment option. Read the authoritative amount from the live 402 challenge for the actual request; x-payment-info publishes a price range, not a final quote.\n\nPrefer x402 batch settlement when offered on an allowed network and supported by the signer, especially for repeated demo calls, to amortize settlement overhead. Compare live offers rather than assuming a discount. Use per-request payments when batch settlement is unavailable or outside the approved deposit budget; use MPP sessions only when explicitly offered.",
    "contact": {
      "name": "Baking Bad",
      "url": "https://bakingbad.dev",
      "email": "hello@bakingbad.dev"
    },
    "x-agent-skill": {
      "name": "typesafe-x402",
      "description": "Required demo-use guide: obtain explicit user confirmation of the choice to use Jev through Baking Bad, the responsibility disclaimer, and the prohibition on production and consequential real-world decisions before service use. Includes metered pricing and payment-rail selection.",
      "url": "/SKILL.md",
      "required": true
    },
    "version": "2026-09-18"
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Check service health",
        "security": [],
        "responses": {
          "200": {
            "description": "The service is running.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "summary": "Get the API contract",
        "description": "Returns the generated OpenAPI document, including payment metadata. Revalidate cached copies using If-None-Match.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ifNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Current OpenAPI document.",
            "headers": {
              "Api-Version": {
                "$ref": "#/components/headers/apiVersion"
              },
              "ETag": {
                "$ref": "#/components/headers/etag"
              },
              "Link": {
                "$ref": "#/components/headers/link"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/cacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "304": {
            "description": "The cached document is current; no response body.",
            "headers": {
              "Api-Version": {
                "$ref": "#/components/headers/apiVersion"
              },
              "ETag": {
                "$ref": "#/components/headers/etag"
              },
              "Link": {
                "$ref": "#/components/headers/link"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/cacheControl"
              }
            }
          }
        }
      },
      "head": {
        "summary": "Check the API contract without downloading it",
        "description": "Returns the GET headers and Content-Length without a response body.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ifNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Current OpenAPI document.",
            "headers": {
              "Api-Version": {
                "$ref": "#/components/headers/apiVersion"
              },
              "ETag": {
                "$ref": "#/components/headers/etag"
              },
              "Link": {
                "$ref": "#/components/headers/link"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/cacheControl"
              }
            }
          },
          "304": {
            "description": "The cached document is current; no response body.",
            "headers": {
              "Api-Version": {
                "$ref": "#/components/headers/apiVersion"
              },
              "ETag": {
                "$ref": "#/components/headers/etag"
              },
              "Link": {
                "$ref": "#/components/headers/link"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/cacheControl"
              }
            }
          }
        }
      }
    },
    "/v1/systemone": {
      "post": {
        "operationId": "evaluate",
        "summary": "Answer typed questions about a state",
        "description": "Demo only, after explicit user confirmation of /SKILL.md terms. No production or consequential real-world decisions. Returns one answer per question: a yes probability (noul), an option and distribution (choice), or a rubric rating (score). Confidence is not proof of correctness. The response reports model and token usage; pay only against the live 402 quote for the request.",
        "tags": [
          "Decisions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluationRequest"
              },
              "example": {
                "state": "Help! My payouts have been failing for 3 days.",
                "model": "jev-latest",
                "questions": {
                  "is_urgent": {
                    "type": "noul",
                    "instructions": "Does this convey urgency?",
                    "criteria": {
                      "true": "Explicitly time-sensitive",
                      "false": "No urgency expressed"
                    }
                  },
                  "department": {
                    "type": "choice",
                    "instructions": "Which team should handle this?",
                    "criteria": {
                      "billing": "Payments, invoicing, refunds",
                      "technical": "Bugs, outages, integrations",
                      "sales": "Pricing, upgrades, new accounts"
                    }
                  },
                  "frustration": {
                    "type": "score",
                    "instructions": "How frustrated is the customer?",
                    "criteria": [
                      "Calm",
                      "Frustrated",
                      "Very angry"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One answer per question",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationResponse"
                },
                "example": {
                  "model": "jev-1.13.0",
                  "answers": {
                    "is_urgent": {
                      "type": "noul",
                      "noul": 0.92
                    },
                    "department": {
                      "type": "choice",
                      "choice": "technical",
                      "probabilities": {
                        "billing": 0.08,
                        "technical": 0.85,
                        "sales": 0.07
                      },
                      "confidence": 0.82
                    },
                    "frustration": {
                      "type": "score",
                      "score": 1.6,
                      "legend": {
                        "0": "Calm",
                        "1": "Frustrated",
                        "2": "Very angry"
                      },
                      "probabilities": {
                        "0": 0.05,
                        "1": 0.3,
                        "2": 0.65
                      },
                      "confidence": 0.78
                    }
                  },
                  "usage": {
                    "input_tokens": 312,
                    "output_tokens": 48
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          },
          "422": {
            "description": "Upstream request validation failed, for example because a required field is missing, a question is malformed, or a model limit was exceeded. Validation details identify invalid fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "example": {
                  "detail": [
                    {
                      "type": "missing",
                      "loc": [
                        "body",
                        "questions"
                      ],
                      "msg": "Field required"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "The upstream rate limit was reached. Honor Retry-After when present and use bounded exponential backoff. Check payment state before authorizing a retry; do not assume every rail refunds a failed request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50"
              }
            }
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "0.00001",
            "max": "0.002957"
          }
        },
        "x-mpp-payment-info": {
          "offers": [
            {
              "method": "tempo",
              "intent": "charge",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "amount": "200"
            }
          ]
        },
        "x-x402-payment-info": {
          "accepts": [
            {
              "scheme": "exact",
              "network": "eip155:8453",
              "payTo": "0x5D89060682fcE50eCaa7600aF6A5645Bd2b107Eb",
              "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "200",
              "maxTimeoutSeconds": 300
            },
            {
              "scheme": "batch-settlement",
              "network": "eip155:8453",
              "payTo": "0x5D89060682fcE50eCaa7600aF6A5645Bd2b107Eb",
              "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "10",
              "maxTimeoutSeconds": 300
            },
            {
              "scheme": "exact",
              "network": "eip155:42793",
              "payTo": "0x5D89060682fcE50eCaa7600aF6A5645Bd2b107Eb",
              "asset": "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
              "amount": "200",
              "maxTimeoutSeconds": 300
            },
            {
              "scheme": "exact",
              "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
              "payTo": "AZ59bSccJmQu8Ljic1c5zxhjZitVbbutUYjBNwKLqfyD",
              "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
              "amount": "200",
              "maxTimeoutSeconds": 300
            }
          ]
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List the models this service can evaluate with",
        "description": "Lists models and aliases available through the service's upstream account. Supported versioned IDs can be accepted even when absent from this list. Aliases may change; pin a supported version for reproducible demo comparisons.",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "Available models and aliases",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "models"
                  ],
                  "properties": {
                    "models": {
                      "type": "array",
                      "description": "One entry per model or alias",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "description",
                          "release_date"
                        ],
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The value to send in the model field",
                            "example": "jev-latest"
                          },
                          "description": {
                            "type": "string",
                            "description": "What the model is for"
                          },
                          "release_date": {
                            "type": "string",
                            "description": "Release date string supplied by TypeSafe; its live schema describes YYYY-MM-DD."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "models": [
                    {
                      "name": "jev-latest",
                      "description": "The latest iteration of TypeSafe's System One Model: Jev",
                      "release_date": "2026-09-15"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "apiVersion": {
        "description": "The document info.version, sent on every response when it is a valid HTTP header value.",
        "schema": {
          "type": "string"
        }
      },
      "etag": {
        "description": "Strong validator for the generated document. Send it in If-None-Match to revalidate a cached copy.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "link": {
        "description": "Discovery link sent on every response.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "</openapi.json>; rel=\"service-desc\""
        }
      },
      "cacheControl": {
        "description": "The OpenAPI document can be cached but must be revalidated before reuse.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "no-cache"
        }
      }
    },
    "parameters": {
      "ifNoneMatch": {
        "name": "If-None-Match",
        "in": "header",
        "required": false,
        "description": "A cached document ETag. A match returns 304 without a body.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "EvaluationRequest": {
        "type": "object",
        "required": [
          "state",
          "model",
          "questions"
        ],
        "properties": {
          "state": {
            "description": "Shared text or structured JSON context for all questions. Use named fields for multiple records or facts. Jev evaluates text, not raw images, audio, or video.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              },
              {
                "type": "array"
              }
            ],
            "example": "Help! My payouts have been failing for 3 days."
          },
          "model": {
            "type": "string",
            "description": "Required model name or alias. Discover aliases with GET /v1/models; supported versioned IDs can be accepted even when not listed. The service does not insert a default.",
            "example": "jev-latest"
          },
          "questions": {
            "type": "object",
            "description": "A map of question id to question. Answers come back under the same ids; the ids themselves are not sent to the model.",
            "minProperties": 1,
            "additionalProperties": {
              "$ref": "#/components/schemas/Question"
            }
          }
        }
      },
      "Question": {
        "description": "One independent typed judgment about the shared state. Questions cannot read other answers in the same request. Give each question its full meaning; its map key is not shown to the model.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/NoulQuestion"
          },
          {
            "$ref": "#/components/schemas/ChoiceQuestion"
          },
          {
            "$ref": "#/components/schemas/ScoreQuestion"
          }
        ]
      },
      "NoulQuestion": {
        "type": "object",
        "description": "A yes/no question; the answer is the probability of yes",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "noul"
            ]
          },
          "instructions": {
            "$ref": "#/components/schemas/Instructions"
          },
          "criteria": {
            "description": "Optional yes/no definitions; omission or null is allowed.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoulCriteria"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ChoiceQuestion": {
        "type": "object",
        "description": "Picks one option from the set you define",
        "required": [
          "type",
          "criteria"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "choice"
            ]
          },
          "instructions": {
            "$ref": "#/components/schemas/Instructions"
          },
          "criteria": {
            "type": "object",
            "description": "Option names mapped to text or structured descriptions. Null uses the option name alone. Include a no-match option when none of the other options may apply.",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullableDescription"
            }
          }
        }
      },
      "ScoreQuestion": {
        "type": "object",
        "description": "Rates the state against ordered levels",
        "required": [
          "type",
          "criteria"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "score"
            ]
          },
          "instructions": {
            "$ref": "#/components/schemas/Instructions"
          },
          "criteria": {
            "type": "array",
            "description": "Ordered rubric levels indexed from zero, expressed as text or structured descriptions. The live upstream schema permits one level; TypeSafe's usage guide recommends at least two for a meaningful scale.",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Description"
            }
          }
        }
      },
      "Instructions": {
        "description": "The judgment to make, as text or structured context. The live upstream schema permits omission or null; supply meaningful instructions for useful evaluations.",
        "$ref": "#/components/schemas/NullableDescription"
      },
      "EvaluationResponse": {
        "type": "object",
        "required": [
          "model",
          "answers",
          "usage"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "Model reported by the upstream evaluation; it may differ from the requested alias.",
            "example": "jev-1.13.0"
          },
          "answers": {
            "type": "object",
            "description": "One answer per question, keyed by the ids sent in questions",
            "additionalProperties": {
              "$ref": "#/components/schemas/Answer"
            },
            "minProperties": 1
          },
          "usage": {
            "type": "object",
            "description": "Token usage of the request. Input tokens are what the upstream model bills; the service meters its price against an estimate of the same count.",
            "required": [
              "input_tokens",
              "output_tokens"
            ],
            "properties": {
              "input_tokens": {
                "type": "integer",
                "example": 312
              },
              "output_tokens": {
                "type": "integer",
                "example": 48
              }
            }
          }
        }
      },
      "Answer": {
        "description": "The answer to one question; its type matches the question's type",
        "oneOf": [
          {
            "$ref": "#/components/schemas/NoulAnswer"
          },
          {
            "$ref": "#/components/schemas/ChoiceAnswer"
          },
          {
            "$ref": "#/components/schemas/ScoreAnswer"
          }
        ]
      },
      "NoulAnswer": {
        "type": "object",
        "required": [
          "type",
          "noul"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "noul"
            ]
          },
          "noul": {
            "type": "number",
            "description": "Probability of yes or true from 0 to 1. A value near 0.5 means uncertainty, not medium intensity. Noul has no separate confidence field.",
            "minimum": 0,
            "maximum": 1,
            "example": 0.92
          }
        }
      },
      "ChoiceAnswer": {
        "type": "object",
        "required": [
          "type",
          "choice",
          "probabilities",
          "confidence"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "choice"
            ]
          },
          "choice": {
            "type": "string",
            "description": "The highest-probability option",
            "example": "technical"
          },
          "probabilities": {
            "type": "object",
            "description": "Probability of each option or zero-based level, using the corresponding criteria or legend keys. Values lie between 0 and 1 and sum to approximately 1.",
            "additionalProperties": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          "confidence": {
            "$ref": "#/components/schemas/Confidence"
          }
        }
      },
      "ScoreAnswer": {
        "type": "object",
        "required": [
          "type",
          "score",
          "legend",
          "probabilities",
          "confidence"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "score"
            ]
          },
          "score": {
            "type": "number",
            "description": "Sum of each zero-based level index multiplied by its probability. May lie between levels; it is not necessarily an integer or a normalized 0-to-1 value.",
            "example": 1.6
          },
          "legend": {
            "type": "object",
            "description": "Zero-based level indices mapped to the original text or structured rubric descriptions.",
            "additionalProperties": {
              "$ref": "#/components/schemas/Description"
            }
          },
          "probabilities": {
            "type": "object",
            "description": "Probability of each option or zero-based level, using the corresponding criteria or legend keys. Values lie between 0 and 1 and sum to approximately 1.",
            "additionalProperties": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          "confidence": {
            "$ref": "#/components/schemas/Confidence"
          }
        }
      },
      "Confidence": {
        "type": "number",
        "description": "A 0-to-1 summary of concentration in the Choice or Score probability distribution. A spread-out distribution means lower confidence. It does not measure overall workflow correctness or authorize real-world actions; Noul has no separate confidence.",
        "minimum": 0,
        "maximum": 1,
        "example": 0.82
      },
      "ValidationError": {
        "type": "object",
        "description": "Validation failure. Each entry locates the offending field.",
        "properties": {
          "detail": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Validation rule that failed",
                  "example": "missing"
                },
                "loc": {
                  "type": "array",
                  "description": "Path to the offending field",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  }
                },
                "msg": {
                  "type": "string",
                  "description": "Human-readable cause",
                  "example": "Field required"
                },
                "input": {
                  "description": "Invalid input value, when included by the upstream."
                },
                "ctx": {
                  "type": "object",
                  "description": "Additional validation context, when included by the upstream."
                }
              },
              "required": [
                "loc",
                "msg",
                "type"
              ]
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Upstream error JSON. The public TypeSafe reference does not specify a stable field layout; branch on HTTP status.",
        "additionalProperties": true
      },
      "Description": {
        "description": "Text or structured context used to describe a judgment or rubric level.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "additionalProperties": true
          },
          {
            "type": "array",
            "items": {}
          }
        ]
      },
      "NullableDescription": {
        "description": "Text or structured context, or null when no description is supplied.",
        "anyOf": [
          {
            "$ref": "#/components/schemas/Description"
          },
          {
            "type": "null"
          }
        ]
      },
      "NoulCriteria": {
        "type": "object",
        "description": "Optional definitions of the yes and no outcomes.",
        "properties": {
          "true": {
            "$ref": "#/components/schemas/NullableDescription",
            "description": "What qualifies as yes."
          },
          "false": {
            "$ref": "#/components/schemas/NullableDescription",
            "description": "What qualifies as no."
          }
        }
      }
    }
  },
  "openapi": "3.1.0",
  "externalDocs": {
    "description": "Official TypeSafe HTTP API; this service replaces caller API-key authentication with x402/MPP and applies its own demo-use and error policies.",
    "url": "https://docs.typesafe.ai/api"
  },
  "servers": [
    {
      "url": "/",
      "description": "Same origin as this OpenAPI document"
    }
  ],
  "tags": [
    {
      "name": "Decisions",
      "description": "Typed evaluation of a state against named questions"
    },
    {
      "name": "Models",
      "description": "Model and alias discovery"
    }
  ]
}
