# Image Filter API Complete API reference for the `content-filter-image-standard` image content detection model. ## Overview Content Filter Image checks one or more image URLs for supported content safety categories and returns a synchronous detection result. The current detection type is `nsfw`. ## Endpoint ```http POST /api/v1/content/filter ``` ## Authentication ```http Authorization: Bearer YOUR_API_KEY ``` ## Request Parameters ### Required | Parameter | Type | Description | | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------- | | `model_name` | string | Must be `"content-filter-image-standard"` | | `type` | string | Detection type. Currently only `"nsfw"` is supported. | | `images` | string[] | Image URLs to check. Supports single-image and multi-image detection. The API supports up to 20 images per request. | ### Not Supported | Parameter | Description | | --------- | ------------------------------------------------------ | | `text` | Use `content-filter-text-standard` for text detection. | ## Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/content/filter', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'content-filter-image-standard', type: 'nsfw', images: ['https://example.com/image-1.jpg', 'https://example.com/image-2.jpg'], }), }); const result = await response.json(); console.log(result.data); ``` ## Response Format ```json { "code": 0, "message": "success", "data": { "type": "nsfw", "flagged": true, "credits": 400, "detail": { "text": null, "images": [ { "url": "https://example.com/image-1.jpg", "checked": true, "flagged": true, "score": 96, "level": "high" }, { "url": "https://example.com/image-2.jpg", "checked": true, "flagged": false, "score": 0, "level": "none" } ] } } } ``` ## Response Data | Field | Type | Description | | -------------------- | ------- | ------------------------------------------------------------------------------------ | | `data.type` | string | Detection type used for the request. | | `data.flagged` | boolean | Whether any successfully checked image was flagged for the requested detection type. | | `data.credits` | number | Credits charged for the request. | | `data.detail.text` | null | Always `null` for image detection. | | `data.detail.images` | array | Detection results for each submitted image URL. | ## Detection Result Each item in `data.detail.images` uses this structure: | Field | Type | Description | | --------- | ------- | -------------------------------------------------------------- | | `url` | string | Checked image URL. | | `checked` | boolean | Whether the item was successfully checked. | | `flagged` | boolean | Whether the checked item matched the requested detection type. | | `level` | string | Risk level: `"none"`, `"low"`, `"medium"`, or `"high"`. | | `score` | number | Detection score. Use `level` for display. | ### Result Notes - If `checked` is `false`, the image was not successfully checked. In that case, `score` may be `0` and `level` may be `"none"`, but the image should be treated as a detection failure rather than a no-risk result. - `flagged` only describes the detection result after an image has been checked. - `data.flagged` is `true` when at least one successfully checked image is flagged. - `level` is the display-friendly risk level derived from the detection score. ## Error Handling If the request fails, the API returns a non-zero `code` or a non-2xx HTTP status. Check the `message` field for details.