V2 Search
POST https://api.codefundi.app/v2/search
There is no separate /v2/research route. Research is this endpoint with chat: true.
| Mode | chat | Content-Type | History category |
|---|---|---|---|
| Search | false (default) | application/json | search |
| Research | true | application/x-ndjson | research |
Credits: 5 credits per search. Research adds model usage on top. See Credits and tiers.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
query | yes | string | Search text (2–1000 characters). |
scope | no | enum | all (default), repos, files, code, functions. |
scan_mode | no | enum | semantic (default), grep_docs, grep_code. |
repo_ids | no | uuid[] | Restrict to indexed repository IDs. |
repo_urls | no | string[] | Clone URLs; merged with repo_ids, max 25 combined. |
filters | no | object | file_types, file_paths, dependencies, function_names, has_functions, min_lines, max_lines, visibility. |
similarity_threshold | no | number | 0–1 optional floor for semantic matches. |
fields | no | enum | Documentation depth on hits: basic, summary, or full. |
chat | no | boolean | Default false. true enables NDJSON research. |
model | no | string | Model id when chat is true. |
Responses: 200; 400, 401, 402, 500.
Search example (chat: false)
cURL
search.sh
curl -sS -X POST "https://api.codefundi.app/v2/search" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d "{\"query\":\"authentication middleware\",\"scope\":\"all\",\"scan_mode\":\"semantic\",\"chat\":false,\"fields\":\"summary\"}"Research example (chat: true)
NDJSON lines: objects of type search (results, total, meta), then chunk (text), then done (model, context_files) or error (message).
research.sh
curl -sS -N -X POST "https://api.codefundi.app/v2/search" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/x-ndjson" \
-d "{\"query\":\"How is auth enforced?\",\"scope\":\"all\",\"scan_mode\":\"semantic\",\"chat\":true,\"model\":\"gpt-4o-mini\"}"For chat: true, send Accept: application/x-ndjson, read line-by-line, and parse each JSON object (type discriminates rows).
Last updated on