Skip to main content

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:
Get your API key at app.trynia.ai. For autonomous agents, use Agent Onboarding to create accounts and keys via API (/v2/auth/signup, /v2/auth/verify, /v2/auth/login, /v2/auth/login/verify) and then install the skill non-interactively.
Store your API key in an environment variable or secret manager. Rotate it immediately if compromised.

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 a 429 status code:
Rate limit headers are included in responses:

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 (not org/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 (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:
Response includes status:
For a quick inventory of all sources:

Error Handling

The Nia API uses standard HTTP status codes:

Error Response Format


SDK & Integration Options

The easiest way to integrate Nia with AI coding agents:
See the Installation guide for detailed setup.

Direct API Integration

For custom applications, use the REST API directly: JavaScript/TypeScript:
Python:

Key Endpoints

Check out the API Reference for complete endpoint documentation with request/response schemas.