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

# Search documentation

> Searches the orq.ai documentation index for the given query and returns the matching pages with content snippets and metadata.



## OpenAPI

````yaml post /v2/documentation/search
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://api.orq.ai
security:
  - ApiKey: []
tags:
  - description: List models available through the AI Router.
    name: Models
  - name: Guardrail Rules
  - name: Policies
  - name: Routing Rules
  - name: API keys
    description: >-
      API keys authenticate programmatic access to the workspace. The unified
      key model exposes opaque tokens, per-domain access grants, and budget /
      rate-limit constraints (see ADR 0001 and ADR 0002).
  - name: Budgets
    description: >-
      Budgets govern spend, token usage, and request rate across six scopes:
      workspace, project, identity, api-key, provider, and model. A budget is
      hierarchical and defense-in-depth — every applicable budget is a hard
      gate, and the most restrictive one wins per dimension (see ADR 0007).
  - name: Documentation
    description: >-
      Search the orq.ai documentation. Proxies the workspace's query to the
      hosted docs search index.
  - name: Files
    description: File upload and retrieval operations.
  - name: Identities
    description: >-
      Identities represent end users from your system for usage and engagement
      tracking.
  - name: Projects
    description: Projects organize resources within a workspace
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: Responses
  - description: >-
      Run agents on a cadence — cron, interval, or one-off. Minimum firing
      interval is 1 hour.
    name: Agent Schedules
  - name: Embeddings
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v2/documentation/search:
    post:
      tags:
        - Documentation
      summary: Search documentation
      description: >-
        Searches the orq.ai documentation index for the given query and returns
        the matching pages with content snippets and metadata.
      operationId: DocumentationSearch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchDocumentationRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchDocumentationResponse'
      x-code-samples:
        - lang: curl
          label: Core - Search documentation
          source: |
            curl --request POST \
              --url 'https://api.orq.ai/v2/documentation/search' \
              --header 'Authorization: Bearer $ORQ_API_KEY' \
              --header 'Content-Type: application/json' \
              --data '{
                "query": "How do I create an API key?",
                "limit": 5,
                "score_threshold": 0.65
              }'
        - lang: python
          label: Python - Search documentation
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.orq.ai/v2/documentation/search",
                headers={
                    "Authorization": f"Bearer {os.environ['ORQ_API_KEY']}",
                    "Content-Type": "application/json",
                },
                json={
                    "query": "How do I create an API key?",
                    "limit": 5,
                    "score_threshold": 0.65,
                },
                timeout=30,
            )
            response.raise_for_status()

            for result in response.json()["results"]:
                print(result["metadata"]["title"], result["metadata"]["href"])
        - lang: typescript
          label: Node.js - Search documentation
          source: >
            const response = await
            fetch('https://api.orq.ai/v2/documentation/search', {
              method: 'POST',
              headers: {
                Authorization: `Bearer ${process.env.ORQ_API_KEY}`,
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({
                query: 'How do I create an API key?',
                limit: 5,
                score_threshold: 0.65,
              }),
            });


            if (!response.ok) {
              throw new Error(`Request failed: ${response.status}`);
            }


            const { results } = await response.json();

            for (const result of results) {
              console.log(result.metadata.title, result.metadata.href);
            }
components:
  schemas:
    SearchDocumentationRequest:
      required:
        - query
      type: object
      properties:
        query:
          type: string
          description: Free-text query to search the documentation for.
        limit:
          type: integer
          description: Maximum number of results to return (1-50). Defaults to 10.
          format: int32
        score_threshold:
          type: number
          description: Minimum relevance score (0-1). Defaults to 0.6.
          format: double
    SearchDocumentationResponse:
      required:
        - results
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/DocumentationSearchResult'
          description: Documentation pages matching the query, ordered by relevance.
    DocumentationSearchResult:
      required:
        - content
        - path
        - metadata
      type: object
      properties:
        content:
          type: string
          description: Matching content snippet from the documentation page.
        path:
          type: string
          description: Path of the documentation page within the docs site.
        metadata:
          allOf:
            - $ref: '#/components/schemas/DocumentationSearchResultMetadata'
          description: Display metadata for rendering the result.
    DocumentationSearchResultMetadata:
      required:
        - title
        - description
        - href
      type: object
      properties:
        title:
          type: string
          description: Page title.
        description:
          type: string
          description: Short page description.
        href:
          type: string
          description: Absolute URL to the documentation page.
        icon:
          type: string
          description: Optional icon identifier for the page.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````