{ "openapi": "3.0.1", "info": { "title": "Antigenailabs.com API", "description": "Comprehensive API documentation for Antigenailabs.com endpoints, including image and text AI-generated content detection.", "license": { "name": "MIT" }, "version": "1.0.0" }, "servers": [ { "url": "https://api.antigenailabs.com" } ], "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "paths": { "/image": { "post": { "summary": "Analyze an image to determine if it is AI-generated.", "description": "Analyzes an image to determine the confidence that it is AI-generated. Provide either `image_url` or `media` (base64-encoded image), but not both.", "operationId": "analyzeImage", "tags": [ "Image Analysis" ], "x-codeSamples": [ { "lang": "cURL", "label": "cURL", "source": "curl -X POST \"https://api.antigenailabs.com/image\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-api-key: YOUR_API_KEY\" \\\n -d '{\"image_url\":\"https://example.com/image.jpg\"}'" }, { "lang": "Python", "label": "Python", "source": "import requests\n\nurl = \"https://api.antigenailabs.com/image\"\nheaders = {\"x-api-key\": \"YOUR_API_KEY\", \"Content-Type\": \"application/json\"}\nresponse = requests.post(url, json={\"image_url\": \"https://example.com/image.jpg\"}, headers=headers)\nprint(response.json())" } ], "requestBody": { "description": "Image to analyze. Provide either `image_url` or `media`.", "required": true, "content": { "application/json": { "schema": { "type": "object", "oneOf": [ { "required": [ "image_url" ], "properties": { "image_url": { "type": "string", "format": "uri", "description": "URL of the image to analyze." } } }, { "required": [ "media" ], "properties": { "media": { "type": "string", "description": "Base64-encoded image data." } } } ], "additionalProperties": false }, "examples": { "ImageURL": { "summary": "Provide image URL", "value": { "image_url": "https://example.com/image.jpg" } }, "Media": { "summary": "Provide base64-encoded image", "value": { "media": "iVBORw0KGgoAAAANSUhEUgAA..." } } } } } }, "responses": { "200": { "description": "AI-generated image analysis result.", "content": { "application/json": { "schema": { "type": "object", "properties": { "score": { "type": "number", "format": "float", "description": "Confidence score (0-1) that the image is AI-generated." }, "media_url": { "type": "string", "format": "uri", "description": "URL of the analyzed image." } }, "additionalProperties": false }, "examples": { "Success": { "summary": "Successful response", "value": { "score": 0.85, "media_url": "https://example.com/media/image.jpg" } } } } } }, "400": { "description": "Bad request due to invalid or missing parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "MissingParameter": { "summary": "Missing required parameter", "value": { "error": { "type": "MissingParameterError", "message": "Either image_url or media is required", "code": 3002 } } }, "InvalidParameter": { "summary": "Invalid parameter provided", "value": { "error": { "type": "InvalidParameterError", "message": "Provide either image_url or media, not both", "code": 3003 } } } } } } }, "401": { "description": "Unauthorized request due to invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "Unauthorized": { "summary": "Invalid API key", "value": { "error": { "type": "UnauthorizedError", "message": "Unauthorized: Invalid API key", "code": 2001 } } } } } } }, "500": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "InternalError": { "summary": "Internal server error", "value": { "error": { "type": "InternalError", "message": "An unexpected error occurred while processing your request.", "code": 9999 } } } } } } }, "504": { "description": "Gateway timeout.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "TimeoutError": { "summary": "Request timed out", "value": { "error": { "type": "TimeoutError", "message": "API request timed out", "code": 1005 } } } } } } } }, "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ] } }, "/text": { "post": { "summary": "Analyze text to determine if it is AI-generated.", "description": "Analyzes text to determine the confidence that it is AI-generated. Provide `text`, `file`, or `website` (priority: website > file > text).", "operationId": "analyzeText", "tags": [ "Text Analysis" ], "x-codeSamples": [ { "lang": "cURL", "label": "cURL", "source": "curl -X POST \"https://api.antigenailabs.com/text\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-api-key: YOUR_API_KEY\" \\\n -d '{\n \"text\": \"\",\n \"file\": \"\",\n \"website\": \"\",\n \"version\": \"\",\n \"sentences\": true,\n \"language\": \"\"\n}'" }, { "lang": "Python", "label": "Python", "source": "import requests\n\nurl = \"https://api.antigenailabs.com/text\"\nheaders = {\n \"x-api-key\": \"YOUR_API_KEY\",\n \"Content-Type\": \"application/json\"\n}\npayload = {\n \"text\": \"\",\n \"file\": \"\",\n \"website\": \"\",\n \"version\": \"latest\",\n \"sentences\": True,\n \"language\": \"en\"\n}\nresponse = requests.post(url, json=payload, headers=headers)\nprint(response.json())" } ], "requestBody": { "description": "Provide either `text`, `file`, or `website`. If multiple are provided, priority = website > file > text.", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string", "description": "Text content to analyze." }, "file": { "type": "string", "description": "URL to a .pdf, .doc, or .docx file." }, "website": { "type": "string", "format": "uri", "description": "Publicly accessible website URL." }, "version": { "type": "string", "description": "Model version (3.0, 2.0, latest).", "default": "2.0", "enum": [ "3.0", "2.0", "latest" ] }, "sentences": { "type": "boolean", "description": "Include sentence-level scores.", "default": true }, "language": { "type": "string", "description": "2-letter language code.", "default": "en", "enum": [ "en", "fr", "es", "pt", "nl", "de", "pl", "it", "zh" ] } }, "anyOf": [ { "required": [ "text" ] }, { "required": [ "file" ] }, { "required": [ "website" ] } ], "additionalProperties": false } } } }, "responses": { "200": { "description": "AI-generated text analysis result.", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "integer", "description": "HTTP status code (200)." }, "score": { "type": "number", "format": "float", "description": "Confidence (0-1) that the text is AI-generated." }, "attack_detected": { "type": "object", "description": "Flags for adversarial attacks.", "properties": { "zero_width_space": { "type": "boolean", "description": "True if zero-width spaces were detected." }, "homoglyph_attack": { "type": "boolean", "description": "True if homoglyph substitutions were detected." } }, "required": [ "zero_width_space", "homoglyph_attack" ], "additionalProperties": false }, "readability_score": { "type": "integer", "description": "Readability score (0-100). Higher = easier to read." }, "sentences": { "type": "array", "description": "Sentence-level AI confidence scores.", "items": { "type": "object", "properties": { "text": { "type": "string" }, "score": { "type": "number", "format": "float" } } } }, "input": { "type": "string", "description": "Source of input: `text`, `file`, or `website`." } }, "additionalProperties": false }, "examples": { "Success": { "summary": "Successful response", "value": { "status": 200, "score": 0.9, "attack_detected": { "zero_width_space": true, "homoglyph_attack": false }, "readability_score": 82, "sentences": [ { "text": "This is a sample sentence.", "score": 0.95 }, { "text": "Another example sentence.", "score": 0.85 } ], "input": "text" } } } } } }, "400": { "description": "Bad request due to invalid or missing parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "InvalidRequestFormat": { "summary": "Invalid request format", "value": { "error": { "type": "InvalidRequestFormat", "message": "Invalid request format", "code": 3001 } } }, "MissingParameter": { "summary": "Missing required parameter", "value": { "error": { "type": "MissingParameterError", "message": "Either text, file, or website is required.", "code": 3002 } } }, "InvalidParameter": { "summary": "Multiple parameters provided", "value": { "error": { "type": "InvalidParameterError", "message": "Provide either text, file, or website, not multiple.", "code": 3003 } } } } } } }, "401": { "description": "Unauthorized request due to invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "Unauthorized": { "summary": "Invalid API key", "value": { "error": { "type": "UnauthorizedError", "message": "Unauthorized: Invalid API key", "code": 2001 } } } } } } }, "500": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "InternalError": { "summary": "Internal server error", "value": { "error": { "type": "InternalError", "message": "An unexpected error occurred while processing your request.", "code": 9999 } } } } } } }, "504": { "description": "Gateway timeout.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "TimeoutError": { "summary": "Request timed out", "value": { "error": { "type": "TimeoutError", "message": "API request timed out", "code": 1005 } } } } } } } }, "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ] } } }, "components": { "schemas": { "Error": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "type", "message", "code" ], "properties": { "type": { "type": "string", "description": "Error type." }, "message": { "type": "string", "description": "Error message providing additional details." }, "code": { "type": "integer", "description": "Specific error code." } } } } } }, "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-api-key", "description": "A unique key used for authentication to access the API." }, "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "Standard Authorization header using the Bearer scheme." } } }, "tags": [ { "name": "Image Analysis", "description": "Endpoints related to image AI-generated content detection." }, { "name": "Text Analysis", "description": "Endpoints related to text AI-generated content detection." } ] }