POST
/
query
Query indexed repositories and documentation
curl --request POST \
  --url https://apigcp.trynia.ai/v2/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
}'
{
  "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
array

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"}]
search_mode
enum<string>
default:unified

Search mode: 'unified' searches both repos and docs, 'repositories' searches only code, 'sources' searches only documentation

Available options:
unified,
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
array

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)