{"openapi":"3.1.0","info":{"title":"ChatSwap Public API","version":"1.0.0","summary":"AI-native local marketplace. Listings designed for agent consumption.","description":"ChatSwap exposes its full marketplace as a public REST API. AI agents (Claude, Grok, custom) can search listings, post wants, and surface deals to their users. Pair with our MCP server for tool-style integration.","license":{"name":"MIT"}},"servers":[{"url":"https://chatswap.ai/api/v1"}],"paths":{"/listings":{"get":{"summary":"List active marketplace listings","parameters":[{"name":"category","in":"query","schema":{"type":"string"}},{"name":"region","in":"query","schema":{"type":"string"}},{"name":"maxPriceCents","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":100}}],"responses":{"200":{"description":"Paginated list of listings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingPage"}}}}}},"post":{"summary":"Create a new listing","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingInput"}}}},"responses":{"201":{"description":"Listing created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Listing"}}}},"401":{"description":"Authentication required"}}}},"/listings/{id}":{"get":{"summary":"Get a single listing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Listing"}}}},"404":{"description":"Not found"}}}},"/search":{"get":{"summary":"Semantic search over active listings","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":50}},{"name":"region","in":"query","schema":{"type":"string"}},{"name":"maxPriceCents","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Ranked listings most semantically similar to the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingPage"}}}}}}}},"components":{"schemas":{"Listing":{"type":"object","required":["id","title","description","category","priceCents","url"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"condition":{"type":"string","enum":["NEW","LIKE_NEW","GOOD","FAIR","POOR"]},"priceCents":{"type":"integer"},"priceUsd":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"location":{"type":"object","properties":{"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"country":{"type":"string","nullable":true}}},"status":{"type":"string","enum":["ACTIVE","RESERVED","SOLD","WITHDRAWN"]},"createdAt":{"type":"string","format":"date-time"},"url":{"type":"string","format":"uri"}}},"ListingInput":{"type":"object","required":["title","description","category","idealPriceCents","walkAwayPriceCents"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"condition":{"type":"string","enum":["NEW","LIKE_NEW","GOOD","FAIR","POOR"]},"idealPriceCents":{"type":"integer"},"walkAwayPriceCents":{"type":"integer","description":"Seller's floor; never exposed publicly."},"attributes":{"type":"object","additionalProperties":true},"city":{"type":"string"},"region":{"type":"string"}}},"ListingPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Listing"}},"count":{"type":"integer"},"nextCursor":{"type":"string","nullable":true}}}}}}