DEVELOPER
BASE URLhttps://api.ontoic.com

Ontoic API

Programmatic access to your knowledge graph. Query, write, and research — all via ak_ keys.

NDJSON streamingSHA-256 key authPer-key permissionsMCP compatible

QUICKSTART

Get your first API call working in under two minutes.

01

Create a personal API key

Go to the Keys section below, create a personal key with at least Read enabled. Copy it — it won't be shown again.

02

Make your first query

Pass the key as a Bearer token. This queries your knowledge graph and returns a streamed answer.

bash
curl -X POST https://api.ontoic.com/cmd \
  -H "Authorization: Bearer ak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "what do I know about machine learning?"}'
03

Parse the response

The /cmd endpoint streams NDJSON. Each line is a JSON object with a type field.

json
{"type":"sources","referenced_nodes":[...],"session_id":"abc123"}
{"type":"token","token":"Based on your graph, "}
{"type":"token","token":"machine learning appears in..."}
{"type":"done","answer":"...","gaps":[...],"session_id":"abc123"}

API KEYS

Keys authenticate external programs against your graph. All keys are prefixed ak_ and use SHA-256 hashing — the plaintext is shown exactly once.

Personal keys act as you. Use these for scripts, local tools, or MCP clients accessing your own graph. Grant only the permissions you need.
Loading…

ENDPOINT REFERENCE

All endpoints require a Bearer token. The permission column shows the minimum required for personal keys — agent keys always have full access.

CODE EXAMPLES

Copy-paste examples for the most common operations. Replace ak_YOUR_KEY with a key from the Keys section.

Query your graph

bash
curl -X POST https://api.ontoic.com/cmd \
  -H "Authorization: Bearer ak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "summarise what I know about climate change"}'

Search — semantic (contextual)

bash
curl -X POST "https://api.ontoic.com/search?contextual=true" \
  -H "Authorization: Bearer ak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "attention mechanisms and long-range dependencies"}'

Search — keyword match

bash
curl -X POST "https://api.ontoic.com/search?contextual=false" \
  -H "Authorization: Bearer ak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "transformer"}'

Ingest content (analyse mode)

bash
curl -X POST https://api.ontoic.com/cmd/create \
  -H "Authorization: Bearer ak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "analyse",
    "content": "Retrieval-augmented generation grounds LLM outputs in retrieved documents, reducing hallucination.",
    "url": "https://example.com/rag-paper"
  }'

USAGE

Key activity across your personal and agent keys.

Loading…

TROUBLESHOOTING

Common errors and how to resolve them.