Skip to main content

Step 1: Create an API key

Go to your Aigmented Dashboard → Settings → API Keys → Create New Key. Copy the key — it starts with sk- and is shown only once.
You need Moderator role or above to create and use API keys. Users with the basic User role cannot access the API.

Step 2: List your collections

curl https://aigmented.io/api/v1/collections/list \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
You’ll get a list of your knowledge collections with their IDs:
{
  "message": "List of collections",
  "data": [
    {
      "id": 49,
      "name": "Product Documentation",
      "status": "processed",
      "_count": { "knowledgeCards": 1248 }
    }
  ]
}

Step 3: Ask a question

Use the collection ID to ask a question:
curl -X POST https://aigmented.io/api/v1/collections/49/ask \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What are the main features?",
    "mode": "fast"
  }'
Response:
{
  "answer": "The main features include...",
  "sources": [
    { "card_id": "abc123", "title": "Product Overview", "score": 0.95 }
  ],
  "model": "google/gemini-3-flash-preview",
  "tokens_used": { "llm_prompt": 621, "llm_completion": 84 }
}

Next steps

Authentication

Learn about API keys, roles, and token limits.

Search & Ask

Explore search filters, streaming, and multi-turn conversations.