{"openapi":"3.1.0","info":{"title":"WasItAI - API","description":"   \n# General info \n\nUse WasItAI API to find out whether content was created by human 👤 or an artificial (AI) intelligence 🤖.\n\n# Authentication\n\nAll API calls require **api-key** header. \n\nThe **api-key** is obtained from your subscription, so you must create a subscription first.\nContact WasItAI support team at support@wasitai.com or info@wasitai.com if you don't have one.\n\n","termsOfService":"https://wasitai.com/terms","contact":{"name":"WasItAI team","url":"https://wasitai.com/","email":"info@wasitai.com"},"version":"1.1.13","x-logo":{"url":"https://blog.wasitai.com/wp-content/uploads/2024/07/logo-copy.png"}},"servers":[{"url":"https://api.wasitai.com/live/","description":"Production environment"},{"url":"https://api.wasitai.com/sandbox/","description":"Sandbox environment"}],"paths":{"/api/accounts/v1/usage-info":{"get":{"tags":["accounts"],"summary":"Get Account Api Usage Info","description":"Get current API usage information for your `api-key` including subscription details.\n\nThis endpoint authenticates via API key (from headers) and reuses the logic\nfrom /api/v2/usage-info to provide consistent usage information.","operationId":"get_account_api_usage_info_api_accounts_v1_usage_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageInfoResponse"}}}},"404":{"description":"Not found"}}}},"/api/classifiers/v1/image/classify":{"post":{"tags":["classifiers"],"summary":"Classify Image","description":"This endpoint provides advanced AI-powered image origin classification, determining whether an image was generated by a human or an AI.\n\n`:deliveryMethod:` Image Submission Options\n- `url`: Provide a direct URL to the image\n- `base64encoded`: Submit a base64-encoded image representation\n\nImage Submission Requirements:\n- The `:imageToClassify:` object is required and must include a `data` property\n- Optional `metaData` property allows for custom metadata tracking (the same value provided will be returned in the response)\n\nDelivery Method Specifications:\n1. URL Delivery:\n   - `data` must contain a valid, fully-qualified image URL\n\n2. Base64 Encoded Delivery:\n   - `data` should contain only the base64 image data (after the comma)\n   - Example format: \"data:image/jpeg;base64,/9j/4AAQSkZJRgABA\"\n\nSuccessful Response Components:\n- `classifiedImage` object includes:\n  1. `classifyResult`: Detailed classification from our AI/ML model\n  2. `metaDataImageAnalysis`:\n     - `knownC2paClaimsFound`: Indicates C2PA metadata presence which is a proof that AI tool was used that leaves this \"watermark\"\n     - `knownExifClaimsFound`: Indicates recognized EXIF metadata which is a proof that AI tool was used that leaves this \"watermark\"\n  3. `finalVerdictWasItAI`: **Quick Answer** - Boolean flag combining all detection methods (metadata + classification).\n     - `true`: AI was detected through any method (metadata watermarks OR ML classification)\n     - `false`: No AI detected\n     - **Use this if you only need a simple yes/no answer about AI usage**\n\nOptional Advanced Features: Passthrough Headers\n- Prefix custom headers with `passthrough-`\n- Useful for image source authentication and custom routing\n- Example:\n  - Input header: `passthrough-example123: test`\n  - Injected header during image retrieval: `example123: test`\n\nThis is useful if you need to have headers/values injected into a call when we're trying to obtain an image (via URL delivery method). If images are hosted on your servers, you can distinguish between\nWasItAI call for obtaining an image, and some random call from bots that should be prevented/blocked.\nFor example, if you pass a header with key \"passthrough-example123\" and with header value \"test\", when we call URL of an image, we will add header with key \"example123\" and value \"test\".\nAll headers with `passthrough-` prefix will be processed this way.","operationId":"classify_image_api_classifiers_v1_image_classify_post","parameters":[{"name":"api-key","in":"header","required":true,"schema":{"type":"string","title":"Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyImageRequestSingle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyImagesSingleResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classifiers/v1/image/classify/upload-file":{"post":{"tags":["classifiers"],"summary":"Classify Image Upload","description":"This endpoint provides advanced AI-powered image origin classification,\ndetermining whether an image was generated by a human or an AI.\n\n## Image Submission Requirements:\n- The request must be a **multipart/form-data** upload.\n- The `file` field is **required** and must contain a valid image file.\n- Optional metadata can be included in the request headers. The header key should be metadata, and the value should contain the information you'd like returned in the response (helpful for correlation within internal systems).\n\n## Successful Response Components:\n- **`classifiedImage`** object includes:\n  1. **`classifyResult`**: Detailed classification from our AI/ML model.\n  2. **`metaDataImageAnalysis`**:\n     - **`knownC2paClaimsFound`**: Indicates C2PA metadata presence, proving that an AI tool left a digital \"watermark.\"\n     - **`knownExifClaimsFound`**: Indicates recognized EXIF metadata, which can be a sign of AI tool usage.\n  3. **`finalVerdictWasItAI`**: **Quick Answer** - Boolean flag combining all detection methods (metadata + classification).\n     - `true`: AI was detected through any method (metadata watermarks OR ML classification)\n     - `false`: No AI detected\n     - **Use this if you only need a simple yes/no answer about AI usage**\n\n## Optional Advanced Features: Passthrough Headers\n- Prefix custom headers with **`passthrough-`** for authentication or custom routing.\n- Example:\n  - Input header: `passthrough-example123: test`\n  - Injected header during image processing: `example123: test`\n- This is useful for distinguishing WasItAI requests from random bot traffic when processing images from private servers.","operationId":"classify_image_upload_api_classifiers_v1_image_classify_upload_file_post","parameters":[{"name":"api-key","in":"header","required":true,"schema":{"type":"string","title":"Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_classify_image_upload_api_classifiers_v1_image_classify_upload_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyImagesSingleResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_classify_image_upload_api_classifiers_v1_image_classify_upload_file_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_classify_image_upload_api_classifiers_v1_image_classify_upload_file_post"},"ClassifyImageRequestDeliveryMethodEnum":{"type":"string","enum":["url","base64encoded","file_upload"],"title":"ClassifyImageRequestDeliveryMethodEnum"},"ClassifyImageRequestItem":{"properties":{"data":{"type":"string","title":"Data"},"metaData":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["data"],"title":"ClassifyImageRequestItem"},"ClassifyImageRequestSingle":{"properties":{"delivery_method":{"enum":["url","base64encoded"]}},"type":"object","required":["deliveryMethod","imageToClassify"],"title":"ClassifyImageRequestSingle","examples":[{"deliveryMethod":"url","imageToClassify":{"data":"https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Tesla_circa_1890.jpeg/330px-Tesla_circa_1890.jpeg","metaData":"this string will be returned in the response (you can use it to correlate/match this image with your internal data)"}},{"deliveryMethod":"base64encoded","imageToClassify":{"data":"iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAADMElEQVR4nOzVwQnAIBQFQYXff81RUkQCOyDj1YOPnbXWPmeTRef+/3O/OyBjzh3CD95BfqICMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMK0CMO0TAAD//2Anhf4QtqobAAAAAElFTkSuQmCC","metaData":"this string will be returned in the response (you can use it to correlate/match this image with your internal data)"}}]},"ClassifyImageResponseItem":{"properties":{"requestItemId":{"type":"string","title":"Requestitemid"},"metaData":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata"},"imageInformation":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItemImageInformation"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItemStatusEnum"},{"type":"null"}]},"statusInfo":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItemStatusInfo"},{"type":"null"}]},"classifyResult":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItemClassifyResult"},{"type":"null"}]},"metaDataImageAnalysis":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItemMetaDataAnalysis"},{"type":"null"}]},"finalVerdictWasItAI":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Finalverdictwasitai"},"finalVerdictHumanFriendlyDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finalverdicthumanfriendlydescription"},"finalVerdictConfidenceScore":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalverdictconfidencescore"}},"type":"object","required":["requestItemId"],"title":"ClassifyImageResponseItem"},"ClassifyImageResponseItemClassifyResult":{"properties":{"result":{"$ref":"#/components/schemas/ClassifyImageResponseItemClassifyResultEnum"},"confidenceScore":{"type":"integer","title":"Confidencescore"},"classificationDurationInMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classificationdurationinms"},"humanFriendlyDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Humanfriendlydescription"},"classifierModelUsed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classifiermodelused"}},"type":"object","required":["result","confidenceScore"],"title":"ClassifyImageResponseItemClassifyResult"},"ClassifyImageResponseItemClassifyResultEnum":{"type":"string","enum":["human","ai"],"title":"ClassifyImageResponseItemClassifyResultEnum"},"ClassifyImageResponseItemImageInformation":{"properties":{"imageFetchingAndDecodingDurationInMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Imagefetchinganddecodingdurationinms"},"imageFormat":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageformat"},"imageWidthInPx":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Imagewidthinpx"},"imageHeightInPx":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Imageheightinpx"},"imageSizeInKB":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Imagesizeinkb"}},"type":"object","title":"ClassifyImageResponseItemImageInformation"},"ClassifyImageResponseItemMetaDataAnalysis":{"properties":{"knownC2paClaimsFound":{"type":"boolean","title":"Knownc2Paclaimsfound","default":false},"knownExifClaimsFound":{"type":"boolean","title":"Knownexifclaimsfound","default":false}},"type":"object","title":"ClassifyImageResponseItemMetaDataAnalysis"},"ClassifyImageResponseItemStatusEnum":{"type":"string","enum":["ok","error"],"title":"ClassifyImageResponseItemStatusEnum"},"ClassifyImageResponseItemStatusInfo":{"properties":{"key":{"$ref":"#/components/schemas/ClassifyImageResponseItemStatusInfoEnum"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["key"],"title":"ClassifyImageResponseItemStatusInfo"},"ClassifyImageResponseItemStatusInfoEnum":{"type":"string","enum":["classification-successful","unsupported-file-type","unsupported-image-dimensions","unsupported-image-size","unidentified-image-format","corrupted-or-incomplete-image","internal-error","internal-error-image-classification","bad-request","fetching-and-processing-error","fetching-and-processing-successful","unhandled-error"],"title":"ClassifyImageResponseItemStatusInfoEnum"},"ClassifyImagesSingleResponse":{"properties":{"requestId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requestid"},"totalFetchingAndPreprocessingTimeInMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Totalfetchingandpreprocessingtimeinms"},"totalClassificationTimeInMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Totalclassificationtimeinms"},"classifiedImage":{"anyOf":[{"$ref":"#/components/schemas/ClassifyImageResponseItem"},{"type":"null"}]}},"type":"object","title":"ClassifyImagesSingleResponse","examples":[{"classifiedImage":{"classifyResult":{"classificationDurationInMs":540,"confidenceScore":99,"humanFriendlyDescription":"We're quite confident that NO AI was used when producing this image.","result":"human"},"imageInformation":{"imageFetchingAndDecodingDurationInMs":244,"imageFormat":"jpeg","imageHeightInPx":442,"imageSizeInKB":36.14453125,"imageWidthInPx":330},"metaData":"this string will be returned in the response","metaDataImageAnalysis":{"knownC2paClaimsFound":"false","knownExifClaimsFound":"false"},"requestItemId":"01JPTTPJ541AS6R25VT16J6DZ9","status":"ok","statusInfo":{"description":"Image classified successfully","key":"classification-successful"}},"requestId":"38edb313-3c66-4fc6-b8bf-4ac64f317887","totalClassificationTimeInMs":540,"totalFetchingAndPreprocessingTimeInMs":244},{"classifiedImage":{"classifyResult":"null","imageInformation":"null","metaData":"testMetadata1","metaDataImageAnalysis":"null","requestItemId":"01JQSEHGME9J7AY13BR10FY51A","status":"error","statusInfo":{"description":"There was an error during the process of obtaining an image for classification.","key":"fetching-and-processing-error"}},"requestId":"0ef2154c-1d20-4d3f-8a20-f553a1f2fcdf","totalClassificationTimeInMs":0,"totalFetchingAndPreprocessingTimeInMs":130}]},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SubscriptionInfo":{"properties":{"subscription_name":{"type":"string","title":"Subscription Name"},"quantity":{"type":"integer","title":"Quantity"},"units_per_subscription":{"type":"integer","title":"Units Per Subscription"},"total_units":{"type":"integer","title":"Total Units"},"created_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Date"},"last_renewal_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Renewal Date"},"renewal_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Renewal Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"status":{"type":"string","title":"Status"},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancelled At"}},"type":"object","required":["subscription_name","quantity","units_per_subscription","total_units","status"],"title":"SubscriptionInfo"},"UsageInfoResponse":{"properties":{"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"user_fullname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Fullname"},"user_billing_subscription_management_portal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Billing Subscription Management Portal"},"numberOfTotalRequestsMade":{"type":"integer","title":"Numberoftotalrequestsmade"},"numberOfImagesProcessedSuccessfully":{"type":"integer","title":"Numberofimagesprocessedsuccessfully"},"totalUnitsAvailable":{"type":"integer","title":"Totalunitsavailable"},"totalUnitsUsed":{"type":"integer","title":"Totalunitsused"},"remainingUnits":{"type":"integer","title":"Remainingunits"},"activeSubscriptions":{"items":{"$ref":"#/components/schemas/SubscriptionInfo"},"type":"array","title":"Activesubscriptions"},"hasActiveSubscription":{"type":"boolean","title":"Hasactivesubscription"},"subscriptionStatus":{"type":"string","title":"Subscriptionstatus"}},"type":"object","required":["numberOfTotalRequestsMade","numberOfImagesProcessedSuccessfully","totalUnitsAvailable","totalUnitsUsed","remainingUnits","activeSubscriptions","hasActiveSubscription","subscriptionStatus"],"title":"UsageInfoResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}