Last Price · Schema

PricingContext

PricingSoftware-as-a-ServiceMarketplaceArtificial IntelligenceCompute

Properties

Name Type Description
product_id string Optional. An agent pricing a task it is about to run, or an API call it is about to make, has no product identifier.
product_type string Optional; defaults to `custom` for callers that are not pricing a catalog product.
current_price number The incumbent price. Optional, and accepted as zero by this schema, but a function that prices *relative* to an existing price needs a value above zero and answers 400 for zero or for an absent value,
currency string 3-character currency code (ISO 4217 expected; the API checks the length only).
customer_segment string Optional; omit rather than sending null (the handler rejects an explicit null). Must be non-identifying (a label such as `enterprise`, never an email, phone number or id); an identifying-looking value
geo string Optional; omit rather than sending null (the handler rejects an explicit null). Country or region at most (for example `FR` or `us-west`), never an address, coordinates or IP; an exact-looking value i
buyer_type stringnull Optional. Who the price is for, an AI agent or a person. Recorded on the logged quote; it does not change the price. Null or omitted means unspecified.
buyer_agent stringnull Optional. The buying agent, as a short non-identifying label (for example `chatgpt` or `agent.example.com`). Recorded on the logged quote as `buyer_agent` with source `declared`, lower-cased, only whi
buyer_ceiling numbernull Optional. The most the buyer says it will pay, in the request currency, as the buying agent declared it (its budget, spend limit or offer cap). Removed before the pricing function runs, so it never se
payer stringnull Optional, one of `agent_wallet`, `person_card`, `company_invoice`. Who pays, as distinct from who calls: the agent from its own wallet, a person's card, or a company billed later. Rolling out (release
timestamp string
metadata object Free-form inputs that pricing functions and routing policy rules read. `lastprice/cost-plus` reads the keys below. `lastprice/stopping-rule` reads `role` (seller or buyer), `history` (`[{round, offer}
channel string Optional. The sales channel the price is for, matched case-insensitively against the workspace's channel rates (`/api/channel-rates`). When a rate is saved for it and channel pricing is released for t
inference_payer string Optional. Who pays for model inference. `customer` means the end customer brings their own AI (for example by signing in with their own model subscription or key), so the vendor carries no inference c
inference_provider stringnull Optional. Inference provider identifier (for example `openai`, `anthropic`, `openrouter`, or `together-ai`) when routing or attributing customer-supplied inference.
min_price number Optional. Read as `constraints.min_price` when `constraints` sends none; `constraints` is the documented place and wins when both are sent.
max_price number Optional. Read as `constraints.max_price` when `constraints` sends none, so a ceiling sent here is held instead of ignored.
View JSON Schema on GitHub

JSON Schema

last-price-ai-pricing-context-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/last-price-ai/json-schema/last-price-ai-pricing-context-schema.json",
  "title": "PricingContext",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/last-price-ai-openapi.json#/components/schemas/PricingContext",
  "type": "object",
  "required": [
    "currency"
  ],
  "properties": {
    "product_id": {
      "type": "string",
      "minLength": 1,
      "description": "Optional. An agent pricing a task it is about to run, or an API call\nit is about to make, has no product identifier.\n"
    },
    "product_type": {
      "type": "string",
      "enum": [
        "saas",
        "ecommerce",
        "marketplace",
        "digital",
        "api",
        "custom"
      ],
      "default": "custom",
      "description": "Optional; defaults to `custom` for callers that are not pricing a\ncatalog product.\n"
    },
    "current_price": {
      "type": "number",
      "minimum": 0,
      "description": "The incumbent price. Optional, and accepted as zero by this\nschema, but a function that prices *relative* to an existing price\nneeds a value above zero and answers 400 for zero or for an absent\nvalue, naming `lastprice/cost-plus` as the alternative.\n\nA negative value is refused earlier and differently: this schema is\n`nonnegative`, so it fails request validation and returns the\ngeneric validation 400, which does not name `lastprice/cost-plus`.\nWorth stating because the two 400s carry different bodies and only\none of them tells a caller where to go next.\n\nZero is refused by those functions rather than accepted as \"a free\nitem\". These functions either scale the incumbent, where zero scales\nto zero whatever the reasoning said, or divide by it, where zero\ngives a non-finite result: `jale-optimizer` anchors its demand\nmodel on the incumbent, which has no demand slope at zero. A zero\nincumbent used to produce a\nconfident-looking price out of arithmetic that was never a\ncomparison.\n\nAutomatic routing applies the same rule, so a request carrying a\nzero incumbent together with `metadata.unit_cost` is routed to\n`lastprice/cost-plus` rather than refused. That function prices from\n`metadata.unit_cost` (with an optional `metadata.target_margin_pct`,\nmargin on price rather than markup on cost) or from a supplied\n`min_price`/`max_price` band, so a caller with no usable incumbent\nprice can still get one.\n"
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "3-character currency code (ISO 4217 expected; the API checks the length only)."
    },
    "customer_segment": {
      "type": "string",
      "description": "Optional; omit rather than sending null (the handler rejects an explicit null). Must be non-identifying (a label such as `enterprise`, never an email, phone number or id); an identifying-looking value is dropped from the logged quote."
    },
    "geo": {
      "type": "string",
      "description": "Optional; omit rather than sending null (the handler rejects an explicit null). Country or region at most (for example `FR` or `us-west`), never an address, coordinates or IP; an exact-looking value is dropped from the logged quote."
    },
    "buyer_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "agent",
        "person",
        null
      ],
      "description": "Optional. Who the price is for, an AI agent or a person. Recorded on the logged quote; it does not change the price. Null or omitted means unspecified."
    },
    "buyer_agent": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100,
      "description": "Optional. The buying agent, as a short non-identifying label (for example `chatgpt` or `agent.example.com`). Recorded on the logged quote as `buyer_agent` with source `declared`, lower-cased, only while the `buyer-agent-identity` release flag is on for the workspace (off by default). Never sent to the pricing function, so it does not change the price, the cache or the billed input units. Longer than 100 characters is a 400."
    },
    "buyer_ceiling": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "exclusiveMinimum": true,
      "x-lastprice-term": "lp:declared-ceiling",
      "description": "Optional. The most the buyer says it will pay, in the request currency, as the buying agent declared it (its budget, spend limit or offer cap). Removed before the pricing function runs, so it never sets a price, a cached answer or the billed input units. The model layer reads it as evidence about the buyer's ceiling at the trust that buyer kind's past declarations have earned, and checks it against what the buyer then does. Echoed in `price_object.evidence.declared_ceiling`."
    },
    "payer": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 40,
      "description": "Optional, one of `agent_wallet`, `person_card`, `company_invoice`. Who pays, as distinct from who calls: the agent from its own wallet, a person's card, or a company billed later. Rolling out (release flag `mpp-rail`, per workspace): while on it is kept on the quote as `metadata.payer`, so buyer-aware pricing reads it through the workspace's feature contract like any metadata field, and the answer echoes `payer`, and a value outside the list is a 400 `invalid_payer`. While off any value (up to 40 characters) is ignored."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "description": "Free-form inputs that pricing functions and routing policy rules read. `lastprice/cost-plus` reads the keys below. `lastprice/stopping-rule` reads `role` (seller or buyer), `history` (`[{round, offer}]`), `best_offer`, `reservation`, `round`, `horizon`, `counterparty_horizon`, `budget_remaining`, `opponent_patience` (0 to 1), `disclosure` (known, hidden or uncertain; default uncertain), `fairness_mode` (default false), `value_model` (`{type: linear, marginal_value_per_unit}`) and `next_round` (`{function_id, estimated_cost, estimated_improvement, input_units, output_units}`), and answers with `stopping` on the response.",
      "properties": {
        "unit_cost": {
          "type": "number",
          "minimum": 0,
          "description": "What the vendor spends per unit, excluding model inference."
        },
        "target_margin_pct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "exclusiveMaximum": true,
          "description": "Margin on price (not markup on cost). Defaults to 30."
        },
        "inference_cost": {
          "type": "number",
          "minimum": 0,
          "description": "Model inference spend per unit. Counted in the cost basis only when `inference_payer` is `vendor`."
        },
        "inference_payer": {
          "type": "string",
          "enum": [
            "vendor",
            "customer"
          ],
          "default": "vendor",
          "description": "Who pays for model inference. `customer` means the end customer brings their own AI (for example by signing in with their own model subscription), so the vendor carries no inference cost."
        }
      }
    },
    "channel": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
      "description": "Optional. The sales channel the price is for, matched case-insensitively against the workspace's channel rates (`/api/channel-rates`). When a rate is saved for it and channel pricing is released for the workspace, the function's price is raised so the seller keeps the same amount after the channel's cut, before `constraints` and the workspace's guardrails, which still hold the quoted price. The response then carries `channel`. Ignored otherwise."
    },
    "inference_payer": {
      "type": "string",
      "enum": [
        "vendor",
        "customer"
      ],
      "default": "vendor",
      "description": "Optional. Who pays for model inference. `customer` means the end customer brings their own AI (for example by signing in with their own model subscription or key), so the vendor carries no inference cost."
    },
    "inference_provider": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100,
      "description": "Optional. Inference provider identifier (for example `openai`, `anthropic`, `openrouter`, or `together-ai`) when routing or attributing customer-supplied inference."
    },
    "min_price": {
      "type": "number",
      "minimum": 0,
      "x-lastprice-term": "lp:band.bounds",
      "description": "Optional. Read as `constraints.min_price` when `constraints` sends none; `constraints` is the documented place and wins when both are sent."
    },
    "max_price": {
      "type": "number",
      "minimum": 0,
      "x-lastprice-term": "lp:band.bounds",
      "description": "Optional. Read as `constraints.max_price` when `constraints` sends none, so a ceiling sent here is held instead of ignored."
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • 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.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/last-price-ai-pricing-context"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API 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.