Dashboard →

Antonlytics API Documentation

Complete API reference for building AI agents with persistent memory. Simple REST API with natural language ingestion and querying.

Base URL:https://api.antonlytics.com/api/v1

Quick Start

1. Get Your API Key

Sign up at antonlytics.com and create an API key from your dashboard.

Create API Key

2. Make Your First Request

curl -X POST https://api.antonlytics.com/api/v1/memory/extract/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Customer Alice from TechCorp bought Enterprise plan",
    "project_id": "YOUR_PROJECT_ID"
  }'

Authentication

API Key Authentication

All API requests require authentication using Bearer tokens. Include your API key in the Authorization header:

Authorization: Bearer anto_live_xxxxxxxxxxxxxxxx

Security: Never expose your API key in client-side code. Always make API calls from your backend.

Example Request

cURL

curl https://api.antonlytics.com/api/v1/graph/projects/ \
  -H "Authorization: Bearer YOUR_API_KEY"

Python

import requests

headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.get(
    "https://api.antonlytics.com/api/v1/graph/projects/",
    headers=headers
)

print(response.json())

JavaScript

const response = await fetch(
  'https://api.antonlytics.com/api/v1/graph/projects/',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  }
);

const data = await response.json();
console.log(data);

Memory API

Natural language API for giving your AI agent persistent memory. No complex entity creation - just plain English.

Extract & Store

Ingest natural language text and automatically extract entities and relationships.

POST
/api/v1/memory/extract/

Request Body

{
  "text": "Had a call with Sarah Johnson from TechCorp. She's the VP of Engineering and is interested in our Enterprise plan for 50 users. Follow up next Tuesday.",
  "project_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response (200 OK)

{
  "extracted": {
    "entities": [
      {
        "name": "Sarah Johnson",
        "type": "Person",
        "properties": {
          "title": "VP of Engineering"
        }
      },
      {
        "name": "TechCorp",
        "type": "Company"
      },
      {
        "name": "Enterprise plan",
        "type": "Product"
      }
    ],
    "relationships": [
      {
        "from": "Sarah Johnson",
        "to": "TechCorp",
        "type": "WORKS_AT",
        "properties": {}
      },
      {
        "from": "Sarah Johnson",
        "to": "Enterprise plan",
        "type": "INTERESTED_IN",
        "properties": {
          "users": 50
        }
      }
    ]
  },
  "created": {
    "entities": 3,
    "relationships": 2
  }
}

Example

curl -X POST https://api.antonlytics.com/api/v1/memory/extract/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Customer Alice bought Laptop Pro for $999",
    "project_id": "YOUR_PROJECT_ID"
  }'

Chat with Memory

Chat with your agent using our AI model + your system prompt + full memory context.

POST
/api/v1/memory/chat/

Request Body

{
  "message": "Who should I follow up with this week?",
  "project_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response (200 OK)

{
  "response": "You should follow up with Sarah Johnson from TechCorp. She expressed strong interest in the Enterprise plan for 50 users and you mentioned following up next Tuesday.",
  "relevant_entities": [
    {
      "id": "ent_123",
      "name": "Sarah Johnson",
      "type": "Person",
      "properties": {
        "title": "VP of Engineering",
        "company": "TechCorp"
      }
    }
  ]
}

Example

curl -X POST https://api.antonlytics.com/api/v1/memory/chat/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Who bought laptops?",
    "project_id": "YOUR_PROJECT_ID"
  }'

Query Memory

Get structured memory context for your own AI model. Returns relevant entities and relationships.

POST
/api/v1/memory/query/

Request Body

{
  "question": "laptop purchases",
  "project_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response (200 OK)

{
  "graph_context": {
    "entities": [
      {
        "id": "ent_123",
        "name": "Alice",
        "type": "Customer",
        "properties": {"country": "USA"}
      },
      {
        "id": "ent_124",
        "name": "Laptop Pro",
        "type": "Product",
        "properties": {"price": 999}
      }
    ],
    "relationships": [
      {
        "from": "ent_123",
        "to": "ent_124",
        "type": "PURCHASED",
        "properties": {"date": "2024-01-15"}
      }
    ]
  }
}

System Prompt

Get or update the system prompt that defines your agent's behavior.

GETPATCH
/api/v1/memory/system-prompt/<project_id>//

GET - Retrieve System Prompt

curl https://api.antonlytics.com/api/v1/memory/system-prompt/YOUR_PROJECT_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY"

PATCH - Update System Prompt

curl -X PATCH https://api.antonlytics.com/api/v1/memory/system-prompt/YOUR_PROJECT_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "system_prompt": "You are a helpful sales assistant. Focus on follow-ups and next steps."
  }'

Templates

Get pre-built templates for common use cases (CRM, Support, Legal).

GET
/api/v1/memory/templates/
curl https://api.antonlytics.com/api/v1/memory/templates/ \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "templates": [
    {
      "id": "crm",
      "name": "Sales CRM",
      "description": "Track customers, deals, and interactions",
      "system_prompt": "You are a sales assistant...",
      "ontology": {
        "entities": ["Customer", "Company", "Deal"],
        "relationships": ["WORKS_AT", "INTERESTED_IN"]
      }
    }
  ]
}

Projects API

Manage your projects (agents). Each project has its own memory graph and system prompt.

List Projects

Get all projects for your account.

GET
/api/v1/graph/projects/
curl https://api.antonlytics.com/api/v1/graph/projects/ \
  -H "Authorization: Bearer YOUR_API_KEY"

Create Project

Create a new project (agent).

POST
/api/v1/graph/projects/
curl -X POST https://api.antonlytics.com/api/v1/graph/projects/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Sales Agent",
    "description": "Tracks customer interactions"
  }'

Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Sales Agent",
  "description": "Tracks customer interactions",
  "created_at": "2024-01-15T10:30:00Z"
}

Get Project Stats

Get statistics for a project (entity count, relationship count, etc.).

GET
/api/v1/graph/projects/<project_id>/stats/
curl https://api.antonlytics.com/api/v1/graph/projects/YOUR_PROJECT_ID/stats/ \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Handling

Error Response Format

All errors return a JSON object with an error message and appropriate HTTP status code.

{
  "error": "Invalid API key",
  "detail": "The provided API key is not valid or has been revoked"
}

HTTP Status Codes

200
OK
Request successful
201
Created
Resource created successfully
400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing API key
403
Forbidden
Not authorized to access this resource
404
Not Found
Resource not found
429
Too Many Requests
Rate limit exceeded
500
Server Error
Something went wrong on our end

Rate Limits

100
Requests per minute
10,000
Requests per day
Header
X-RateLimit-Remaining

Rate Limit Headers: Check the X-RateLimit-Remaining and X-RateLimit-Reset headers in responses.

Official SDKs

Python SDK

pip install antonlytics
View Python Docs

JavaScript SDK

npm install antonlytics
View JavaScript Docs

Need Help?

Have questions about the API? Contact our developer support team or join our community.