### Install Nia AI SDK Source: https://docs.trynia.ai/sdk/quickstart Commands to install the Nia AI SDK using common package managers for Python and TypeScript. ```bash pip install nia-ai-py # Or with uv: uv add nia-ai-py ``` ```bash npm install nia-ai-ts # Or: yarn add nia-ai-ts pnpm add nia-ai-ts bun add nia-ai-ts ``` -------------------------------- ### GET /v2/slack/installations Source: https://docs.trynia.ai/slack-search Retrieves a list of all connected Slack workspace installations. ```APIDOC ## GET /v2/slack/installations ### Description Retrieves a list of all connected Slack workspace installations. ### Method GET ### Endpoint /v2/slack/installations ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```bash curl https://apigcp.trynia.ai/v2/slack/installations \ -H "Authorization: Bearer $NIA_API_KEY" ``` ### Response #### Success Response (200) - **installations** (array) - A list of installation objects. - **id** (string) - The unique identifier for the installation. - **team_id** (string) - The Slack team ID. - **team_name** (string) - The name of the Slack team. - **status** (string) - The status of the installation. - **is_external** (boolean) - Indicates if the installation is external (BYOT). - **indexed_channel_count** (integer) - The number of channels indexed. - **indexed_message_count** (integer) - The number of messages indexed. - **last_sync_at** (string) - The timestamp of the last synchronization. #### Response Example ```json { "installations": [ { "id": "a9e51db8-...", "team_id": "T12345", "team_name": "Customer Workspace", "status": "active", "is_external": true, "indexed_channel_count": 43, "indexed_message_count": 1401, "last_sync_at": "2026-02-19T18:05:02Z" } ] } ``` ``` -------------------------------- ### Configure Trynia AI SDK (Python) Source: https://docs.trynia.ai/sdk/quickstart Initializes the Trynia AI SDK client with essential configuration parameters. Supports API key authentication, custom base URLs, request timeouts, and retry mechanisms with exponential backoff. This setup is crucial for interacting with the Trynia AI services. ```python sdk = NiaSDK( api_key="nia_your_api_key", base_url="https://apigcp.trynia.ai/v2", # default timeout_seconds=60.0, # request timeout max_retries=2, # retry on 5xx / transport errors initial_backoff_seconds=0.5, # exponential backoff base ) ``` -------------------------------- ### Configure Trynia AI SDK (TypeScript) Source: https://docs.trynia.ai/sdk/quickstart Initializes the Trynia AI SDK client with essential configuration parameters. Supports API key authentication, custom base URLs, and retry mechanisms with exponential backoff. This setup is crucial for interacting with the Trynia AI services. ```typescript const sdk = new NiaSDK({ apiKey: "nia_your_api_key", baseUrl: "https://apigcp.trynia.ai/v2", // default maxRetries: 2, // retry on failures initialBackoffMs: 500, // exponential backoff base }); ``` -------------------------------- ### Initialize Nia Wizard Source: https://docs.trynia.ai/ The quick start command to initialize the Nia environment. This command uses npx to fetch and execute the latest version of the Nia setup wizard. ```shell npx nia-wizard@latest ``` -------------------------------- ### Start and Monitor Oracle Research Job (Python) Source: https://docs.trynia.ai/sdk/quickstart Initiates a multi-step research job with a specified query and repositories. It then waits for the job to complete and prints the results. Alternatively, it can stream job events in real-time. Requires the `trynia_ai` SDK. ```python # Start a research job job = 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-time for event in sdk.oracle.stream_job_events(job_id=job["id"]): print(event) ``` -------------------------------- ### Index Repositories and Documentation Source: https://docs.trynia.ai/api-guide Examples for indexing external code repositories and documentation URLs into the Nia platform using curl. ```bash curl -X POST https://apigcp.trynia.ai/v2/repositories \ -H "Authorization: Bearer $NIA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"repository": "vercel/ai"}' ``` ```bash curl -X POST https://apigcp.trynia.ai/v2/data-sources \ -H "Authorization: Bearer $NIA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://sdk.vercel.ai/docs"}' ``` -------------------------------- ### Install Nia CLI Source: https://docs.trynia.ai/api-guide A shell command to install the Nia CLI, which is the recommended method for integrating Nia with AI coding agents. ```bash curl -fsSL https://app.trynia.ai/cli | sh ``` -------------------------------- ### Install Nia CLI using Bunx Source: https://docs.trynia.ai/integrations/installation/cli Installs the Nia CLI using the 'bunx' package runner. The wizard handles authentication, configuration, and global command availability. Alternative installation methods using npm, pnpm, and yarn are also provided. ```bash bunx nia-wizard@latest ``` ```bash npx nia-wizard@latest # npm ``` ```bash pnpx nia-wizard@latest # pnpm ``` ```bash yarn dlx nia-wizard@latest # yarn ``` -------------------------------- ### Start and Monitor Oracle Research Job (TypeScript) Source: https://docs.trynia.ai/sdk/quickstart Initiates a multi-step research job with a specified query and repositories. It then waits for the job to complete and logs the results. Alternatively, it can stream job events in real-time using async iterators. Requires the `trynia_ai` SDK. ```typescript // Start a research job const 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-time for await (const event of sdk.oracle.streamJob(job.id)) { console.log(event); } ``` -------------------------------- ### GET /slack/installations/{installation_id}/channels Source: https://docs.trynia.ai/api-reference/slack/list-slack-channels Retrieves a list of available Slack channels associated with a specific installation ID. ```APIDOC ## GET /slack/installations/{installation_id}/channels ### Description List available Slack channels from the workspace associated with the provided installation ID. ### Method GET ### Endpoint /slack/installations/{installation_id}/channels ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier for the Slack installation. ### Request Example GET /v2/slack/installations/12345/channels ### Response #### Success Response (200) - **channels** (array) - A list of channel objects available in the workspace. #### Response Example { "channels": [ { "id": "C12345", "name": "general" }, { "id": "C67890", "name": "random" } ] } ``` -------------------------------- ### List Slack Installations (Bash) Source: https://docs.trynia.ai/slack-search Retrieves a list of all connected Slack installations. Requires NIA_API_KEY. Returns details about each installation, including indexing status. ```bash curl https://apigcp.trynia.ai/v2/slack/installations \ -H "Authorization: Bearer $NIA_API_KEY" ``` -------------------------------- ### GET /google-drive/installations/{installation_id}/browse Source: https://docs.trynia.ai/google-drive Allows users to browse the file and folder structure of a connected Google Drive installation. ```APIDOC ## GET /google-drive/installations/{installation_id}/browse ### Description Retrieves a list of files and folders within the specified Google Drive installation. ### Method GET ### Endpoint /google-drive/installations/{installation_id}/browse ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier of the Google Drive installation. ### Response #### Success Response (200) - **files** (array) - List of file and folder objects. ``` -------------------------------- ### GET /slack/installations/{installation_id} Source: https://docs.trynia.ai/api-reference/slack/get-slack-installation Retrieve detailed information about a specific Slack workspace installation connected to the Nia AI platform. ```APIDOC ## GET /slack/installations/{installation_id} ### Description Retrieves the configuration and status details for a specific Slack installation using its unique identifier. ### Method GET ### Endpoint /slack/installations/{installation_id} ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier of the Slack installation. ### Request Example N/A (No request body required) ### Response #### Success Response (200) - **data** (object) - The installation details object. #### Response Example { "id": "slack_12345", "workspace_name": "My Workspace", "status": "active" } ``` -------------------------------- ### Install Nia Skill Non-Interactively Source: https://docs.trynia.ai/agent-onboarding Installs a Nia skill using the CLI without requiring manual user interaction. Supports optional target pinning for specific environments. ```bash npx nia-wizard skill add \ --api-key "" \ --source nozomio-labs/nia-skill \ --non-interactive \ --ci ``` ```bash npx nia-wizard skill add \ --api-key "" \ --target codex \ --non-interactive \ --ci ``` -------------------------------- ### GET /v2/slack/installations/{installation_id}/status Source: https://docs.trynia.ai/slack-search Retrieves the current indexing status and progress of a specific Slack workspace installation. ```APIDOC ## GET /v2/slack/installations/{installation_id}/status ### Description Returns the indexing status, progress percentage, and metadata for a Slack workspace. ### Method GET ### Endpoint https://apigcp.trynia.ai/v2/slack/installations/{installation_id}/status ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier for the Slack installation. ### Request Example curl https://apigcp.trynia.ai/v2/slack/installations/{installation_id}/status \ -H "Authorization: Bearer $NIA_API_KEY" ### Response #### Success Response (200) - **installation_id** (string) - Unique ID - **status** (string) - Current state (e.g., processing) - **progress** (integer) - Percentage complete #### Response Example { "installation_id": "a9e51db8-...", "status": "processing", "progress": 45 } ``` -------------------------------- ### Install Nia Sync CLI Source: https://docs.trynia.ai/local-sync Provides methods to install the Nia Sync daemon using either a shell script or the Python package manager. ```bash curl -fsSL https://app.trynia.ai/install-sync | bash ``` ```bash pip install nia-sync ``` -------------------------------- ### List Channels for Slack Installation (Bash) Source: https://docs.trynia.ai/slack-search Fetches a list of available channels within a specific Slack installation. Requires NIA_API_KEY and the installation_id. ```bash curl https://apigcp.trynia.ai/v2/slack/installations/{installation_id}/channels \ -H "Authorization: Bearer $NIA_API_KEY" ``` -------------------------------- ### Install Nia MCP via Smithery CLI Source: https://docs.trynia.ai/integrations/installation/mcp Command to automatically install the Nia MCP server using the Smithery CLI tool. ```bash npx -y @smithery/cli@latest install nia-mcp-server --client --key ``` -------------------------------- ### POST /v2/oracle/jobs Source: https://docs.trynia.ai/sdk/examples Creates a new research job for the Oracle service. ```APIDOC ## POST /v2/oracle/jobs ### Description Initiates a new research job to analyze repositories or topics. ### Method POST ### Endpoint /v2/oracle/jobs ### Request Body - **query** (string) - Required - The research question or topic. - **repositories** (array) - Optional - List of repositories to analyze. - **output_format** (string) - Optional - Desired format of the results. - **model** (string) - Optional - The AI model to use for the research. ### Request Example { "query": "Compare React Server Components vs traditional SSR", "repositories": ["vercel/next.js"], "output_format": "comparison table", "model": "claude-sonnet-4-5-20250929" } ### Response #### Success Response (200) - **id** (string) - The unique job ID. - **status** (string) - The initial status of the job. ``` -------------------------------- ### Initialize SDK and Perform Semantic Search Source: https://docs.trynia.ai/sdk/quickstart Demonstrates how to instantiate the NiaSDK client and execute a basic semantic search query. ```python from nia_py.sdk import NiaSDK sdk = NiaSDK(api_key="nia_your_api_key") # Semantic search across your indexed sources results = sdk.search.universal(query="How does authentication work?") print(results) ``` ```typescript import { NiaSDK } from "nia-ai-ts"; const sdk = new NiaSDK({ apiKey: "nia_your_api_key" }); // Semantic search across your indexed sources const results = await sdk.search.universal({ query: "How does authentication work?" }); console.log(results); ``` -------------------------------- ### POST /google-drive/install/callback Source: https://docs.trynia.ai/api-reference/google-drive/handle-oauth-callback Exchanges a Google OAuth authorization code for access tokens and initializes the Google Drive installation for the user. ```APIDOC ## POST /google-drive/install/callback ### Description Exchange the Google OAuth code for tokens and create the Drive installation. This endpoint is used to finalize the OAuth flow for Google Drive integration. ### Method POST ### Endpoint /google-drive/install/callback ### Parameters #### Request Body - **code** (string) - Required - Authorization code from Google - **redirect_uri** (string) - Optional - Redirect URI used in the authorization request ### Request Example { "code": "4/0AfgeWd...", "redirect_uri": "https://app.trynia.ai/callback" } ### Response #### Success Response (200) - **object** (object) - Successful installation response #### Response Example { "status": "success" } ``` -------------------------------- ### GET /google-drive/installations/{installation_id}/selection Source: https://docs.trynia.ai/api-reference/google-drive/get-google-drive-selection Retrieves the current file and folder selection for a specified Google Drive installation. ```APIDOC ## GET /google-drive/installations/{installation_id}/selection ### Description Get the current file and folder selection for a Drive installation. ### Method GET ### Endpoint /google-drive/installations/{installation_id}/selection #### Path Parameters - **installation_id** (string) - Required - The ID of the Google Drive installation. ### Request Example (No request body for GET request) ### Response #### Success Response (200) - (No specific fields defined in schema, likely returns a JSON object representing the selection) #### Error Response (422) - **detail** (array) - Contains a list of validation errors. - **loc** (array) - The location of the error in the request. - **msg** (string) - The error message. - **type** (string) - The type of error. #### Response Example (Success response example not provided in schema) ```json { "detail": [ { "loc": [ "body", "field_name" ], "msg": "Invalid input", "type": "value_error" } ] } ``` ``` -------------------------------- ### Headless End-to-End Onboarding Script Source: https://docs.trynia.ai/agent-onboarding A complete shell script demonstrating the full onboarding flow: signup, token exchange, and skill installation in a headless environment. ```bash #!/usr/bin/env bash set -euo pipefail BASE_URL="https://apigcp.trynia.ai/v2" EMAIL="agent@example.com" PASSWORD="strong-password-123" ORG_NAME="Agent Org" SIGNUP_JSON=$(curl -sS -X POST "$BASE_URL/auth/signup" \ -H "Content-Type: application/json" \ -d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\",\"organization_name\":\"$ORG_NAME\"}") BOOTSTRAP_TOKEN=$(echo "$SIGNUP_JSON" | jq -r '.bootstrap_token') KEY_JSON=$(curl -sS -X POST "$BASE_URL/auth/bootstrap-key" \ -H "Content-Type: application/json" \ -d "{\"bootstrap_token\":\"$BOOTSTRAP_TOKEN\"}") API_KEY=$(echo "$KEY_JSON" | jq -r '.api_key') npx nia-wizard skill add --api-key "$API_KEY" --non-interactive --ci ``` -------------------------------- ### GET /v2/oracle/jobs/{job_id} Source: https://docs.trynia.ai/sdk/examples Retrieves the status and results of a specific research job. ```APIDOC ## GET /v2/oracle/jobs/{job_id} ### Description Fetches details for a specific research job by its ID. ### Method GET ### Endpoint /v2/oracle/jobs/{job_id} ### Parameters #### Path Parameters - **job_id** (string) - Required - The unique identifier of the job. ### Response #### Success Response (200) - **id** (string) - Job ID. - **status** (string) - Current status (e.g., "completed", "processing"). - **result** (object) - The research findings. ``` -------------------------------- ### POST /google-drive/install Source: https://docs.trynia.ai/google-drive Initiates the OAuth flow to connect a Google Drive account to the platform. ```APIDOC ## POST /google-drive/install ### Description Starts the Google OAuth installation flow to authorize access to a user's Google Drive. ### Method POST ### Endpoint /google-drive/install ### Response #### Success Response (302) - **Redirect** (URL) - Redirects the user to the Google OAuth consent screen. ``` -------------------------------- ### POST /v2/auth/signup Source: https://docs.trynia.ai/agent-onboarding Creates a new user account and organization, returning a bootstrap token for initial session setup. ```APIDOC ## POST /v2/auth/signup ### Description Creates a new account and organization for an autonomous agent. Returns a bootstrap token used to generate a permanent API key. ### Method POST ### Endpoint https://apigcp.trynia.ai/v2/auth/signup ### Request Body - **email** (string) - Required - Agent email address - **password** (string) - Required - Strong password - **organization_name** (string) - Required - Name of the organization - **first_name** (string) - Optional - User first name - **last_name** (string) - Optional - User last name - **idempotency_key** (string) - Optional - Unique key for request safety ### Response #### Success Response (200) - **bootstrap_token** (string) - Token for key exchange - **expires_at** (string) - Expiration timestamp - **user_id** (string) - Unique user identifier - **organization_id** (string) - Unique organization identifier ``` -------------------------------- ### GET /v2/slack/installations/{installation_id}/channels Source: https://docs.trynia.ai/slack-search Lists the channels available for a specific Slack workspace installation. ```APIDOC ## GET /v2/slack/installations/{installation_id}/channels ### Description Lists the channels available for a specific Slack workspace installation. ### Method GET ### Endpoint /v2/slack/installations/{installation_id}/channels ### Parameters #### Path Parameters - **installation_id** (string) - Required - The ID of the Slack installation. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```bash curl https://apigcp.trynia.ai/v2/slack/installations/{installation_id}/channels \ -H "Authorization: Bearer $NIA_API_KEY" ``` ### Response #### Success Response (200) - **channels** (array) - A list of channel objects. (Note: The exact structure of channel objects is not provided in the source text, but typically includes channel ID and name). #### Response Example (Example response structure not provided in source text.) ``` -------------------------------- ### Get Slack Index Status Source: https://docs.trynia.ai/api-reference/slack/get-slack-index-status Retrieves the indexing status for a specific Slack workspace installation. ```APIDOC ## GET /slack/installations/{installation_id}/status ### Description Get the indexing status for a Slack workspace. ### Method GET ### Endpoint /slack/installations/{installation_id}/status ### Parameters #### Path Parameters - **installation_id** (string) - Required - The ID of the Slack installation. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) (Schema not detailed in provided OpenAPI spec, but typically includes status information) #### Response Example ```json { "status": "indexing", "last_indexed_at": "2023-10-27T10:00:00Z" } ``` #### Error Response (422) - **detail** (array) - Validation error details ``` -------------------------------- ### Manage Indexed Sources Source: https://docs.trynia.ai/sdk/quickstart Demonstrates CRUD operations for managing indexed sources like repositories and documentation URLs. ```python # 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 filters repos = sdk.sources.list(type="repository", limit=20) # Resolve a source by name source = sdk.sources.resolve(identifier="vercel/ai") # Delete a source sdk.sources.delete(source_id="source-uuid") ``` ```typescript // 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 filters const repos = await sdk.sources.list({ type: "repository", limit: 20 }); // Resolve a source by name const source = await sdk.sources.resolve({ identifier: "vercel/ai" }); // Delete a source await sdk.sources.delete({ sourceId: "source-uuid" }); ``` -------------------------------- ### POST /google-drive/installations/{installation_id}/index Source: https://docs.trynia.ai/google-drive Triggers the initial indexing process for the selected Google Drive content. ```APIDOC ## POST /google-drive/installations/{installation_id}/index ### Description Triggers the initial indexing run for the specified Google Drive installation. ### Method POST ### Endpoint /google-drive/installations/{installation_id}/index ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier of the Google Drive installation. ### Response #### Success Response (202) - **status** (string) - Confirmation that the indexing job has been queued. ``` -------------------------------- ### GET /google-drive/installations/{installation_id}/status Source: https://docs.trynia.ai/api-reference/google-drive/get-google-drive-index-status Retrieves the current indexing status for a specific Google Drive installation. ```APIDOC ## GET /google-drive/installations/{installation_id}/status ### Description Get the current indexing status for a Google Drive installation. ### Method GET ### Endpoint /google-drive/installations/{installation_id}/status ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier for the Google Drive installation. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **status** (object) - The current indexing status of the installation. #### Response Example ```json { "status": "indexed", "last_sync": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Get Google Drive Installation Details (OpenAPI) Source: https://docs.trynia.ai/api-reference/google-drive/get-google-drive-installation Retrieves detailed information about a specific Google Drive installation using its unique ID. This endpoint is part of the Google Drive integration and requires an installation ID as a path parameter. It returns a 200 OK response on success or a 422 Validation Error if the input is invalid. ```yaml openapi: 3.1.0 info: title: Nia AI API version: 1.0.0 description: > Nia AI API provides a single, consistent `sources` resource for all indexed content. ## Core Resources **Sources** (`/sources`) - `repository` - `documentation` - `research_paper` - `huggingface_dataset` - `local_folder` - `slack` - `google_drive` **Search** (`/search`) - `mode`: query | web | deep | universal Legacy endpoints are deprecated and will be removed in a future version. Prefer `/sources` and `/search` for new integrations. servers: - url: https://apigcp.trynia.ai/v2 description: Production API - url: http://localhost:8000/v2 description: Local development security: - ApiKeyAuth: [] tags: - name: Sources description: >- Unified source management — index, list, read, search, and manage all source types - name: Search description: >- Search across indexed sources, GitHub repositories, and public package registries - name: Contexts description: Cross-agent context sharing and memory - name: Oracle description: AI-powered autonomous research - name: Tracer description: Autonomous agent that searches GitHub repositories to answer questions - name: Categories description: Organize sources into categories - name: Advisor description: Context-aware code analysis and recommendations - name: Dependencies description: Analyze and subscribe to documentation for project dependencies - name: Slack description: Slack workspace integration — index and search messages - name: Google Drive description: >- Google Drive integration — connect accounts, browse Drive items, index selections, and sync changes - name: Auth description: Account creation and API key management - name: Usage description: API usage statistics paths: /google-drive/installations/{installation_id}: get: tags: - Google Drive summary: Get Google Drive Installation description: Get details for a specific Google Drive installation. operationId: >- get_google_drive_installation_v2_google_drive_installations__installation_id__get parameters: - name: installation_id in: path required: true schema: type: string title: Installation Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError securitySchemes: ApiKeyAuth: type: http scheme: bearer bearerFormat: API Key description: API key must be provided in the Authorization header ``` -------------------------------- ### Create Account via API Source: https://docs.trynia.ai/agent-onboarding Registers a new user account to retrieve a bootstrap token. This is the initial step for new agents requiring access to the Trynia platform. ```bash curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/signup" \ -H "Content-Type: application/json" \ -d '{ "email": "agent@example.com", "password": "strong-password-123", "organization_name": "Agent Org", "first_name": "Agent", "last_name": "Runner", "idempotency_key": "signup-agent-001" }' ``` -------------------------------- ### GET /google-drive/installations/{installation_id} Source: https://docs.trynia.ai/api-reference/google-drive/get-google-drive-installation Retrieves detailed information about a specific Google Drive installation using its unique ID. ```APIDOC ## GET /google-drive/installations/{installation_id} ### Description Get details for a specific Google Drive installation. ### Method GET ### Endpoint /google-drive/installations/{installation_id} ### Parameters #### Path Parameters - **installation_id** (string) - Required - The unique identifier for the Google Drive installation. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - (No specific schema provided, but typically returns installation details) #### Response Example ```json { "example": "response body" } ``` #### Error Response (422) - **detail** (array) - Contains validation error details. - **loc** (array) - Location of the error (e.g., path, query). - **msg** (string) - Error message. - **type** (string) - Error type. #### Error Response Example ```json { "detail": [ { "loc": [ "path", "installation_id" ], "msg": "value is not a valid uuid", "type": "type_error.uuid" } ] } ``` ``` -------------------------------- ### Execute Advanced Search Operations Source: https://docs.trynia.ai/sdk/quickstart Covers various search capabilities including universal, query-based, web, and deep research methods. ```python from nia_py.sdk import NiaSDK sdk = NiaSDK(api_key="nia_your_api_key") # Universal search across all indexed sources results = sdk.search.universal(query="implement retry logic", top_k=10) # Query search with specific repos and conversation context results = sdk.search.query( messages=[{"role": "user", "content": "How does streaming work?"}], repositories=["vercel/ai"], ) # Web search results = sdk.search.web(query="latest LLM developments") # Deep research (multi-step with citations) results = sdk.search.deep(query="Compare RSC vs traditional SSR") ``` ```typescript import { NiaSDK } from "nia-ai-ts"; const sdk = new NiaSDK({ apiKey: "nia_your_api_key" }); // Universal search across all indexed sources const results = await sdk.search.universal({ query: "implement retry logic", top_k: 10 }); // Query search with specific repos and conversation context const queryResults = await sdk.search.query({ messages: [{ role: "user", content: "How does streaming work?" }], repositories: ["vercel/ai"], }); // Web search const 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" }); ``` -------------------------------- ### POST /slack/installations/{installation_id}/channels Source: https://docs.trynia.ai/api-reference/slack/configure-slack-channels Configure which Slack channels to index. You can choose to index all channels or a selected list of channels by providing their IDs. ```APIDOC ## POST /slack/installations/{installation_id}/channels ### Description Configure which Slack channels to index. You can choose to index all channels or a selected list of channels by providing their IDs. ### Method POST ### Endpoint /slack/installations/{installation_id}/channels ### Parameters #### Path Parameters - **installation_id** (string) - Required - The ID of the Slack installation. #### Query Parameters None #### Request Body - **mode** (string) - Optional - Specifies whether to index 'all' channels or 'selected' channels. Defaults to 'all'. - **include_channels** (array[string] | null) - Optional - A list of channel IDs to include when mode is 'selected'. - **exclude_channels** (array[string] | null) - Optional - A list of channel IDs to exclude. ### Request Example ```json { "mode": "selected", "include_channels": ["C12345ABCDE", "C67890FGHIJ"], "exclude_channels": [] } ``` ### Response #### Success Response (200) An empty JSON object indicates success. #### Response Example ```json { "message": "Configuration updated successfully." } ``` #### Error Response (422) - **detail** (array[object]) - Contains details about validation errors. - **loc** (array) - The location of the error in the request. - **msg** (string) - The error message. - **type** (string) - The error type. ``` -------------------------------- ### Get Google Drive Index Status - OpenAPI Source: https://docs.trynia.ai/api-reference/google-drive/get-google-drive-index-status Retrieves the current indexing status for a specific Google Drive installation. This endpoint requires the installation ID as a path parameter. It returns a success response upon successful retrieval or a validation error if the input is invalid. ```yaml openapi: 3.1.0 info: title: Nia AI API version: 1.0.0 description: > Nia AI API provides a single, consistent `sources` resource for all indexed content. ## Core Resources **Sources** (`/sources`) - `repository` - `documentation` - `research_paper` - `huggingface_dataset` - `local_folder` - `slack` - `google_drive` **Search** (`/search`) - `mode`: query | web | deep | universal Legacy endpoints are deprecated and will be removed in a future version. Prefer `/sources` and `/search` for new integrations. servers: - url: https://apigcp.trynia.ai/v2 description: Production API - url: http://localhost:8000/v2 description: Local development security: - ApiKeyAuth: [] tags: - name: Sources description: >- Unified source management — index, list, read, search, and manage all source types - name: Search description: >- Search across indexed sources, GitHub repositories, and public package registries - name: Contexts description: Cross-agent context sharing and memory - name: Oracle description: AI-powered autonomous research - name: Tracer description: Autonomous agent that searches GitHub repositories to answer questions - name: Categories description: Organize sources into categories - name: Advisor description: Context-aware code analysis and recommendations - name: Dependencies description: Analyze and subscribe to documentation for project dependencies - name: Slack description: Slack workspace integration — index and search messages - name: Google Drive description: >- Google Drive integration — connect accounts, browse Drive items, index selections, and sync changes - name: Auth description: Account creation and API key management - name: Usage description: API usage statistics paths: /google-drive/installations/{installation_id}/status: get: tags: - Google Drive summary: Get Google Drive Index Status description: Get the current indexing status for a Google Drive installation. operationId: >- get_google_drive_index_status_v2_google_drive_installations__installation_id__status_get parameters: - name: installation_id in: path required: true schema: type: string title: Installation Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError securitySchemes: ApiKeyAuth: type: http scheme: bearer bearerFormat: API Key description: API key must be provided in the Authorization header ``` -------------------------------- ### Configure Trae with Trynia AI MCP Server Source: https://docs.trynia.ai/integrations/installation/mcp Configuration settings for Trae to integrate with the Trynia AI MCP server. Examples are provided for both remote and local server setups. Replace 'YOUR_API_KEY' with your actual API key. ```json { "mcpServers": { "nia": { "url": "https://apigcp.trynia.ai/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` ```json { "mcpServers": { "nia": { "command": "pipx", "args": ["run", "--no-cache", "nia-mcp-server"], "env": { "NIA_API_KEY": "YOUR_API_KEY", "NIA_API_URL": "https://apigcp.trynia.ai/" } } } } ``` -------------------------------- ### Get Slack Index Status via OpenAPI Source: https://docs.trynia.ai/api-reference/slack/get-slack-index-status Retrieves the current indexing status for a specific Slack workspace installation. This endpoint requires an installation_id path parameter and uses Bearer token authentication. ```yaml paths: /slack/installations/{installation_id}/status: get: tags: - Slack summary: Get Slack Index Status description: Get the indexing status for a Slack workspace. operationId: get_slack_index_status_v2_slack_installations__installation_id__status_get parameters: - name: installation_id in: path required: true schema: type: string title: Installation Id responses: '200': description: Successful Response content: application/json: schema: {} ``` -------------------------------- ### Initialize Nia AI SDK (Python) Source: https://docs.trynia.ai/sdk/examples Initializes the Nia AI SDK using an API key stored in environment variables. This is a prerequisite for all other SDK operations. ```python import os from nia_py.sdk import NiaSDK sdk = NiaSDK(api_key=os.environ["NIA_API_KEY"]) ``` -------------------------------- ### Install Nia Plugin from GitHub Source: https://docs.trynia.ai/integrations/claude-code-skill Installs the Nia plugin by adding its GitHub repository to the Claude Code marketplace. This method is useful for installing specific versions or if direct marketplace installation fails. ```bash /plugin marketplace add nozomio-labs/nia-plugin /plugin install nia@nozomio-labs/nia-plugin ``` -------------------------------- ### Index Documentation (Python - High-level SDK) Source: https://docs.trynia.ai/sdk/examples Indexes a given URL as a data source using the high-level SDK. This is a simplified method requiring only the URL and display name. ```python sdk.sources.create({ "url": "https://docs.anthropic.com", "display_name": "Anthropic Docs", }) ``` -------------------------------- ### Index and Subscribe to Resources Source: https://docs.trynia.ai/tools-features The `index` tool serves as a universal entry point for various data sources including repositories, documentation, research papers, datasets, spreadsheets, and local folders. It automatically detects the type of URL or file provided. The `auto_subscribe_dependencies` tool parses manifest files to automatically index related documentation. `manage_resource` allows for listing, status checks, renaming, deletion, and subscription management of indexed resources. ```shell Index https://github.com/owner/repo Index https://docs.example.com Index https://arxiv.org/abs/2401.12345 Index https://huggingface.co/datasets/openai/gsm8k ``` -------------------------------- ### POST /v2/auth/login-key Source: https://docs.trynia.ai/agent-onboarding Authenticates a returning user via email and password to retrieve a fresh API key. ```APIDOC ## POST /v2/auth/login-key ### Description Authenticates an existing user and returns a fresh API key for headless operations. ### Method POST ### Endpoint https://apigcp.trynia.ai/v2/auth/login-key ### Request Body - **email** (string) - Required - User email - **password** (string) - Required - User password - **organization_id** (string) - Optional - Target organization ID - **idempotency_key** (string) - Optional - Unique key for request safety ### Response #### Success Response (200) - **api_key** (string) - Freshly generated API key ``` -------------------------------- ### POST /auth/signup Source: https://docs.trynia.ai/api-reference/auth/signup Registers a new user account and returns a bootstrap token for API key generation. ```APIDOC ## POST /auth/signup ### Description Create a new account and receive a bootstrap token. The bootstrap token can be exchanged exactly once via POST /v2/auth/bootstrap-key to obtain an nk_ API key. ### Method POST ### Endpoint /auth/signup ### Parameters #### Request Body - **email** (string) - Required - User email address - **password** (string) - Required - Account password (min 8 chars) - **organization_name** (string) - Required - Organization name (all API keys are org-scoped) - **first_name** (string) - Optional - User first name - **last_name** (string) - Optional - User last name - **idempotency_key** (string) - Optional - Idempotency key for safe retries ### Request Example { "email": "user@example.com", "password": "securepassword123", "organization_name": "My Organization" } ### Response #### Success Response (200) - **user_id** (string) - Unique identifier for the user - **organization_id** (string) - Unique identifier for the organization - **bootstrap_token** (string) - One-time token for API key exchange - **expires_at** (string) - Expiration timestamp for the token - **email_verified** (boolean) - Email verification status #### Response Example { "user_id": "u_12345", "organization_id": "org_67890", "bootstrap_token": "bt_abc123", "expires_at": "2023-12-31T23:59:59Z", "email_verified": false } ``` -------------------------------- ### Retrieve Slack Installation Details via OpenAPI Source: https://docs.trynia.ai/api-reference/slack/get-slack-installation This endpoint retrieves configuration and status details for a specific Slack installation using its unique identifier. It requires an API key for authentication and returns a JSON object containing the installation metadata. ```yaml paths: /slack/installations/{installation_id}: get: tags: - Slack summary: Get Slack Installation description: Get details for a specific Slack installation. operationId: get_slack_installation_v2_slack_installations__installation_id__get parameters: - name: installation_id in: path required: true schema: type: string title: Installation Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' ``` -------------------------------- ### Disconnect Slack Installation (Bash) Source: https://docs.trynia.ai/slack-search Removes a Slack workspace installation from Nia. Requires NIA_API_KEY and the installation_id. ```bash curl -X DELETE https://apigcp.trynia.ai/v2/slack/installations/{installation_id} \ -H "Authorization: Bearer $NIA_API_KEY" ``` -------------------------------- ### Configure Continue.dev with Trynia AI MCP Server Source: https://docs.trynia.ai/integrations/installation/mcp Configuration for Continue.dev to connect to the Trynia AI MCP server. Supports both remote and local server setups. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```json { "experimental": { "modelContextProtocolServer": { "transport": { "type": "http", "url": "https://apigcp.trynia.ai/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } } ``` ```json { "models": [], "mcpServers": [ { "name": "nia", "command": "pipx", "args": ["run", "--no-cache", "nia-mcp-server"], "env": { "NIA_API_KEY": "YOUR_API_KEY", "NIA_API_URL": "https://apigcp.trynia.ai/" } } ] } ``` -------------------------------- ### Authenticate Returning User Source: https://docs.trynia.ai/agent-onboarding Authenticates an existing user using email and password to generate a new API key. Used for agents that have already completed the initial signup process. ```bash curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/login-key" \ -H "Content-Type: application/json" \ -d '{ "email": "agent@example.com", "password": "strong-password-123", "organization_id": "", "idempotency_key": "login-agent-001" }' ```