Quick Start

Get up and running with ServoAgent in under 5 minutes.

Prerequisites

  • A ServoAgent account
  • An API key (create one in your dashboard)
  • Python 3.8+, Node.js 18+, or Go 1.21+

1Install the SDK

pip install servoagent

2Set up authentication

Get your API key from the dashboard and set it as an environment variable:

export SERVOAGENT_API_KEY=sk_your_api_key

3Initialize the client

from servoagent import ServoAgentClient
import os

# Initialize with API key from environment
client = ServoAgentClient(
    api_key=os.environ.get("SERVOAGENT_API_KEY")
)

4List your agents

# List all agents in your workspace
agents = client.agents.list()

for agent in agents.data:
    print(f"Agent: {agent.name} ({agent.status})")

Output:

Agent: Customer Support (active) Agent: Sales Assistant (active)

5Execute an agent

# Execute an agent with input
result = client.agents.execute(
    agent_id="agent_xxx",
    input={
        "message": "What is your return policy?"
    }
)

print(f"Status: {result.status}")
print(f"Response: {result.output['response']}")
print(f"Cost: $" + "{result.cost:.4f}")

Output:

Status: completed
Response: Our return policy allows returns within 30 days...
Cost: $0.0012