v5

latestOpenAPI 3.1.02026-08-025631,1012.8 MB
Public Retriever API

Execute Public Retriever

Execute a published retriever (public endpoint).

Authentication:

  • API key is OPTIONAL for public retrievers
  • Supports: no key, prk_ keys (deprecated), or ret_sk_ keys
  • If password-protected, requires X-Retriever-Password header

Rate Limiting:

  • Subject to per-retriever rate limits (per minute/hour/day)
  • May also have IP-based rate limits

Response:

  • Only returns fields specified in exposed_fields configuration
  • Internal metadata is stripped from results
  • Includes execution_id for interaction tracking
  • Presigned URLs returned by default (return_presigned_urls=true) for media rendering

Example (no API key - recommended for public access):

curl -X POST "https://api.mixpeek.com/v1/public/retrievers/video-search/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {"query": "red car"},
    "pagination": {"method": "offset", "page_number": 1, "page_size": 10}
  }'

Example with ret_sk_ key (for SDK/programmatic access):

curl -X POST "https://api.mixpeek.com/v1/public/retrievers/video-search/execute" \
  -H "X-Public-API-Key: ret_sk_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {"query": "red car"},
    "pagination": {"method": "offset", "page_number": 1, "page_size": 10}
  }'
post/v1/public/retrievers/{public_name}/execute

Path parameters

public_namestring required

Public name of the published retriever

Public name of the published retriever

Query parameters

return_presigned_urlsboolean

Generate fresh presigned download URLs for all blobs with S3 storage. Default: True for public retrievers to enable media rendering. Set to False if you only need metadata without URLs.

Generate fresh presigned download URLs for all blobs with S3 storage. Default: True for public retrievers to enable media rendering. Set to False if you only need metadata without URLs.

Headers

X-Public-API-Keystring nullable
X-Retriever-Passwordstring nullable

Request body

inputsobject

Runtime inputs for the retriever mapped to the input schema. Keys must match the retriever's input_schema field names. Values depend on field types (text, vector, filters, etc.). REQUIRED unless all retriever inputs have defaults.

Common input keys:

  • 'query': Text search query
  • 'embedding': Pre-computed vector for search
  • 'top_k': Number of results to return
  • 'min_score': Minimum relevance threshold
  • Any custom fields defined in input_schema

Template Syntax (Jinja2):

Namespaces (uppercase or lowercase):

  • INPUT / input: Query inputs (e.g., {{INPUT.query}})
  • DOC / doc: Document fields (e.g., {{DOC.payload.title}})
  • CONTEXT / context: Execution context
  • STAGE / stage: Stage configuration
  • SECRET / secret: Vault secrets (e.g., {{SECRET.api_key}})

Accessing Data:

  • Dot notation: {{DOC.payload.metadata.title}}
  • Bracket notation: {{DOC.payload['special-key']}}
  • Array index: {{DOC.items[0]}}, {{DOC.tags[2]}}
  • Array first/last: {{DOC.items | first}}, {{DOC.items | last}}

Array Operations:

  • Iterate: {% for item in DOC.tags %}{{item}}{% endfor %}
  • Extract key: {{DOC.items | map(attribute='name') | list}}
  • Join: {{DOC.tags | join(', ')}}
  • Length: {{DOC.items | length}}
  • Slice: {{DOC.items[:5]}}

Conditionals:

  • If: {% if DOC.status == 'active' %}...{% endif %}
  • If-else: {% if DOC.score > 0.8 %}high{% else %}low{% endif %}
  • Ternary: {{'yes' if DOC.enabled else 'no'}}

Built-in Functions: max, min, abs, round, ceil, floor Custom Filters: slugify (URL-safe), bool (truthy coercion), tojson (JSON encode)

S3 URLs: Internal S3 URLs (s3://bucket/key) are automatically presigned when accessed via DOC namespace.

filtersobject nullable

Optional ad-hoc filters applied at execution time. Merged (AND) with any filters already defined in the retriever's stages. Uses the standard LogicalOperator format: {"AND": [{"field": "brand", "operator": "eq", "value": "Acme"}]}. Supports operators: eq, ne, in, nin, gt, gte, lt, lte, contains, exists, is_null.

limitinteger nullable

DEPRECATED alias for the pagination page size — prefer 'pagination' (e.g. {"method": "cursor", "limit": 100}). Previously accepted-and-IGNORED: results silently capped at the default page size (10) regardless of the value, and out-of-range values didn't even 422 (FRUSTRATIONS 2026-07-23). Now: when 'pagination' is absent, 'limit' is honored as the default cursor pagination's page size; when both are provided and disagree, pagination wins and a top-level response warning names the conflict.

streamboolean

Enable streaming execution to receive real-time stage updates via Server-Sent Events (SSE). NOT REQUIRED - defaults to False for standard execution.

When stream=True:

  • Response uses text/event-stream content type
  • Each stage completion emits a StreamStageEvent
  • Events include: stage_start, stage_complete, stage_error, execution_complete
  • Clients receive intermediate results and statistics as stages execute
  • Useful for progress tracking, debugging, and partial result display

When stream=False (default):

  • Response returns after all stages complete
  • Returns a single RetrieverExecutionResponse with final results
  • Lower overhead for simple queries

Use streaming when:

  • You want to show real-time progress to users
  • You need to display intermediate results
  • Pipeline has many stages or long-running operations
  • Debugging or monitoring pipeline performance

Example streaming client (JavaScript):

const eventSource = new EventSource('/v1/retrievers/ret_123/execute?stream=true');
eventSource.onmessage = (event) => {
  const stageEvent = JSON.parse(event.data);
  if (stageEvent.event_type === 'stage_complete') {
    console.log(`Stage ${stageEvent.stage_name} completed`);
    console.log(`Documents: ${stageEvent.documents.length}`);
  }
};

Example streaming client (Python):

import requests
response = requests.post('/v1/retrievers/ret_123/execute',
                        json={'inputs': {...}, 'stream': True},
                        stream=True)
for line in response.iter_lines():
    if line.startswith(b'data: '):
        event = json.loads(line[6:])
        print(f"Stage {event['stage_name']}: {event['event_type']}")
expandstring[] nullable

OPTIONAL. List of fields containing document IDs to resolve inline. Referenced documents are fetched and attached under an '_expanded' key in each result document. Supports dot-notation for nested fields (e.g., 'items.product_id'). Max 50 unique references per request. Depth is limited to 1 (no recursive expansion).

skip_cacheboolean

OPTIONAL. Bypass stage result cache for this execution. When True, all stages execute fresh without cache lookup. Useful after corpus updates, retriever config changes, or engine deploys. Results are still written to cache for future requests.

return_presigned_urlsboolean

Generate presigned URLs for S3-backed blobs and url-shaped fields in result documents. Also accepted as a return_presigned_urls query parameter; if either source is true, presigning is enabled.

return_vectorsboolean

Include vector embeddings in result documents. Also accepted as a return_vectors query parameter; if either source is true, vectors are returned.

write_tokenstring nullable

OPTIONAL. Pass the write_token returned by a prior direct upsert (options.write_token=true) to get read-your-writes consistency: the read is routed to the primary shard, where your just-written document is immediately searchable, instead of an eventually-consistent replica that can lag several seconds behind. Omit for normal (eventual) reads.

Example request

{
  "description": "Simple query",
  "inputs": {
    "query": "artificial intelligence trends",
    "top_k": 25
  }
}

Response

Successful Response

{"stackTrail":"paths:/v1/public/retrievers/{public_name}/execute:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}