An AI agent is an LLM that decides which tools to call, in what order, with what arguments, until the user's goal is met. Plugsky's agent API gives you the four primitives every production agent needs: tools, function calling, memory, and a planning loop.
What is the AI agents API?
Plugsky exposes agent capabilities through three layers:
- Function calling on every chat model — same shape as OpenAI
toolsarray. - Agent runs endpoint — POST a goal + tools, get back a full run with steps, tool calls, and final output.
- Agent Cloud — hosted agents with memory, schedule, webhooks, and observability built in.
Tools and function calling
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"}
},
"required": ["city"]
}
}
}
]
resp = client.chat.completions.create(
model="plugsky-pro",
messages=[{"role":"user","content":"What's the weather in Dubai?"}],
tools=tools,
)
if resp.choices[0].message.tool_calls:
call = resp.choices[0].message.tool_calls[0]
print(call.function.name, call.function.arguments)
Plugsky's tools array matches the OpenAI shape exactly, so any OpenAI-compatible agent framework (LangChain, LlamaIndex, Vercel AI SDK, smolagents) works out of the box.
Memory and context
Plugsky Agent Cloud persists:
- Conversation history per agent / per user
- Tool call logs with full request / response payloads for replay
- Vector memory — long-term recall backed by Plugsky's RAG API
- Structured memory — typed key-value store for agent state
Memory is namespaced per workspace and per agent, with row-level encryption at rest.
Agent orchestration
For agents that need a planning loop, retry logic, or multi-step reasoning, use the Agent Runs endpoint:
curl -X POST https://api.plugsky.com/v1/agents/acme-sales/agent/runs \
-H "Authorization: Bearer sk-live-..." \
-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
}'
You get back a full run with each step's reasoning, tool call, and result — perfect for debugging and audit.
Production agent patterns
- Tool-use agents: search, retrieval, code execution, file ops
- Multi-agent: orchestrator + specialist sub-agents
- Human-in-the-loop: pause for approval before sensitive tool calls
- Scheduled: cron-triggered agents that produce a daily report
- Webhook-triggered: agents that respond to GitHub, Stripe, or HubSpot events
Frequently asked questions
Does Plugsky agent runs support streaming?
Yes. Set stream: true and you get SSE events as the agent progresses through steps.
Can I use LangChain or LlamaIndex with Plugsky?
Yes. Both speak the OpenAI function-calling shape, so they work with Plugsky via a base_url change.
How do I debug a bad agent run?
Each run is fully logged — every step's reasoning, tool call, and response is replayable from the dashboard.
Can agents call other agents?
Yes. Agent Cloud supports multi-agent orchestration with named sub-agents and shared memory.
Build an agent on Plugsky
Tools, function calling, memory, and orchestration — in one OpenAI-compatible API.
Start $5 trial → Open the agent builder