{"openapi":"3.1.0","info":{"title":"Instaswap Assistant API","version":"1.0.0","description":"Public chat API of the Instaswap Assistant plus the MCP endpoint. Orders are created only by the human pressing Confirm; the confirm card carries the confirmationId.","contact":{"email":"support@instaswap.com","url":"https://instaswap.com"}},"servers":[{"url":"https://chat.instaswap.com"}],"paths":{"/chat/v1/availability":{"get":{"summary":"Whether the assistant is available (maintenance, credits, budget)","responses":{"200":{"description":"availability","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"type":"string"},"turnstileSiteKey":{"type":["string","null"]}}}}}}}}},"/chat/v1/sessions":{"post":{"summary":"Start a conversation","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string"},"turnstileToken":{"type":"string"}}}}}},"responses":{"200":{"description":"session","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"greeting":{"type":"string"},"chips":{"type":"array"}}}}}},"403":{"description":"human verification failed or missing"},"503":{"description":"unavailable"}}}},"/chat/v1/messages":{"post":{"summary":"Send a user message (SSE stream with Accept: text/event-stream, JSON otherwise)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","message"],"properties":{"sessionId":{"type":"string"},"message":{"type":"string","maxLength":600}}}}}},"responses":{"200":{"description":"reply text, cards (quote, assets, confirm, deposit, status, links...), chips and state"},"409":{"description":"previous message still processing"},"429":{"description":"rate limited"},"503":{"description":"unavailable"}}}},"/chat/v1/confirm":{"post":{"summary":"Create the order the human approved (the only creation path)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","confirmationId"],"properties":{"sessionId":{"type":"string"},"confirmationId":{"type":"string"}}}}}},"responses":{"200":{"description":"deposit or link card and the order"},"400":{"description":"confirmation expired or invalid"}}}},"/chat/v1/orders/{id}/status":{"get":{"summary":"Status of an order (any Instaswap order id)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"status card: state, label, steps, notice, support actions"},"404":{"description":"unknown order"}}}},"/chat/v1/feedback":{"post":{"summary":"Thumbs up or down on a reply","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","vote"],"properties":{"sessionId":{"type":"string"},"vote":{"type":"string","enum":["up","down"]},"turn":{"type":"integer"},"comment":{"type":"string"}}}}}},"responses":{"200":{"description":"ok"}}}},"/mcp":{"post":{"summary":"Model Context Protocol endpoint (Streamable HTTP, JSON-RPC 2.0): tools search_assets, get_quote, get_order_status, open_chat","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"JSON-RPC 2.0 request or batch"}}}},"responses":{"200":{"description":"JSON-RPC response"},"202":{"description":"notification accepted"}}}}},"externalDocs":{"description":"llms.txt","url":"https://chat.instaswap.com/llms.txt"}}