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

# Precheck Usage

> Pre-check if you can perform an operation before executing it.

**Required scope:** `read`

Operations:
- `api_call`: Standard API call (default)
- `proposal_create`: Creating a new proposal
- `ai_analysis`: AI-powered analysis

Use this in your n8n workflows to check limits before operations:

```
1. Call GET /usage/precheck?operation=proposal_create
2. If can_proceed=true, call POST /proposals
3. If can_proceed=false, handle the error or trigger upgrade flow
```

Returns:
- `can_proceed`: Whether the operation can be performed
- `reason`: If can_proceed=false, explains why
- `quota_remaining`: Remaining monthly quota (-1 = unlimited)
- `rate_remaining`: Remaining rate limit this minute
- `tier`: Current subscription tier
- `upgrade_url`: URL to upgrade if limits reached



## OpenAPI

````yaml /openapi/openapi-external.json get /usage/precheck
openapi: 3.1.0
info:
  title: Quikly.ai External API
  version: 1.0.0
  description: >-
    REST API for external integrations with Quikly.ai. Authenticate using an API
    key passed in the X-API-Key header. Use these endpoints from n8n, Zapier,
    custom scripts, or any HTTP client.
servers: []
security:
  - ApiKeyAuth: []
tags:
  - name: Proposals
    description: Create, read, update, and manage client proposals.
  - name: Profile
    description: Read and update the authenticated user's profile.
  - name: Templates
    description: Manage reusable proposal templates.
  - name: AI Services
    description: >-
      AI-powered analysis: rate recommendations, brief analysis,
      differentiators.
  - name: Public API
  - name: Usage
    description: Query API usage and quota information.
  - name: Webhooks
    description: Manage webhook subscriptions for real-time events.
  - name: Agent
    description: Interact with the AI agent for automated workflows.
  - name: Lead Sessions
    description: Track and manage lead capture sessions.
paths:
  /usage/precheck:
    get:
      tags:
        - Usage
      summary: Precheck Usage
      description: |-
        Pre-check if you can perform an operation before executing it.

        **Required scope:** `read`

        Operations:
        - `api_call`: Standard API call (default)
        - `proposal_create`: Creating a new proposal
        - `ai_analysis`: AI-powered analysis

        Use this in your n8n workflows to check limits before operations:

        ```
        1. Call GET /usage/precheck?operation=proposal_create
        2. If can_proceed=true, call POST /proposals
        3. If can_proceed=false, handle the error or trigger upgrade flow
        ```

        Returns:
        - `can_proceed`: Whether the operation can be performed
        - `reason`: If can_proceed=false, explains why
        - `quota_remaining`: Remaining monthly quota (-1 = unlimited)
        - `rate_remaining`: Remaining rate limit this minute
        - `tier`: Current subscription tier
        - `upgrade_url`: URL to upgrade if limits reached
      operationId: precheck_usage_api_external_v1_usage_precheck_get
      parameters:
        - name: operation
          in: query
          required: false
          schema:
            type: string
            description: Operation to check
            enum:
              - api_call
              - proposal_create
              - ai_analysis
            default: api_call
            title: Operation
          description: Operation to check
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsagePrecheckResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UsagePrecheckResponse:
      properties:
        can_proceed:
          type: boolean
          title: Can Proceed
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        quota_remaining:
          type: integer
          title: Quota Remaining
        rate_remaining:
          type: integer
          title: Rate Remaining
        tier:
          type: string
          title: Tier
        upgrade_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Upgrade Url
      type: object
      required:
        - can_proceed
        - quota_remaining
        - rate_remaining
        - tier
      title: UsagePrecheckResponse
      description: Response for usage precheck endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from Quikly.ai Settings → API Keys.
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````