Last Price Experiments API

Price experiments, and the one way to run one on Last Price. An experiment has from two to ten arms, one of them named `control` (the baseline), each with its own price and an optional weight. Create it with `POST /api/tenants/{tenantId}/experiments`, get a user's stable arm and price from `GET /api/experiments/{experimentId}/pricing`, report a sale with `POST /api/experiments/{experimentId}/convert`, and compare the arms with `GET /api/experiments/{experimentId}/results` (views, conversions, revenue, conversion rate and revenue per user for each arm, plus a `comparison` of every arm against control with the bar adjusted for the number of arms). Each arm is tested against control for statistical significance (`comparison` on the results, and `POST /api/compute/significance` for any counts), and `POST /api/compute/allocation` turns the evidence so far into bandit weights for the next traffic. The built-in function `lastprice/elo-ab-test`, called through `POST /api/compute/price` with `context.metadata.experiment_id` and `user_id`, records into the same experiments: it assigns the user with the same stable hash, prices the call at the arm's price, records the view against the compute call (`GET /api/experiments/{experimentId}/calls` lists them) and answers `experiment` naming the arm, creating the experiment on its first call when there is none (control at the current price, experiment at the current price raised 10% with a charm ending). Where recording is not released for a workspace the built-in is a stateless two-arm split that records nothing. `POST /api/experiments/{experimentId}/promote` (same flag) ends an experiment and serves its winner to every user. In one sentence: Experiments take 2 to 10 arms, one of them control, assign each user a stable arm by hash, record each arm's views, conversions and revenue, and test every arm against control for statistical significance, with bandit allocation to split the next traffic; the Elo A/B test built-in function assigns arms by the same hash inside a compute call.

GitHub OpenAPI

Operations 23

POST /api/tenants/{tenantId}/experiments Create experiment for tenant #
GET /api/tenants/{tenantId}/experiments List tenant experiments #
GET /api/experiments List experiments #
GET /api/experiments/{experimentId} Get an experiment #
PATCH /api/experiments/{experimentId} Start, pause or complete an experiment #
DELETE /api/experiments/{experimentId} Delete an experiment #
DELETE /api/experiments/{experimentId}/conversions Void conversions #
GET /api/experiments/{experimentId}/pricing Get pricing with variant assignment #
GET /api/experiments/{experimentId}/calls The compute calls behind an experiment's recorded assignments #
POST /api/experiments/{experimentId}/convert Record conversion for experiment #
POST /api/experiments/{experimentId}/outcome Report a storefront outcome for learned pricing #
GET /api/pricing Get pricing with variant assignment #
POST /api/convert Track a conversion event #
GET /api/experiments/{experimentId}/definition Get experiment definition and variants #
POST /api/experiments/{experimentId}/promote Promote an experiment's winning arm #
GET /api/experiments/{experimentId}/results Get experiment results #
GET /api/experiments/{experimentId}/sequential Get the stopping verdict and weight history #
PUT /api/experiments/{experimentId}/sequential Switch bandit allocation on or off #
GET /api/public/demos List the hosted demo apps #
POST /api/public/demos/{slug}/assign Assign a hosted demo visitor to a pricing experiment arm #
POST /api/public/demos/{slug}/convert Record a hosted demo purchase #
GET /api/public/demos/{slug}/results Read a hosted demo's experiment results #
GET /api/public/demos/{slug}/health Check a hosted demo's health #

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/last-price-ai:last-price-ai-experiments-api"
All apis
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.

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.

OpenAPI Specification

last-price-ai-experiments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Last Price Ai Experiments API
  version: 1.0.0
  contact:
    name: API Support
    email: support@last-price.ai
  license:
    name: MIT
  x-guidance: 'Last Price computes prices for AI agents. To price one product, service, task or usage-based call, POST /api/compute/price with what is sold and its context (currency, current price or unit cost, product type, optional competitor offer); the answer is a price with its band, the reasons, a trace and a receipt.check_url. To check a price before you pay or quote it, POST /api/price-router/verify. Every operation that carries x-payment-info can be paid on its own with no account: send it with no credential, read the 402, pay, and resend. A workspace key (x-api-key) uses a prepaid balance instead. The MCP server at /api/mcp/rpc offers the same tools.'
  x-lastprice-any-of-scopes:
    description: On an operation, scopes of which a credential must hold at least one (recording an outcome after a single or a batch compute). Otherwise the same rules as `x-lastprice-scopes`; a refusal is 403 `insufficient_scope` listing every scope that would do.
  x-lastprice-any-scope:
    description: 'On an operation, `true` when any authenticated credential may call it, a key or token limited to specific scopes included: introspection (`GET /api/me`), usage, and operations that check scopes inside (an agent''s own notifications, settings and inbox). An operation with no `x-lastprice-scopes`, `x-lastprice-any-of-scopes`, `x-required-scopes` or this marker names no scope, so only a key with no scope limits or a dashboard session can call it. The usage operations refuse a credential holding only `workspace:claim`, `team:admin` or `launches:read`. `GET /api/openapi?view=scopes` lists every operation with what it needs.'
  x-lastprice-auth:
    description: 'How to read an operation that declares `security: []`. In OpenAPI an empty list only says no declared scheme applies; it does not mean the operation is open. Every such operation here carries an `x-lastprice-auth` marker saying which of two cases it is. The dashboard session cookie cannot be declared as a scheme, because it is the project-scoped, chunked `sb-<project-ref>-auth-token` and is browser only, so this marker is the machine-readable record of it. Operations with a declared scheme carry no marker.'
    values:
      public: Needs no credential. Some of these are rate limited per IP, and the demo operations answer from a pinned demo tenant.
      session-cookie: Needs a signed-in dashboard browser session. A JWT or an API key is not accepted and gets 401, so an agent or server-side integration cannot call these at all. Use `GET /api/me` to learn the tenant a credential resolves to instead of `GET /api/user/workspaces`.
  x-lastprice-scopes:
    description: 'The `AgentScope` values an operation requires, every one of them. A credential that lacks one gets 403 `insufficient_scope` naming the missing scopes in the shared `ErrorEnvelope` (see the `InsufficientScope` response). A credential with no recorded scopes (the dashboard session, or a key or token created without any) holds full access and passes, except an agent principal, which must hold the scopes by name or by a wildcard such as `commerce:*`. An operation without the marker names no scope a key can hold, so a scope-limited credential (a key or token with recorded scopes and no `*`, or any agent credential) gets 403 `insufficient_scope` there with no `required_scopes`, while an unscoped key, a person''s token and the dashboard session pass. The exceptions take any authenticated credential of the workspace and check what they need themselves: `GET /api/me`, the `/api/usage` reads, `POST /api/compute/price`, `POST /api/price-router`, `/api/agents/allowance`, `/api/billing/balance`, `POST /api/billing/topup`, `/api/agents/{id}/capabilities`, the `/api/api-keys` routes, the agent claim (`POST /api/agents/claim`, which needs `workspace:claim` by name) and the operations marked with `x-required-scopes`.'
  x-required-roles:
    description: On an operation, the workspace roles a person must hold to call it from a dashboard session, or with the person token `POST /api/auth/native-token` issues. Checked before the operation runs; any other role, or none, gets 403 `role_forbidden` with `allowed_roles` and the caller's `role`. API keys and other JWTs name no person and are governed by scopes instead. Credentials (API keys, agent keys, embed tokens) need owner, admin or member; integrations and the tenant record need owner or admin; money (balances, top-ups, refunds, credits, invoices, agent allowances) needs owner, admin or billing.
  x-required-scopes:
    description: 'On an operation, the scopes an API key must hold BY NAME for the operation to accept it. OpenAPI 3.0 cannot put scopes on an `apiKey` requirement, so this list records them. A wildcard (`*`, or a prefix such as `team:*`) and a key with no scopes recorded never satisfy it. Today only the team administration operations carry it, with `team:admin`. It is stricter than `x-lastprice-scopes`: no wildcard, no unscoped key and no legacy `read`, `write` or `admin` label passes it, so those operations are not marked with `x-lastprice-scopes`.'
  description: 'Operations tagged Experiments across 2 of this provider''s published API definitions: last-price-ai-openapi.json, openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.last-price.ai
  description: Production API, the canonical host and the default base URL for generated clients. The interactive docs at /api-docs rewrite this origin to their own, because most operations answer no cross-origin browser call at all. They send no CORS headers, and they refuse a request carrying an Origin that is not their own with a 403. The two embeddable operations are the exception and answer registered origins; see the EmbedToken security scheme. Server-side callers send no Origin and are unaffected.
tags:


# --- truncated at 32 KB (153 KB total) ---
# Full source: https://artifacts.apis.io/last-price-ai/openapi/last-price-ai-experiments-api-openapi.yml