mtok.market Offers API
The Offers API from mtok.market — 2 operation(s) for offers.
The Offers API from mtok.market — 2 operation(s) for offers.
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/mtok-market:mtok-market-offers-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: mtok.market Offers API
version: 0.1.0
description: 'Spot market for AI inference tokens. Continuous double auction per model; input and output tokens are priced separately (USD per million tokens). NON-CUSTODIAL and SELLER-HOSTED: the platform never vaults a key, never proxies inference, and never holds money - it matches, verifies on-chain payments, prices, and tracks reputation. Delivery is always seller-hosted (tier:"direct"): the seller runs THEIR OWN relay pointed at an upstream they control, and buyers pay bounded draws in USDC on Base. Each draw goes through the MtokDripLedger contract (/config.dripContractAddress) and the relay requires the DrawPaid event before upstream delivery; the canonical delivered tape is GET /chain/draws. Every live draw is paid in USDC; every participant needs a funded EVM wallet on Base with USDC plus gas (there is no no-wallet path). Buying: register (with a pubkey for signed orders), fund a wallet, bid a block and read routes[] (the crossing seller-hosted offers) - or read /book for a tier:direct offer - GET /config, then pay each draw through MtokDripLedger and draw from the seller relayEndpoint (POST /chunk; the relay verifies DrawPaid and serves report-free), then affirmDraw/disputeDraw on-chain. The SDK''s drawFromSeller runs the loop; ensureFundedFor surfaces the human fund-relay when short. Selling: set up an inference upstream, run mtok-relay pointed at it over public HTTPS, and post a tier:direct offer at a positive price; your relay serves report-free (the platform indexes every draw from MtokDripLedger events). The platform does not gate paid offers by model license in the current launch config; sellers are responsible for the right to sell what they list, and /api/models/licenses is best-effort guidance only. Production uses Durable Object state; on-chain payment verification is wired for the direct-tier flow. Buyers can import the viem-bundled client at https://mtok.market/sdk.mjs (zero install) and call buy({model,budget,prompt}); the zero-dependency https://mtok.market/client.mjs covers discovery + signed orders without on-chain. Sanctions screening: requests from configured blocked countries are rejected at the request edge (403 geo_blocked), and settlement/payer wallets are screened against the configured sanctions address list at order time and payment time (403 sanctioned_address); both are terminal - do NOT retry.'
servers:
- url: /api
- url: https://mtok.market/api
tags:
- name: Offers
paths:
/offers:
get:
summary: All open offers
responses:
'200':
description: Offers
tags:
- Offers
operationId: getOffers
x-operation-id-source: derived
post:
summary: Sell token capacity as a capped, dual-priced block.
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- model
- inputTokens
- outputTokens
- inputPricePerMTok
- outputPricePerMTok
- relayEndpoint
- settlementPubkey
- payoutAddress
- usableForSeconds
properties:
model:
type: string
inputTokens:
type: integer
minimum: 1
outputTokens:
type: integer
minimum: 1
inputPricePerMTok:
type: number
exclusiveMinimum: 0
description: 'USD/MTok, must be > 0 (price-0 is banned). Seller-hosted (tier:direct): buyers pay bounded USDC drips on Base, seller amount lands at settlementPubkey before delivery, and the configured platform fee goes to feeAddress. You are responsible for the right to sell what you list; GET /api/models/licenses is best-effort guidance, not a gate.'
outputPricePerMTok:
type: number
exclusiveMinimum: 0
description: USD/MTok, must be > 0 (price-0 is banned). must be positive (see inputPricePerMTok).
usableForSeconds:
type: number
minimum: 300
maximum: 604800
description: REQUIRED. Window (seconds, 300..604800) buyers can draw the block's chunks in. e.g. 86400 = 24h. The quantity drains as chunks are drawn and the offer closes at 0.
startsInSeconds:
type: number
minimum: 0
maximum: 604800
default: 0
recurring:
type: boolean
default: false
expiresInSeconds:
type: number
maximum: 86400
description: Optional listing expiry; defaults to the window end (usableUntil), never exceeds it
tier:
type: string
enum:
- direct
default: direct
description: 'Optional and always coerced to "direct" by the server: every offer is SELLER-HOSTED - the seller runs their own relay; buyers pay bounded chunks on-chain via drawFromSeller and draw inference chunk-by-chunk. Requires relayEndpoint and settlementPubkey.'
relayEndpoint:
type: string
description: REQUIRED for tier:direct. The public HTTPS URL of the seller's mtok-relay instance (e.g. https://<relay>.trycloudflare.com). Buyers' SDK calls this endpoint directly for each paid chunk.
settlementPubkey:
type: string
description: REQUIRED for tier:direct. The seller's EVM wallet (0x...) where seller USDC lands before delivery. If you sign the order yourself, it must be inside the signed intent params (the router rebuilds the order from intent.params).
requestHashScheme:
type: string
enum:
- nonce-v1
description: Optional signed rollout marker. Set nonce-v1 only after every relay instance behind relayEndpoint accepts both nonce-v1 and legacy request hashes. Missing keeps old SDK/relay pairs on the legacy request-only hash during a rolling deploy.
payoutAddress:
type: string
description: 'REQUIRED in non-custodial mode: the seller''s EVM wallet (0x...) where seller USDC lands. For a tier:direct offer it is the SAME wallet as settlementPubkey. If you sign the order yourself, it must be inside the signed intent params (the router rebuilds the order from intent.params).'
responses:
'201':
description: '{order, tradeIds}'
'400':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing/invalid x-api-key
tags:
- Offers
operationId: postOffers
x-operation-id-source: derived
/offers/{id}:
delete:
summary: Cancel an open offer (owner only)
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Cancelled
'403':
description: Not owner
'404':
description: Not found
'409':
description: Not open
tags:
- Offers
operationId: deleteOffersById
x-operation-id-source: derived
components:
schemas:
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
message:
type: string
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key