Skip to main content

The Agent Object

An agent represents an AI identity with spending policies and wallets.

Attributes

agent_id
string
required
Unique identifier for the agent
name
string
required
Agent display name
description
string
Optional description of the agent’s purpose
owner_id
string
required
Organization ID that owns this agent
wallet_id
string
Associated wallet ID (if wallet created)
spending_limits
object
required
Spending limits for this agent
policy
object
required
Spending policy rules
kya_level
string
KYA (Know Your Agent) level: none, basic, verified, attested
kya_status
string
KYA status: pending, active, suspended
is_active
boolean
Whether the agent is active
metadata
object
Custom metadata key-value pairs
created_at
string
ISO 8601 timestamp of agent creation
updated_at
string
ISO 8601 timestamp of last update

Create Agent

curl -X POST https://api.sardis.sh/api/v2/agents \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "shopping-agent",
    "description": "Handles e-commerce purchases",
    "spending_limits": {
      "per_transaction": "500.00",
      "daily": "2000.00",
      "monthly": "20000.00"
    },
    "policy": {
      "blocked_categories": ["gambling", "adult_content"],
      "auto_approve_below": "100.00"
    },
    "create_wallet": true
  }'

Request Body

name
string
required
Agent name
description
string
Agent description
spending_limits
object
Spending limits (defaults applied if omitted)
policy
object
Spending policy rules
create_wallet
boolean
default:"true"
Whether to automatically create a wallet
metadata
object
Custom metadata

Response

{
  "agent_id": "agent_abc123def456",
  "name": "shopping-agent",
  "description": "Handles e-commerce purchases",
  "owner_id": "org_xyz789",
  "wallet_id": "wallet_ghi789jkl012",
  "spending_limits": {
    "per_transaction": "500.00",
    "daily": "2000.00",
    "monthly": "20000.00",
    "total": "100000.00"
  },
  "policy": {
    "allowed_merchants": null,
    "blocked_merchants": [],
    "allowed_categories": null,
    "blocked_categories": ["gambling", "adult_content"],
    "require_approval_above": null,
    "auto_approve_below": "100.00"
  },
  "kya_level": "basic",
  "kya_status": "active",
  "is_active": true,
  "metadata": {
    "framework": "langchain",
    "version": "0.1.0"
  },
  "created_at": "2025-03-03T10:00:00Z",
  "updated_at": "2025-03-03T10:00:00Z"
}

List Agents

curl https://api.sardis.sh/api/v2/agents?limit=10&offset=0 \
  -H "Authorization: Bearer sk_live_your_api_key"

Query Parameters

limit
integer
default:"50"
Number of agents to return (max: 100)
offset
integer
default:"0"
Number of agents to skip
is_active
boolean
Filter by active status

Response

[
  {
    "agent_id": "agent_abc123",
    "name": "shopping-agent",
    "description": "Handles e-commerce purchases",
    "owner_id": "org_xyz789",
    "wallet_id": "wallet_ghi789",
    "spending_limits": {...},
    "policy": {...},
    "kya_level": "basic",
    "kya_status": "active",
    "is_active": true,
    "metadata": {},
    "created_at": "2025-03-03T10:00:00Z",
    "updated_at": "2025-03-03T10:00:00Z"
  }
]

Get Agent

curl https://api.sardis.sh/api/v2/agents/agent_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"

Path Parameters

agent_id
string
required
Agent ID to retrieve

Update Agent

curl -X PATCH https://api.sardis.sh/api/v2/agents/agent_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "spending_limits": {
      "daily": "3000.00"
    },
    "policy": {
      "auto_approve_below": "200.00"
    }
  }'

Request Body

All fields are optional. Only provided fields will be updated.
name
string
New agent name
description
string
New description
spending_limits
object
Updated spending limits
policy
object
Updated policy
is_active
boolean
Active status

Delete Agent

Deleting an agent is permanent and cannot be undone. Associated wallets are not deleted.
curl -X DELETE https://api.sardis.sh/api/v2/agents/agent_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"

Get Agent Limits

Retrieve current spending limits and usage.
curl https://api.sardis.sh/api/v2/agents/agent_abc123/limits \
  -H "Authorization: Bearer sk_live_your_api_key"

Response

{
  "agent_id": "agent_abc123",
  "spending_limits": {
    "per_transaction": "500.00",
    "daily": "2000.00",
    "monthly": "20000.00",
    "total": "100000.00"
  },
  "wallet": {
    "wallet_id": "wallet_ghi789",
    "addresses": {
      "base": "0x1234..."
    },
    "mpc_provider": "turnkey"
  }
}

KYA (Know Your Agent)

Get KYA Status

curl https://api.sardis.sh/api/v2/agents/agent_abc123/kya \
  -H "Authorization: Bearer sk_live_your_api_key"

Response

{
  "agent_id": "agent_abc123",
  "kya_level": "basic",
  "kya_status": "active",
  "manifest": {
    "capabilities": ["saas_subscription", "api_credits"],
    "max_budget_per_tx": "500.00",
    "daily_budget": "2000.00",
    "framework": "langchain"
  },
  "trust_score": 0.85
}

Upgrade KYA Level

curl -X POST https://api.sardis.sh/api/v2/agents/agent_abc123/kya/upgrade \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "target_level": "verified",
    "anchor_verification_id": "persona_verif_xyz"
  }'
target_level
string
required
Target KYA level: basic, verified, or attested
anchor_verification_id
string
Owner KYC verification ID (required for verified)
code_hash
string
SHA-256 hash of agent code (required for attested)

Common Use Cases

Create Agent with Natural Language Policy

from sardis_sdk import SardisClient

client = SardisClient(api_key="sk_live_your_api_key")

# Parse natural language policy
policy = client.policies.parse(
    natural_language="Allow max $500 per day on AWS and OpenAI, block gambling"
)

# Create agent with parsed policy
agent = client.agents.create(
    name="saas-agent",
    policy=policy.to_dict()
)

Create Multi-Agent System

# Create a group for shared budget
group = client.groups.create(
    name="marketing-team",
    budget={
        "daily": "5000.00",
        "monthly": "50000.00"
    }
)

# Create agents in the group
for agent_name in ["social-media-agent", "ad-buyer-agent", "analytics-agent"]:
    agent = client.agents.create(
        name=agent_name,
        spending_limits={"per_transaction": "500.00"}
    )
    client.groups.add_agent(group.group_id, agent.agent_id)

Build docs developers (and LLMs) love