{"openapi":"3.0.3","info":{"title":"Chive","version":"1.0.0","description":"Ask and search a personal Chive library (saved social content). Auth: API key from usechive.com Settings → AI Connectors. In ChatGPT Actions choose API Key / Bearer and paste the ck_ key only. MCP tools for Claude/Cursor: search_chive, ask_chive, get_item. ask_library is a Pro feature and spends one credit. ChatGPT MCP connectors typically want OAuth; this spec is the Actions path that works today."},"servers":[{"url":"https://usechive.com"}],"security":[{"bearerAuth":[]}],"paths":{"/api/library-search":{"post":{"operationId":"search_library","summary":"Search the user Chive library","description":"Hybrid search over saved items. Always send compact true so ChatGPT gets MCP-shaped hits instead of raw metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["q","compact"],"properties":{"q":{"type":"string","description":"Search query"},"tag":{"type":"string","description":"Optional tag filter"},"compact":{"type":"boolean","enum":[true],"description":"Required true for ChatGPT. Omitting it returns fat in-app rows (metadata/frames). Railway MCP omits this and projects itself."}}},"example":{"q":"recipes","compact":true}}}},"responses":{"200":{"description":"Matching library items","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CompactItem"}}}}}}},"401":{"description":"Missing or invalid API key"}}}},"/api/items/{id}":{"get":{"operationId":"get_item","summary":"Get one saved item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Item UUID from search_library"},{"name":"compact","in":"query","required":true,"schema":{"type":"boolean","enum":[true]},"description":"Required true for ChatGPT. Returns the MCP-shaped item without raw metadata. Omit only for Railway MCP."}],"responses":{"200":{"description":"Item detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemDetail"}}}},"401":{"description":"Missing or invalid API key"},"404":{"description":"Not found"}}}},"/api/chat":{"post":{"operationId":"ask_library","summary":"Ask a question about the library","description":"Prose answer grounded in saved items. Pro only; one credit per question.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"The user question"},"threadId":{"type":"string","description":"Optional thread id to continue"},"contextType":{"type":"string","enum":["library","item"],"default":"library"},"contextItemId":{"type":"string","description":"When contextType is item"}}}}}},"responses":{"200":{"description":"Grounded answer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"401":{"description":"Missing or invalid API key"},"402":{"description":"Ask requires Pro or the account is out of credits"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Chive API key (ck_…). Paste the raw key in ChatGPT; it sends Authorization: Bearer ck_…"}},"schemas":{"CompactItem":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"fragment_type":{"type":"string"},"url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"summary":{"type":"string","nullable":true},"key_points":{"type":"array","items":{"type":"string"}},"saved_at":{"type":"string"}}},"ItemDetail":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"fragment_type":{"type":"string"},"url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"summary":{"type":"string","nullable":true},"key_points":{"type":"array","items":{"type":"string"}},"action_steps":{"type":"array","items":{"type":"string"}},"saved_at":{"type":"string"},"source_url":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true}}},"AskResponse":{"type":"object","properties":{"response":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"}}}},"retrievalPath":{"type":"string"},"intent":{"type":"string"},"matchCount":{"type":"integer"},"threadId":{"type":"string"},"creditsCharged":{"type":"integer"}}}}}}