Quickstart

Get up and running with ONI Cortex in under 2 minutes. Three steps to semantic search over your codebase.

Base URL: https://cortex.oni.botAll endpoints below are relative to this base.
1Sign up and get your API key

Create your account with a single API call. You will receive both a live and test API key immediately.

curl
curl -X POST https://cortex.oni.bot/api/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Your Name",
    "email": "you@company.com",
    "password": "your-secure-password"
  }'
Response (201 Created)
{
  "tenant_id": "tn_8f3a1b2c",
  "name": "Your Name",
  "email": "you@company.com",
  "plan": "free",
  "api_key_live": "oni_live_a1b2c3d4e5f6...",
  "api_key_test": "oni_test_f6e5d4c3b2a1...",
  "mcp_url": "https://cortex.oni.bot/t/tn_8f3a1b2c/sse"
}

Save your api_key_live -- you will use it for all authenticated requests. You can pass it as a Bearer token (Authorization: Bearer oni_live_xxx) or as a query param (?key=oni_live_xxx).

2Connect your first repo

Index a GitHub repository into your default collection. The indexer will clone, chunk, embed, and store your code automatically.

curl
curl -X POST https://cortex.oni.bot/api/v1/collections/default/connect-repo \
  -H "Authorization: Bearer oni_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{
    "repo_url": "https://github.com/your-org/your-repo",
    "branch": "main"
  }'
Response (200 OK)
{
  "status": "indexing",
  "collection_id": "col_1a2b3c",
  "repo_url": "https://github.com/your-org/your-repo",
  "branch": "main",
  "message": "Repository indexing started. This typically takes 1-3 minutes."
}
3Query your context

Search your indexed codebase with natural language. Results include file paths, line numbers, and relevance scores.

curl
curl -X POST https://cortex.oni.bot/api/v1/search \
  -H "Authorization: Bearer oni_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{"query": "how does authentication work?", "limit": 5}'
Response (200 OK)
{
  "results": [
    {
      "score": 0.94,
      "content": "def authenticate(request):\n    token = request.headers.get('Authorization')...",
      "metadata": {
        "path": "src/auth/middleware.py",
        "line_start": 12,
        "line_end": 38
      }
    },
    {
      "score": 0.87,
      "content": "class JWTValidator:\n    def validate(self, token: str) -> Claims:...",
      "metadata": {
        "path": "src/auth/jwt.py",
        "line_start": 5,
        "line_end": 22
      }
    }
  ],
  "total": 2
}
What's next? Connect your IDE via MCP Integration, explore the full REST API Reference, or drop in the Python SDK for a batteries-included client.
ONI Cortex API v0.1.0 -- https://cortex.oni.bot