{"openapi":"3.1.0","info":{"title":"Mochi API","version":"2.0.0","description":"Sell tradable TF2 Mann Co. Supply Crate Keys for USDT on BEP20."},"servers":[{"url":"https://mochi.tf"}],"paths":{"/api/config/price":{"get":{"operationId":"getCurrentKeyPrices","summary":"Read current TF2 key buy and sell prices in USDT","description":"Public read-only endpoint. Fetch before quoting a price; do not use historical search snippets as live rates. Response uses Cache-Control: no-store. Settlement network is BEP20 (BNB Smart Chain).","responses":{"200":{"description":"Current rates, or null values if unavailable.","content":{"application/json":{"schema":{"type":"object","required":["price","sellPrice"],"properties":{"price":{"type":["number","null"],"description":"USDT paid to the user per TF2 key sold to Mochi. Null means unavailable, not zero."},"sellPrice":{"type":["number","null"],"description":"Starting USDT price per TF2 key for a purchase request from Mochi. Availability and final order require confirmation. Null means unavailable."}}}}}},"429":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/config/init":{"get":{"operationId":"getCurrentPublicMarketData","summary":"Read current prices and available key buying capacity","description":"Public read-only snapshot used by the website. Response uses Cache-Control: no-store; successful source reads are cached for two seconds. Inventory stock follows the server's scheduled refresh, so capacity is not a reservation. No credentials or trade link required.","responses":{"200":{"description":"Current public prices and buying capacity. Unavailable fields are null.","content":{"application/json":{"schema":{"type":"object","required":["price","sellPrice","stock"],"properties":{"price":{"type":["number","null"],"description":"USDT paid to the user per TF2 key sold to Mochi. Null means unavailable, not zero."},"sellPrice":{"type":["number","null"],"description":"Starting USDT price per TF2 key for a purchase request from Mochi. Availability and final order require confirmation. Null means unavailable."},"stock":{"type":["object","null"],"required":["count","maxCapacity","freeSpace"],"properties":{"count":{"type":"integer","minimum":0,"description":"Bot inventory key count from the latest server inventory refresh."},"maxCapacity":{"type":"integer","minimum":0,"description":"Configured inventory capacity."},"freeSpace":{"type":"integer","minimum":0,"description":"Additional keys we can currently buy, adjusted for in-flight trades and trading pauses. Not the quantity offered for sale."}},"description":"Null means capacity is unavailable. Final availability is checked when submitting a trade."}}}}}},"429":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/steam/stock":{"get":{"operationId":"getBotStock","summary":"Check bot capacity","responses":{"200":{"description":"Current bot stock and capacity.","content":{"application/json":{"schema":{"type":"object","required":["count","maxCapacity","freeSpace"],"properties":{"count":{"type":"integer"},"maxCapacity":{"type":"integer"},"freeSpace":{"type":"integer"}}}}}},"502":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/steam/inventory":{"get":{"operationId":"getUserInventory","summary":"Count tradable TF2 keys","parameters":[{"name":"tradeLink","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Number of tradable Mann Co. Supply Crate Keys.","content":{"application/json":{"schema":{"type":"object","required":["keyCount","imageUrl","cached"],"properties":{"keyCount":{"type":"integer","minimum":0},"imageUrl":{"type":["string","null"],"format":"uri"},"cached":{"type":"boolean"}}}}}},"400":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/offers/create":{"post":{"operationId":"createOffer","summary":"Create a sell offer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tradeLink","quantity","paymentAddress"],"properties":{"tradeLink":{"type":"string"},"quantity":{"type":"integer","minimum":1,"maximum":4000},"paymentAddress":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}}}}},"responses":{"200":{"description":"Steam offer created.","content":{"application/json":{"schema":{"type":"object","required":["offerId","offerUrl","status","expiresIn","verificationCode","botSteamId64"],"properties":{"offerId":{"type":"string"},"offerUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["sent"]},"expiresIn":{"type":"integer"},"verificationCode":{"type":"string","description":"Display-only code shown in the Steam offer so the customer can compare it with the site."},"botSteamId64":{"type":["string","null"],"description":"The Steam64 ID of the bot that sent the offer. When present, it can be linked to the bot's Steam profile."}}}}}},"400":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/offers/{offerId}/status":{"get":{"operationId":"getOfferStatus","summary":"Track offer and payout","parameters":[{"name":"offerId","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,19}$"}}],"responses":{"200":{"description":"Current offer status and payout amount.","content":{"application/json":{"schema":{"type":"object","required":["offerId","status","totalKeys","totalAmount"],"properties":{"offerId":{"type":"string"},"status":{"type":"string","enum":["sent","accepted","paid","failed","cancelled","declined","countered"]},"totalKeys":{"type":"integer"},"totalAmount":{"type":"string"}}}}}},"400":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}