Quick Start

Get up and running with Aphelion in under 5 minutes.

Step 1: Create an Account

Sign up at console.aphl.ai

Step 2: Get Your API Key

After signing up, you'll receive an API key:

ap_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
⚠️Keep your API key secure
Save this key securely. You won't see it again. Never commit it to version control.

Step 3: Install the SDK

Python
pip install aphelion
Node.js
npm install aphelion

Step 4: Execute Your First Tool

Python
from aphelion import Aphelion

client = Aphelion(
    api_key="ap_live_...",
    agent="my-first-agent"
)

# Execute a tool
result = client.execute(
    "stripe.customers.create",
    {
        "email": "jane@example.com",
        "name": "Jane Doe"
    }
)

print(result)
# {"id": "cus_abc123", "email": "jane@example.com", ...}
Node.js
import { Aphelion } from 'aphelion';

const client = new Aphelion({
  apiKey: 'ap_live_...',
  agent: 'my-first-agent'
});

const result = await client.execute(
  'stripe.customers.create',
  {
    email: 'jane@example.com',
    name: 'Jane Doe'
  }
);

console.log(result);

Step 5: Check the Console

Open console.aphl.ai to see:

  • Your agent was created automatically
  • The execution was logged
  • Memory was stored

That's it. You've executed your first tool with Aphelion.

Environment Setup

We recommend storing your API key in environment variables:

.env
APHELION_API_KEY=ap_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Python
import os
from dotenv import load_dotenv
from aphelion import Aphelion

load_dotenv()

client = Aphelion(
    api_key=os.getenv("APHELION_API_KEY"),
    agent="my-agent"
)
Node.js
import 'dotenv/config';
import { Aphelion } from 'aphelion';

const client = new Aphelion({
  apiKey: process.env.APHELION_API_KEY,
  agent: 'my-agent'
});

API Key Types

Key TypePrefixUse Case
Liveap_live_Production
Testap_test_Development (sandbox mode)

Test keys execute against sandbox/test versions of tools where available.

Using the REST API Directly

If you prefer to use the REST API directly:

Execute a Tool

POST/v1/execute
curl -X POST https://api.aphl.ai/v1/execute \
  -H "Authorization: Bearer ap_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "stripe.customers.create",
    "params": {
      "email": "jane@example.com",
      "name": "Jane Doe"
    },
    "agent": "my-agent"
  }'

Response

{
  "data": {
    "id": "cus_abc123",
    "object": "customer",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "created": 1704326400
  },
  "meta": {
    "request_id": "req_xyz789",
    "execution_id": "exec_def456",
    "latency_ms": 142,
    "memory_id": "mem_ghi789"
  }
}

Working with Memory

Every execution is automatically summarized and stored. Search across your agent's memory:

Python
# Search agent memory
memories = client.memory.search(
    query="customer jane",
    limit=10
)

for memory in memories:
    print(f"{memory.summary} - {memory.created_at}")

Complete Example

A customer support bot that remembers past interactions:

support_bot.py
from aphelion import Aphelion

client = Aphelion(
    api_key="ap_live_...",
    agent="support-bot"
)

def handle_inquiry(user_message: str, user_email: str):
    # Check if customer exists in memory
    memories = client.memory.search(f"customer {user_email}")

    if memories:
        customer_id = memories[0].result_preview.get("id")
    else:
        # Create customer in Stripe
        customer = client.execute("stripe.customers.create", {
            "email": user_email
        })
        customer_id = customer["id"]

    # Create support ticket in Jira
    ticket = client.execute("jira.issues.create", {
        "project": "SUP",
        "summary": f"Support request from {user_email}",
        "description": user_message,
        "issuetype": {"name": "Support"}
    })

    # Send confirmation via Slack
    client.execute("slack.messages.post", {
        "channel": "#support",
        "text": f"New ticket {ticket['key']} from {user_email}"
    })

    return ticket["key"]

Next Steps