## IP Detection

**post** `/generate/ip-detection`

Check prompts and/or existing assets against the team's enabled IP-detection filters, without generating anything. Advisory only: the call never blocks and nothing is stored. The payload is analyzed as ONE input set, so the answer is a single merged verdict — call the route once per item to know which item trips a filter. Videos are analyzed through their extracted frames; audio and 3d assets are returned in `skippedAssetIds` and are never checked. Available on the Enterprise plan only; a team with no enabled filter gets `evaluatedFilters: 0` and is charged nothing. Billed on the provider tokens the check sends — the prompt plus every analyzed image, once per enabled filter — with a 1 CU minimum, reported under `ipDetection.creativeUnitsCharged` and surfaced in `GET /v1/usages` as `ip-detection`.

### Query Parameters

- `dryRun: optional "true" or "api"`

  Estimate the operation instead of running it: the call returns a 269 response carrying the creative units cost. `api` estimates at the API tier.

  - `"true"`

  - `"api"`

- `projectId: optional string`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Body Parameters

- `assetIds: optional array of string`

  Asset ids to check. Videos are analyzed through their extracted first/last
  frames; audio and 3d assets are not analyzed and come back in
  `skippedAssetIds`.

- `prompts: optional array of string`

  Prompts to check, analyzed as one text of 250 000 characters in total at
  most — as much as the longest prompt any model accepts. At least one prompt
  or one analyzable asset id is required.

### Returns

- `ipDetection: object { action, analyzedImagesCount, creativeUnitsCharged, 4 more }`

  Merged verdict for the whole input set. `action` is always `allowed` or
  `flagged` — this route is advisory and blocks nothing — while
  `creativeUnitsCharged` and `analyzedImagesCount` report what was billed and
  what was actually analyzed.

  - `action: "allowed" or "blocked" or "flagged"`

    Whether and how detection affected the request.

    - `"allowed"`

    - `"blocked"`

    - `"flagged"`

  - `analyzedImagesCount: number`

    Number of images the detectors actually analyzed — a video counts as each
    of its extracted frames, and an image that could not be read is excluded
    (and not billed). Each of them is priced once per enabled filter.

  - `creativeUnitsCharged: number`

    IP-detection CU fee, separate from creativeUnitsCost: it follows the
    provider tokens the run sends — the prompt plus every analyzed image, once
    per enabled filter — with a 1 CU minimum per run.

  - `evaluatedFilters: number`

    Number of enabled filters evaluated for this request.

  - `findings: array of object { category, confidence, filterId, 4 more }`

    Per-filter verdicts gathered for this request.

    - `category: "artist-style" or "brand-trademark" or "celebrity-likeness" or 2 more`

      Category of the filter that produced this verdict.

      - `"artist-style"`

      - `"brand-trademark"`

      - `"celebrity-likeness"`

      - `"custom"`

      - `"fictional-character"`

    - `confidence: number`

      Confidence score from 0 (low) to 1 (high).

    - `filterId: string`

      Identifier of the filter that produced this verdict.

    - `filterName: string`

      Display name of the filter that produced this verdict.

    - `flagged: boolean`

      Whether this filter considered the request an IP risk.

    - `reason: string`

      Short, user-facing explanation of the verdict.

    - `entities: optional array of string`

      Named entities the filter recognized (e.g. characters, brands, people).

  - `flagged: boolean`

    Whether a filter considered the inputs an IP risk. Independent of `action`:
    a request blocked because a detector errored is `blocked` and NOT flagged.

  - `hasDetectorError: optional boolean`

    True if one or more detectors errored while evaluating this request.

- `skippedAssetIds: array of string`

  Input asset ids excluded from image analysis — audio and 3d assets, or a
  video with no extractable frame. Their content was NOT checked.

### Example

```http
curl https://api.cloud.scenario.com/v1/generate/ip-detection \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

```json
{
  "ipDetection": {
    "action": "allowed",
    "analyzedImagesCount": 0,
    "creativeUnitsCharged": 0,
    "evaluatedFilters": 0,
    "findings": [
      {
        "category": "artist-style",
        "confidence": 0,
        "filterId": "filterId",
        "filterName": "filterName",
        "flagged": true,
        "reason": "reason",
        "entities": [
          "string"
        ]
      }
    ],
    "flagged": true,
    "hasDetectorError": true
  },
  "skippedAssetIds": [
    "string"
  ]
}
```
