Skip to main content
POST
/
search
/
query
Query indexed sources
curl --request POST \
  --url https://apigcp.trynia.ai/v2/search/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "role": "user",
      "content": "How does the error handling work in this codebase?"
    }
  ],
  "repositories": [
    {
      "repository": "<string>"
    }
  ],
  "data_sources": [
    "<string>"
  ],
  "search_mode": "unified",
  "stream": false,
  "include_sources": true,
  "local_folders": [
    "<string>"
  ],
  "category": "<string>"
}
'
{
  "content": "<string>",
  "sources": [
    "<string>"
  ],
  "source_paths": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
messages
object[]
required

Chat messages for context and query

Example:
[
{
"role": "user",
"content": "How does the error handling work in this codebase?"
}
]
repositories
object[]

List of repositories to query

data_sources
string · object · object[]

List of data sources to query. Supports all source types:

  • Documentation/websites
  • Research papers (arXiv)
  • HuggingFace datasets

Flexible identifier formats:

  • String (recommended): ["Vercel AI SDK - Core", "openai/gsm8k", "https://arxiv.org/abs/2312.00752"]
  • Legacy object: [{"source_id": "uuid"}]
  • New object: [{"identifier": "display-name-or-url"}]

Flexible data source identifier (recommended). Can be:

search_mode
enum<string>
default:unified

Search mode:

  • 'unified': Smart routing based on provided sources (default)
  • 'repositories': Search GitHub repositories only
  • 'sources': Search data sources only (documentation, research papers, HuggingFace datasets, local folders)
Available options:
repositories,
sources,
unified
stream
boolean
default:false

Whether to stream the response

include_sources
boolean
default:true

Whether to include full source texts in the response (when false, only file paths are returned)

local_folders
string · object · object[]

List of local folders to query. Local folders are private and user-scoped.

Flexible identifier formats:

  • String (recommended): ["folder-uuid", "My Notes"]
  • Object: [{"local_folder_id": "uuid"}] or [{"identifier": "display-name"}]

Local folder identifier (UUID or display name)

category
string

Filter local folder results by classification category (e.g., "Work", "Personal")

Response

Query processed successfully

content
string
sources
(string | object)[]

Code snippets used to generate the response (included when include_sources=true)

source_paths
string[]

File paths of the code snippets (included when include_sources=false)