{"openapi":"3.1.0","info":{"title":"MinRate API","version":"1.0"},"servers":[{"url":"/"}],"paths":{"/api/config":{"get":{"operationId":"getMarketConfiguration","summary":"Read the payment mode and exchange fee. Prices are gross. The exchange deducts its fee from the seller's proceeds. 100 basis points equals 1%.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"demo":{"type":"boolean"},"payment_mode":{"type":"string","minLength":1,"maxLength":256},"platform_fee_bps":{"type":"integer","minimum":0,"maximum":10000}}}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[]}},"/api/market":{"get":{"operationId":"getMarket","summary":"Read model listings and anonymous bid/ask depth.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"kind":{"type":"string","enum":["trusted","community"]},"unit":{"type":"string","enum":["request","1k_tokens"]}}}},"books":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"bids":{"type":"array","items":{"type":"object","properties":{"price_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"count":{"type":"integer"}}}},"asks":{"type":"array","items":{"type":"object","properties":{"price_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"count":{"type":"integer"}}}}}}}}}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[]}},"/api/market/history":{"get":{"operationId":"getQuoteHistory","summary":"Read historical best bids, best asks and observed depth changes for one exact model. Prices use the model's listed quote unit.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"window":{"type":"string","enum":["15m","1h","24h","7d"]},"points":{"type":"array","items":{"type":"object","properties":{"at":{"type":"number","description":"Unix seconds in UTC."},"bid_cents":{"type":["number","null"]},"ask_cents":{"type":["number","null"]},"bid_count":{"type":"integer","minimum":0},"ask_count":{"type":"integer","minimum":0}},"required":["at","bid_cents","ask_cents","bid_count","ask_count"]}},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"number","description":"Unix seconds in UTC."},"side":{"type":"string","enum":["bid","ask"]},"price_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"previous_count":{"type":"integer","minimum":0},"count":{"type":"integer","minimum":0}},"required":["at","side","price_cents","previous_count","count"]}},"sampled_at":{"type":["number","null"],"description":"Latest observed UTC Unix timestamp, when available."}},"required":["model","window","points","events","sampled_at"]}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[],"parameters":[{"in":"query","name":"model","schema":{"type":"string","minLength":1,"maxLength":256},"required":true},{"in":"query","name":"window","schema":{"type":"string","enum":["15m","1h","24h","7d"],"default":"1h"},"required":false}]}},"/api/spot":{"get":{"operationId":"getSpot","summary":"Read token-weighted completed prices in a speed tier.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[],"parameters":[{"in":"query","name":"model","schema":{"type":"string","minLength":1,"maxLength":256},"required":true},{"in":"query","name":"hours","schema":{"type":"integer","minimum":1,"maximum":168},"required":false},{"in":"query","name":"min_output_tps","schema":{"type":"number","minimum":0},"required":false}]}},"/v1/models":{"get":{"operationId":"listModels","summary":"Discover model IDs for chat clients.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"models:read"}},"/v1/chat/completions":{"post":{"operationId":"createChatCompletion","summary":"Chat with text messages using an exact model, auto, or an ordered model list.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"text/event-stream":{"schema":{"type":"string"}}}},"408":{"description":"Request is still pending. Poll Location with the buyer key.","headers":{"Location":{"schema":{"type":"string"}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"chat:write","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"required":false},{"in":"header","name":"X-Max-Price-Cents","schema":{"type":"integer","minimum":1,"maximum":1000000},"required":false},{"in":"header","name":"X-Wait-Seconds","schema":{"type":"integer","minimum":0,"maximum":120},"required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"models":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"minItems":1,"maxItems":128},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":256},"max_price_cents":{"type":"integer","minimum":1,"maximum":1000000},"rate_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"max_tokens":{"type":"integer","minimum":1,"maximum":32768},"allow_seller_host":{"type":"boolean"},"min_output_tps":{"type":"number","minimum":0},"stream":{"type":"boolean"},"wait_seconds":{"type":"integer","minimum":0,"maximum":120}},"required":["messages"],"additionalProperties":false}}}}}},"/api/buyer/jobs":{"post":{"operationId":"createJob","summary":"Submit an asynchronous priced request.","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"model":{"type":"string","minLength":1,"maxLength":256},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":256},"status":{"type":"string","minLength":1,"maxLength":256},"result":{"type":["string","null"]},"price_cents":{"type":["number","null"]}}}},"required":["job"]}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"chat:write","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"models":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"minItems":1,"maxItems":128},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":256},"max_price_cents":{"type":"integer","minimum":1,"maximum":1000000},"rate_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"max_tokens":{"type":"integer","minimum":1,"maximum":32768},"allow_seller_host":{"type":"boolean"},"min_output_tps":{"type":"number","minimum":0},"amount_cents":{"type":"integer","minimum":1,"maximum":1000000},"auto_match":{"type":"boolean"}},"required":["messages"],"additionalProperties":false}}}}},"get":{"operationId":"listTrustedJobs","summary":"Get the buyer's trusted job history.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"model":{"type":"string","minLength":1,"maxLength":256},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":256},"status":{"type":"string","minLength":1,"maxLength":256},"result":{"type":["string","null"]},"price_cents":{"type":["number","null"]}}}}},"additionalProperties":false}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"jobs:read"}},"/api/buyer/jobs/{id}":{"get":{"operationId":"getJob","summary":"Read this buyer's request and result.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"model":{"type":"string","minLength":1,"maxLength":256},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":256},"status":{"type":"string","minLength":1,"maxLength":256},"result":{"type":["string","null"]},"price_cents":{"type":["number","null"]}}}},"required":["job"]}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}]}},"/api/buyer/jobs/{id}/cancel":{"post":{"operationId":"cancelJob","summary":"Cancel an unassigned request.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"chat:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/seller/accounts":{"get":{"operationId":"listSellerAccounts","summary":"List linked accounts and pricing.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:read"},"post":{"operationId":"linkSellerAccount","summary":"Redeem an issued connection code.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":256},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["code","label"],"additionalProperties":false}}}}}},"/api/seller/accounts/{id}/pricing":{"post":{"operationId":"priceSellerAccount","summary":"Price a linked account.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["fixed","market","paused"]},"amount_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001}},"required":["mode"],"additionalProperties":false}}}}}},"/api/seller/offers":{"get":{"operationId":"listOffers","summary":"List price-only offers for a linked account.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:read","parameters":[{"in":"header","name":"X-Seller-Account","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"required":false}]}},"/api/seller/bid":{"post":{"operationId":"bidOnOffer","summary":"Bid on an offer at or below its displayed price.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","parameters":[{"in":"header","name":"X-Seller-Account","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"amount_cents":{"type":"integer","minimum":1,"maximum":1000000}},"required":["offer_id","amount_cents"],"additionalProperties":false}}}}}},"/api/seller/accept":{"post":{"operationId":"acceptOffer","summary":"Accept the displayed price of an offer.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","parameters":[{"in":"header","name":"X-Seller-Account","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["offer_id"],"additionalProperties":false}}}}}},"/api/seller/nodes":{"get":{"operationId":"listWorkerNodes","summary":"List this seller's model workers.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:read"},"post":{"operationId":"registerWorker","summary":"Register an exact model and receive a worker key once. The seller manages the upstream credential on the worker and is responsible for rights to provide the service.","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"label":{"type":"string","minLength":1,"maxLength":80},"rate_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001},"provider":{"type":"string","enum":["ollama","openai-compatible","cached-qwen","openai","anthropic","gemini"]}},"required":["label","model","rate_cents"],"additionalProperties":false}}}}}},"/api/seller/nodes/{id}/pricing":{"post":{"operationId":"priceWorker","summary":"Price or pause a token worker.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["fixed","market","paused"]},"amount_cents":{"type":"number","minimum":0.0001,"maximum":1000000,"multipleOf":0.0001}},"required":["mode"],"additionalProperties":false}}}}}},"/api/seller/nodes/{id}/speed":{"post":{"operationId":"setWorkerSpeed","summary":"Opt this node into or out of measured-speed orders.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"AccountBearer":[]}],"x-required-scope":"supply:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}}}},"/api/nodes/claim":{"post":{"operationId":"claimWork","summary":"Heartbeat and claim one matching private request.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":["object","null"]}},"additionalProperties":false}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"WorkerBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":256},"provider":{"type":"string","enum":["ollama","openai-compatible","cached-qwen","openai","anthropic","gemini"]}},"required":["model"],"additionalProperties":false}}}}}},"/api/nodes/finish":{"post":{"operationId":"finishWork","summary":"Deliver a result and measured usage on its lease.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Request rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":true}}}}}}},"security":[{"WorkerBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"lease":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"content":{"type":"string"},"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"finish_reason":{"type":"string","enum":["stop","length"]},"error":{"type":"boolean"}},"required":["job_id","lease"],"additionalProperties":false}}}}}}},"components":{"securitySchemes":{"AccountBearer":{"type":"http","scheme":"bearer","description":"Buyer or seller key with the required scope."},"WorkerBearer":{"type":"http","scheme":"bearer","description":"Dedicated key issued for this node."}}}}