Docs

AI agents API — full reference

Reference for the Plugsky AI agents API. Run autonomous agents that plan steps, call your tools, and return structured results. Memory, function calling, and observability built in.

Run an agent

POST https://api.plugsky.com/v1/agents/{agent_id}/agent/runs

bash
curl -X POST https://api.plugsky.com/v1/agents/acme-sales/agent/runs \
  -H "Authorization: Bearer $PLUGSKY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Find the Q3 renewal for Acme Corp and draft a follow-up email",
    "tools": ["crm.lookup", "gmail.draft", "calendar.find"],
    "max_steps": 10
  }'

Response

json
{
  "id": "run_abc123",
  "agent_id": "acme-sales",
  "status": "completed",
  "steps": [
    {
      "step": 1,
      "type": "thought",
      "content": "I need to find Acme Corp in the CRM first."
    },
    {
      "step": 2,
      "type": "tool_call",
      "tool": "crm.lookup",
      "input": {"company": "Acme Corp"},
      "output": {"renewal_date": "2026-09-30", "amount": 50000, "status": "pending"}
    },
    {
      "step": 3,
      "type": "thought",
      "content": "Now I have the renewal date. Let me draft a follow-up email."
    },
    {
      "step": 4,
      "type": "tool_call",
      "tool": "gmail.draft",
      "input": {"to": "ceo@acme.com", "subject": "Q3 Renewal", "body": "..."},
      "output": {"draft_id": "draft_xyz"}
    }
  ],
  "output": "I've found the Q3 renewal for Acme Corp and drafted a follow-up email. The renewal is due 2026-09-30 for $50,000. Draft is ready for your review in Gmail."
}

Streaming

Set stream: true to receive agent progress in real time via SSE. Each event includes the step type, content, and any tool call results.

Frequently asked questions

How many steps can an agent take?

Default 10. Configurable per run via max_steps. Max 50 on self-serve, 200 on Enterprise.

Can agents call other agents?

Yes. Agent Cloud supports multi-agent orchestration with named sub-agents and shared memory.

How is memory handled?

Conversation history, tool call logs, and structured memory are namespaced per agent. Vector memory backed by RAG API is supported.

Can I pause an agent for human review?

Yes. Set requires_approval: true on any tool, and the run pauses for human approval before sensitive tool calls.

Try the agents API

Tools, function calling, memory, and orchestration in one OpenAI-compatible API.

Start $5 trial → See features