Ontoic API
Programmatic access to your knowledge graph. Query, write, and research — all via ak_ keys.
QUICKSTART
Get your first API call working in under two minutes.
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.
Make your first query
Pass the key as a Bearer token. This queries your knowledge graph and returns a streamed answer.
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?"}'Parse the response
The /cmd endpoint streams NDJSON. Each line is a JSON object with a type field.
{"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.
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
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)
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
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)
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.
TROUBLESHOOTING
Common errors and how to resolve them.