Agent Integration

Set up perstudio with OpenClaw, custom Claude agents, or any LLM-powered tool.

OpenClaw Setup

The fastest way to give your agent image and video generation. Three commands and you're done.

1. Install the skill

Install perstudio from ClawHub:

Terminal
clawhub install perstudio

2. Configure your API key

Set your perstudio API key so the agent can authenticate:

Terminal
openclaw config set skills.perstudio.apiKey "ps_live_your_key_here"
Warning
Get your API key from the dashboard. It's shown once at creation — store it securely.

3. Agent discovers capabilities

Your agent auto-discovers perstudio's capabilities via the GET /agent/onboard endpoint. This returns a self-service payload optimized for LLMs — the agent learns what workflows are available and how to pick the right one.

Terminal
# You can inspect the onboard payload yourself:
curl https://api.perstudio.dev/agent/onboard \
  -H "X-API-Key: ps_live_your_key_here"

4. Generate images

When a user asks for an image, the agent calls perstudio with a natural language intent. perstudio's intent router picks the right workflow automatically.

Agent tool call
{
  "tool": "perstudio_generate",
  "parameters": {
    "intent": "Create a professional product photo of the user's sneakers on a clean white background with dramatic side lighting"
  }
}
Tip
Let the agent compose the intent from the user's conversation context. perstudio's intent router handles the translation to specific workflow parameters — the agent doesn't need to know ComfyUI details.

Custom Claude Agent

If you're building your own Claude-based agent with the Anthropic API, expose perstudio as a tool:

Python — Claude tool definition
tools = [{
    "name": "generate_image",
    "description": "Generate images using AI. Send a natural language description and get production-quality images. Supports product photography, portraits, style transfer, ControlNet, upscaling, video, and more.",
    "input_schema": {
        "type": "object",
        "properties": {
            "intent": {
                "type": "string",
                "description": "Detailed description of the image to generate"
            }
        },
        "required": ["intent"]
    }
}]
Python — Handle tool use
import requests

def handle_generate_image(intent: str) -> dict:
    response = requests.post(
        "https://api.perstudio.dev/generate",
        headers={"X-API-Key": "ps_live_your_key_here"},
        json={"intent": intent}
    )
    return response.json()

MCP Server

perstudio also works as a Model Context Protocol server, so Claude Desktop and other MCP-compatible clients can use it natively. See the API reference for details on the MCP tool schema.