API Reference
The Prometheux platform provides multiple ways to interact with all platform features programmatically:
- Python SDK (
prometheux_chain): A high-level Python library for seamless integration - REST API: Direct HTTP endpoints for maximum flexibility and language-agnostic access
- MCP Integration (
prometheux-mcp): Connect AI agents like Claude to your knowledge graphs via Model Context Protocol
All interfaces provide equivalent functionality—choose the one that best fits your workflow.
Quick Start
- Python SDK
- MCP (AI Agents)
- REST API
Installation
pip install --upgrade prometheux_chain
Configuration
import prometheux_chain as px
import os
# Set your authentication token
os.environ['PMTX_TOKEN'] = 'YOUR_PMTX_TOKEN'
# Configure the backend URL
px.config.set('JARVISPY_URL', "https://api.prometheux.ai/jarvispy/{organization}/{username}")
First API Call
# Create a new project
project_id = px.save_project(project_name="my_first_project")
print(f"Created project: {project_id}")
Install into Jupyter
To manually install the library in your Jupyter Lab or Jupyter Notebook follow these steps:
-
Create a new notebook with kernel Python and run the following commands in a dedicated cell
-
Clone the repo
!git clone https://github.com/prometheuxresearch/prometheux_chain.git -
Navigate into the project and install it
!cd prometheux_chain && pip install -e . -
Copy the project into site-packages to allow importing and using it
!cd prometheux_chain && cp -r prometheux_chain /opt/app-root/lib/python3.x/site-packages -
Restart the kernel
To update an existing installation of Prometheux Chain follow these steps:
-
Uninstall the project
!pip uninstall prometheux_chain -y -
Clone the repo if it is not present
!git clone https://github.com/prometheuxresearch/prometheux_chain.gitelse update it to the latest changes
!cd prometheux_chain && git pull -
Navigate into the project and install it
!cd prometheux_chain && pip install -e . -
Remove an existing installation if present
!rm -r /opt/app-root/lib/python3.x/site-packages/prometheux_chain -
Copy the project into site-packages to allow importing and using it
!cd prometheux_chain && cp -r prometheux_chain /opt/app-root/lib/python3.x/site-packages -
Restart the kernel
Installation
pipx install prometheux-mcp
Configuration
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"prometheux": {
"command": "/Users/YOUR_USERNAME/.local/bin/prometheux-mcp",
"args": ["--url", "https://api.prometheux.ai"],
"env": {
"PROMETHEUX_TOKEN": "your_token",
"PROMETHEUX_USERNAME": "your_username",
"PROMETHEUX_ORGANIZATION": "your_org"
}
}
}
}
Tip: Run
which prometheux-mcpto find the exact path on your system.
First Interaction
Restart Claude Desktop and ask:
"What concepts are available in my project-name project?"
See the full MCP documentation for detailed setup and usage.
Base URL
All API endpoints are relative to your Prometheux platform instance:
https://api.prometheux.ai/jarvispy/{organization}/{username}/api/v1/
Where:
{organization}is your organization identifier{username}is your username
Authentication
All API requests require authentication using a Bearer token:
Authorization: Bearer YOUR_JWT_TOKEN
First API Call
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/save" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"project": {
"name": "my_first_project"
}
}'
Response Format
All REST API responses follow a consistent format:
{
"data": {}, // Response data (varies by endpoint)
"message": "string", // Human-readable message
"status": "success" // Status: "success" or "error"
}
The Python SDK automatically handles responses and returns the relevant data directly.
API Categories
The API is organized into the following categories:
| Category | Description |
|---|---|
| Config | SDK configuration and LLM setup |
| Data | Data connection and management |
| Projects | Project management |
| Concepts | Concept execution and management |
| Vadalog | Vadalog program evaluation |
| Rule Inference | Schema inference from data sources |
| Applications | Advanced applications like Graph RAG |
Error Handling
- Python SDK
- REST API
The SDK raises exceptions for errors:
import prometheux_chain as px
try:
result = px.run_concept(project_id="invalid_id", concept_name="test")
except Exception as e:
print(f"Error: {e}")
The REST API uses standard HTTP status codes:
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request (invalid parameters) |
401 | Unauthorized (invalid or missing token) |
500 | Internal Server Error |
Error responses include detailed messages in the response body:
{
"data": null,
"message": "Project not found",
"status": "error"
}
Requirements
Python SDK
- Python 3.9 or higher
- Install via pip:
pip install prometheux_chain
REST API
- Any HTTP client (curl, Postman, programming language HTTP libraries)
- Valid JWT authentication token