Skip to main content
POST
/
search
/
query
Query indexed repositories and documentation
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": "repositories",
  "stream": false,
  "include_sources": true
}
'
{
  "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 documentation/web sources to query. Supports flexible identifiers:

  • String format (recommended): ["Vercel AI SDK - Core", "https://docs.trynia.ai/"]
  • Legacy object format: [{"source_id": "uuid"}]
  • New object format: [{"identifier": "display-name-or-url"}]

Flexible data source identifier (recommended). Can be:

  • UUID (e.g., "550e8400-e29b-41d4-a716-446655440000")
  • Display name (e.g., "Vercel AI SDK - Core")
  • URL (e.g., "https://docs.trynia.ai/")
search_mode
enum<string>
default:repositories

Search mode: 'repositories' searches only code, 'sources' searches only documentation

Available options:
repositories,
sources
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)

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)