> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptguard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan Content

> Scan content for security threats without proxying to an LLM.

Uses the same policy engine, ML ensemble, and preset configuration
as the proxy pipeline. Each call is persisted to ``security_events``
so the dashboard, audit log, and billing usage all match what the
SDK / Playground actually sent.



## OpenAPI

````yaml /api-reference/openapi-developer.json post /api/v1/proxy/security/scan
openapi: 3.1.0
info:
  title: PromptGuard Developer API
  description: >-
    Public API for developers to integrate PromptGuard security into their
    applications
  version: 1.0.0
servers:
  - url: https://api.promptguard.dev
    description: Production API
  - url: https://staging-api.promptguard.dev
    description: Staging API
  - url: http://localhost:8080
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/proxy/security/scan:
    post:
      tags:
        - security
      summary: Scan Content
      description: |-
        Scan content for security threats without proxying to an LLM.

        Uses the same policy engine, ML ensemble, and preset configuration
        as the proxy pipeline. Each call is persisted to ``security_events``
        so the dashboard, audit log, and billing usage all match what the
        SDK / Playground actually sent.
      operationId: scan_content_api_v1_proxy_security_scan_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorEnvelope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Monthly quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuotaErrorEnvelope'
components:
  schemas:
    ScanRequest:
      properties:
        content:
          type: string
          maxLength: 100000
          title: Content
          description: Text to scan
        type:
          type: string
          pattern: ^(prompt|response)$
          title: Type
          description: 'Content type: ''prompt'' or ''response'''
          default: prompt
      type: object
      required:
        - content
      title: ScanRequest
    ScanResponse:
      properties:
        blocked:
          type: boolean
          title: Blocked
        decision:
          type: string
          title: Decision
        reason:
          type: string
          title: Reason
        threatType:
          anyOf:
            - type: string
            - type: 'null'
          title: Threattype
        confidence:
          type: number
          title: Confidence
        eventId:
          type: string
          title: Eventid
        processingTimeMs:
          type: number
          title: Processingtimems
      type: object
      required:
        - blocked
        - decision
        - reason
        - confidence
        - eventId
        - processingTimeMs
      title: ScanResponse
    AuthErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          examples:
            - code: missing_api_key
              message: >-
                PromptGuard API key required. Please provide via X-API-Key
                header.
              type: authentication_error
      type: object
      required:
        - error
      title: AuthErrorEnvelope
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QuotaErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/QuotaErrorDetail'
      type: object
      required:
        - error
      title: QuotaErrorEnvelope
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error description
        type:
          type: string
          title: Type
          description: Error category, e.g. 'authentication_error'
        code:
          type: string
          title: Code
          description: Machine-readable error code
      type: object
      required:
        - message
        - type
        - code
      title: ErrorDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    QuotaErrorDetail:
      properties:
        message:
          type: string
          title: Message
        type:
          type: string
          title: Type
          description: '''quota_exceeded'' or ''spending_limit_exceeded'''
        code:
          type: string
          title: Code
          description: '''monthly_quota_exceeded'' or ''spending_limit_exceeded'''
        current_plan:
          type: string
          title: Current Plan
        requests_used:
          type: integer
          title: Requests Used
        requests_limit:
          type: integer
          title: Requests Limit
        upgrade_url:
          type: string
          title: Upgrade Url
        retry_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry After
      type: object
      required:
        - message
        - type
        - code
        - current_plan
        - requests_used
        - requests_limit
        - upgrade_url
      title: QuotaErrorDetail
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        PromptGuard API key for developer endpoints. Keys start with pg_live_
        and are created in the dashboard.

````