POST
/
query
curl --request POST \
  --url https://api.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>"
    }
  ],
  "stream": false,
  "include_sources": true,
  "use_graph_rag": true,
  "graph_query_mode": "auto"
}'
{
  "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[]
required

List of repositories to query

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)

use_graph_rag
boolean

Whether to use GraphRAG for enhanced code structure understanding

graph_query_mode
enum<string>

GraphRAG query mode for code navigation

Available options:
auto,
global,
local,
drift

Response

200
application/json
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)