---
title: "Smart context loader"
method: POST
path: "/api/context/load"
tags: ["Context"]
---

# Smart context loader

`POST /api/context/load`

Automatically detects input type (URL, batch URLs, or search query) and
returns compressed high-quality cached content (HQCC). Checks global cache
first, fetches and compresses on miss.

## Request body

- ContextLoadRequest
  - `input` union, required — URL, URL array, or search query
    - string
    - string[]
  - `inputType` 'auto' | 'url' | 'urls' | 'query' — Force input type detection
  - `processUncached` boolean — Process uncached URLs in batch mode
  - `search` object
    - `topK` integer — Search results limit
  - `processing` object
    - `maxConcurrent` integer — Max parallel compressions
    - `strategy` 'auto' | 'fast' | 'quality'
  - `return` object
    - `topK` integer — Return results limit
    - `format` 'hqcc' | 'raw' | 'both' — Response format (both returns hqcc + raw)
  - `ranking` object
    - `preset` 'cache_first' | 'relevance_first' | 'balanced'

## Response `200`

Success

- ContextLoadResponse
  - `success` boolean
  - `requestId` string
  - `mode` 'single_url' | 'batch_urls' | 'query'
  - `result` ContextResult
    - `url` string
    - `title` string
    - `hqcc` string
    - `raw` string, nullable
    - `cached` boolean
    - `cachedAt` string, date-time
    - `processed` boolean
    - `found` boolean
    - `rank` integer
    - `ranking` object
      - `score` number
      - `factors` object
        - `cacheBoost` number
        - `relevance` number
        - `freshness` number
    - `meta` object
      - `strategy` string
      - `model` string
      - `source` string
      - `title` string
      - `wordCount` integer
      - `tokenCount` integer
  - `results` ContextResult[]
    - `url` string
    - `title` string
    - `hqcc` string
    - `raw` string, nullable
    - `cached` boolean
    - `cachedAt` string, date-time
    - `processed` boolean
    - `found` boolean
    - `rank` integer
    - `ranking` object
      - `score` number
      - `factors` object
        - `cacheBoost` number
        - `relevance` number
        - `freshness` number
    - `meta` object
      - `strategy` string
      - `model` string
      - `source` string
      - `title` string
      - `wordCount` integer
      - `tokenCount` integer
  - `summary` object
    - `totalResults` integer
    - `cachedResults` integer
    - `newResults` integer
    - `mode` string
  - `cost` object
    - `credits` number
    - `cached` boolean
    - `searchCredits` number
    - `compressionCredits` number
    - `totalCredits` number
    - `savedByCache` number
  - `processingTime` integer

## Other responses

- `400` — Invalid request parameters
- `401` — Missing or invalid authentication

---

[API](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api.md) · [All operations](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/prismer-ai/prismer-cloud-api/revisions/7fef0836d17f/schema)
