Use this file to discover all available pages before exploring further.
Nia provides official SDKs for Python and TypeScript with a high-level client that wraps the REST API into an ergonomic interface with built-in retries, streaming, and type safety.
from nia_py.sdk import NiaSDKsdk = NiaSDK(api_key="nia_your_api_key")# Semantic search across your indexed sourcesresults = sdk.search.universal(query="How does authentication work?")print(results)
import { NiaSDK } from "nia-ai-ts";const sdk = new NiaSDK({ apiKey: "nia_your_api_key" });// Semantic search across your indexed sourcesconst results = await sdk.search.universal({ query: "How does authentication work?" });console.log(results);
Get your API key at app.trynia.ai under Settings → API Keys. Never commit API keys to version control.
from nia_py.sdk import NiaSDKsdk = NiaSDK(api_key="nia_your_api_key")# Universal search across all indexed sourcesresults = sdk.search.universal(query="implement retry logic", top_k=10)# Query search with specific repos and conversation contextresults = sdk.search.query( messages=[{"role": "user", "content": "How does streaming work?"}], repositories=["vercel/ai"],)# Web searchresults = sdk.search.web(query="latest LLM developments")# Deep research (multi-step with citations)results = sdk.search.deep(query="Compare RSC vs traditional SSR")
import { NiaSDK } from "nia-ai-ts";const sdk = new NiaSDK({ apiKey: "nia_your_api_key" });// Universal search across all indexed sourcesconst results = await sdk.search.universal({ query: "implement retry logic", top_k: 10 });// Query search with specific repos and conversation contextconst queryResults = await sdk.search.query({ messages: [{ role: "user", content: "How does streaming work?" }], repositories: ["vercel/ai"],});// Web searchconst webResults = await sdk.search.web({ query: "latest LLM developments" });// Deep research (multi-step with citations)const deepResults = await sdk.search.deep({ query: "Compare RSC vs traditional SSR" });
# Create a source (auto-detects type from URL)sdk.sources.create({"url": "https://github.com/vercel/ai"})sdk.sources.create({"url": "https://docs.anthropic.com"})# List sources with filtersrepos = sdk.sources.list(type="repository", limit=20)# Resolve a source by namesource = sdk.sources.resolve(identifier="vercel/ai")# Delete a sourcesdk.sources.delete(source_id="source-uuid")
// Create a source (auto-detects type from URL)await sdk.sources.create({ url: "https://github.com/vercel/ai" });await sdk.sources.create({ url: "https://docs.anthropic.com" });// List sources with filtersconst repos = await sdk.sources.list({ type: "repository", limit: 20 });// Resolve a source by nameconst source = await sdk.sources.resolve({ identifier: "vercel/ai" });// Delete a sourceawait sdk.sources.delete({ sourceId: "source-uuid" });
Oracle is Nia’s autonomous research agent. It runs multi-step research jobs that can take minutes to complete.
Python
TypeScript
# Start a research jobjob = sdk.oracle.create_job( query="How does Next.js handle caching in the App Router?", repositories=["vercel/next.js"],)print(f"Job started: {job['id']}")# Wait for completion (polls every 2s, 10min timeout)result = sdk.oracle.wait_for_job(job_id=job["id"])print(result)# Or stream events in real-timefor event in sdk.oracle.stream_job_events(job_id=job["id"]): print(event)
// Start a research jobconst job = await sdk.oracle.createJob({ query: "How does Next.js handle caching in the App Router?", repositories: ["vercel/next.js"],});console.log(`Job started: ${job.id}`);// Wait for completion (polls every 2s, 10min timeout)const result = await sdk.oracle.waitForJob(job.id);console.log(result);// Or stream events in real-timefor await (const event of sdk.oracle.streamJob(job.id)) { console.log(event);}