{"openapi":"3.0.3","info":{"title":"AI Flashcard Generator REST API","version":"1.0.0","description":"Protected REST API for generating flashcards and managing checkout sessions."},"servers":[{"url":"http://ai-flashcard-gen-api.largent.org","description":"Current API server"}],"tags":[{"name":"System"},{"name":"Flashcards"},{"name":"Checkout"}],"paths":{"/":{"get":{"tags":["System"],"summary":"API welcome page","responses":{"200":{"description":"HTML welcome page"}}}},"/health":{"get":{"tags":["System"],"summary":"Health check","responses":{"200":{"description":"API is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}}}}}}}},"/api/generate":{"post":{"tags":["Flashcards"],"summary":"Generate flashcards","security":[{"clerkBearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","example":"Create flashcards about photosynthesis for a biology quiz."}}}}}},"responses":{"200":{"description":"Generated flashcards","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Flashcard"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/checkout-sessions":{"post":{"tags":["Checkout"],"summary":"Create a Stripe checkout session","security":[{"clerkBearerAuth":[]}],"responses":{"200":{"description":"Stripe checkout session","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}},"get":{"tags":["Checkout"],"summary":"Retrieve a Stripe checkout session","security":[{"clerkBearerAuth":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stripe checkout session","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"clerkBearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Clerk session token from the signed-in frontend user."}},"schemas":{"Flashcard":{"type":"object","required":["front","back"],"properties":{"front":{"type":"string","example":"What is photosynthesis?"},"back":{"type":"string","example":"The process plants use to convert light energy into chemical energy."}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}}}}}},"responses":{"BadRequest":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Missing or invalid Clerk bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}