{ "openapi": "3.0.0", "info": { "title": "Cognitia API", "version": "1.0.0", "description": "Fictional API for text analysis: sentiment, summarization, and bias detection." }, "servers": [ { "url": "https://api.cognitia.ai/v1" } ], "paths": { "/analyze-sentiment": { "post": { "summary": "Analyze Sentiment", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string" } }, "required": [ "text" ] } } } }, "responses": { "200": { "description": "Sentiment result", "content": { "application/json": { "schema": { "type": "object", "properties": { "sentiment": { "type": "string", "enum": [ "positive", "neutral", "negative" ] }, "confidence": { "type": "number" } } } } } }, "400": { "description": "Missing required field: text" }, "401": { "description": "Invalid or missing API token" }, "500": { "description": "Internal server error" } } } }, "/summarize": { "post": { "summary": "Summarize Text", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string", "maxLength": 2000 } }, "required": [ "text" ] } } } }, "responses": { "200": { "description": "Summary result", "content": { "application/json": { "schema": { "type": "object", "properties": { "summary": { "type": "string" } } } } } }, "400": { "description": "Missing required field: text" }, "401": { "description": "Invalid or missing API token" }, "413": { "description": "Payload too large" }, "500": { "description": "Internal server error" } } } }, "/detect-bias": { "post": { "summary": "Detect Bias", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string", "maxLength": 1500 } }, "required": [ "text" ] } } } }, "responses": { "200": { "description": "Bias detection result", "content": { "application/json": { "schema": { "type": "object", "properties": { "biased": { "type": "boolean" }, "categories": { "type": "array", "items": { "type": "string" } }, "explanation": { "type": "string" } } } } } }, "400": { "description": "Missing required field: text" }, "401": { "description": "Invalid or missing API token" }, "413": { "description": "Payload too large" }, "500": { "description": "Internal server error" } } } } } }