Authentication
All API requests require authentication using an API key. Include your API key in theAuthorization header:
/v2/auth/signup, /v2/auth/verify, /v2/auth/login, /v2/auth/login/verify) and then install the skill non-interactively.
Base URL
All API endpoints are available at:Rate Limits
View your current usage and limits at app.trynia.ai. See the Pricing page for plan details. When you exceed rate limits, the API returns a429 status code:
Quick Start Examples
Index a Repository
Index Documentation
Search Across Sources
Deploy a Document Agent
Package Search (No Indexing Required)
Sandbox search (clone + read-only agent)
Run an ephemeral sandbox that clones a public repo URL and answers with a read-only agent — no indexing step. Use a full URL (notorg/repo shorthand). See Sandbox search for SSE, job polling, and response fields.
Best Practices
Use the Unified Search Endpoint
The/search endpoint supports four modes via a discriminator. Use mode: "query" for multi-source search, mode: "universal" for cross-source discovery, mode: "web" for web search, and mode: "deep" for multi-step research:
Sandbox search vs unified search
Sandbox search (POST /sandbox/search) bills as a query like /search, but it clones the repository into an isolated VM for a file-grounded agent run. Prefer /search when your content is already indexed or you need multi-source retrieval; use sandbox search for one-off deep questions against a public Git URL without creating a source.
Leverage Package Search for Dependencies
Search through 3,000+ packages across PyPI, NPM, Crates.io, and Go modules without indexing:Handle Rate Limits with Exponential Backoff
Monitor Indexing Progress
Large sources take time to index. Poll the status endpoint:Error Handling
The Nia API uses standard HTTP status codes:Error Response Format
SDK & Integration Options
MCP Server (Recommended for AI Agents)
The easiest way to integrate Nia with AI coding agents:Direct API Integration
For custom applications, use the REST API directly: JavaScript/TypeScript:Key Endpoints
Check out the API Reference for complete endpoint documentation with request/response schemas.

