{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openserv-client",
    "name": "OpenServ Client",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/issa-me-sush/openserv-client",
    "canonicalUrl": "https://clawhub.ai/issa-me-sush/openserv-client",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openserv-client",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openserv-client",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "reference.md",
      "troubleshooting.md",
      "SKILL.md",
      "examples/agent.ts",
      "examples/env.example.txt",
      "examples/cleanup.ts"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openserv-client"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openserv-client",
    "agentPageUrl": "https://openagent3.xyz/skills/openserv-client/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openserv-client/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openserv-client/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenServ Client",
        "body": "The @openserv-labs/client package is the TypeScript client for the OpenServ Platform API. You use it whenever your code needs to talk to the platform—to register an agent, create workflows, set up triggers, or run tasks."
      },
      {
        "title": "Why you need this package",
        "body": "Your agent (built with @openserv-labs/sdk) runs on your machine or server. The platform doesn’t know about it until you tell it: what the agent is, where it’s reachable, and how it can be triggered. The client is how you do that. It lets you create a platform account (or reuse one), register your agent, define workflows and triggers (webhook, cron, manual, or x402 paid), and bind credentials so your agent can accept tasks. Without it, your agent would have no way to get onto the platform or receive work."
      },
      {
        "title": "What you can do with it",
        "body": "Provision — One-shot setup: create or reuse an account (via wallet), register the agent, create a workflow with trigger and task, and get API key and auth token. Typically you call provision() once per app startup; it’s idempotent.\nPlatform API — Full control via PlatformClient: create and list agents, workflows, triggers, and tasks; fire triggers; run workflows; manage credentials. Use this when you need more than the default provision flow.\nModel Parameters — Configure which LLM model and parameters the platform uses for your agent's tasks. Set model_parameters on agent creation/update or via provision().\nModels API — Discover available LLM models and their parameter schemas via client.models.list().\nx402 payments — Expose your agent behind a paywall; callers pay per request (e.g. USDC) before the task runs. Provision can set up an x402 trigger and return a paywall URL.\nERC-8004 on-chain identity — Register your agent on-chain (Base), mint an identity NFT, and publish service metadata to IPFS so others can discover and pay your agent in a standard way.\n\nReference: reference.md (full API) · troubleshooting.md (common issues) · examples/ (runnable code)"
      },
      {
        "title": "Installation",
        "body": "npm install @openserv-labs/client"
      },
      {
        "title": "Quick Start: Just provision() + run()",
        "body": "The simplest deployment is just two calls: provision() and run(). That's it.\n\nYou need an account on the platform to register agents and workflows. The easiest way is to let provision() create one for you: it creates a wallet and signs you up with it (no email required). That account is reused on every run.\n\nSee examples/agent.ts for a complete runnable example.\n\nKey Point: provision() is idempotent. Call it every time your app starts - no need to check isProvisioned() first."
      },
      {
        "title": "What provision() Does",
        "body": "Creates or reuses an Ethereum wallet (and platform account if new)\nAuthenticates with the OpenServ platform\nCreates or updates the agent (idempotent)\nGenerates API key and auth token\nBinds credentials to agent instance (if agent.instance is provided)\nCreates or updates the workflow with trigger and task\nCreates workflow graph (edges linking trigger to task)\nActivates trigger and sets workflow to running\nPersists state to .openserv.json"
      },
      {
        "title": "Workflow Name & Goal",
        "body": "The workflow config requires two important properties:\n\nname (string) - This becomes the agent name in ERC-8004. Make it polished, punchy, and memorable — this is the public-facing brand name users see. Think product launch, not variable name. Examples: 'Viral Content Engine', 'Crypto Alpha Scanner', 'Life Catalyst Pro'.\ngoal (string, required) - A detailed description of what the workflow accomplishes. Must be descriptive and thorough — short or vague goals will cause API calls to fail. Write at least a full sentence explaining the workflow's purpose.\n\nworkflow: {\n  name: 'Deep Research Pro',\n  goal: 'Research any topic in depth, synthesize findings from multiple sources, and produce a comprehensive report with citations',\n  trigger: triggers.webhook({ waitForCompletion: true, timeout: 600 }),\n  task: { description: 'Research the given topic' }\n}"
      },
      {
        "title": "Agent Instance Binding (v1.1+)",
        "body": "Pass your agent instance to provision() for automatic credential binding:\n\nconst agent = new Agent({ systemPrompt: '...' })\n\nawait provision({\n  agent: {\n    instance: agent, // Calls agent.setCredentials() automatically\n    name: 'my-agent',\n    description: '...',\n    model_parameters: { model: 'gpt-5', verbosity: 'medium', reasoning_effort: 'high' } // Optional\n  },\n  workflow: { ... }\n})\n\n// agent now has apiKey and authToken set - ready for run()\nawait run(agent)\n\nThis eliminates the need to manually set OPENSERV_API_KEY environment variables."
      },
      {
        "title": "Model Parameters",
        "body": "The optional model_parameters field controls which LLM model and parameters the platform uses when executing tasks for your agent (including runless capabilities and generate() calls). If not provided, the platform default is used.\n\nawait provision({\n  agent: {\n    instance: agent,\n    name: 'my-agent',\n    description: '...',\n    model_parameters: {\n      model: 'gpt-4o',\n      temperature: 0.5,\n      parallel_tool_calls: false\n    }\n  },\n  workflow: { ... }\n})\n\nDiscover available models and their parameters:\n\nconst { models, default: defaultModel } = await client.models.list()\n// models: [{ model: 'gpt-5', provider: 'openai', parameters: { ... } }, ...]\n// default: 'gpt-5-mini'"
      },
      {
        "title": "Provision Result",
        "body": "interface ProvisionResult {\n  agentId: number\n  apiKey: string\n  authToken?: string\n  workflowId: number\n  triggerId: string\n  triggerToken: string\n  paywallUrl?: string // For x402 triggers\n  apiEndpoint?: string // For webhook triggers\n}"
      },
      {
        "title": "API Keys: Agent vs User",
        "body": "provision() creates two types of credentials. They are not interchangeable:\n\nCredentialEnv VariableUsed ByPurposeAgent API keyOPENSERV_API_KEYSDK internalsAuthenticates the agent when receiving tasks from the platform. Set automatically via agent.instance. Do not use with PlatformClient.Wallet keyWALLET_PRIVATE_KEYPlatformClientAuthenticates your account for management calls (list tasks, debug workflows, manage agents).User API keyOPENSERV_USER_API_KEYPlatformClientAlternative to wallet auth. Get from the platform dashboard.\n\nIf you get a 401 Unauthorized when using PlatformClient, you are likely using the agent API key by mistake. Use wallet authentication or the user API key instead."
      },
      {
        "title": "PlatformClient: Full API Access",
        "body": "For advanced use cases, use PlatformClient directly:\n\nimport { PlatformClient } from '@openserv-labs/client'\n\n// Using wallet authentication (recommended — uses wallet from provision)\nconst client = new PlatformClient()\nawait client.authenticate(process.env.WALLET_PRIVATE_KEY)\n\n// Or using User API key (NOT the agent API key)\nconst client = new PlatformClient({\n  apiKey: process.env.OPENSERV_USER_API_KEY // NOT OPENSERV_API_KEY\n})\n\nSee reference.md for full API documentation on:\n\nclient.agents.* - Agent management\nclient.workflows.* - Workflow management\nclient.triggers.* - Trigger management\nclient.tasks.* - Task management\nclient.models.* - Available LLM models and parameters\nclient.integrations.* - Integration connections\nclient.payments.* - x402 payments\nclient.web3.* - Credits top-up"
      },
      {
        "title": "Triggers Factory",
        "body": "Use the triggers factory for type-safe trigger configuration:\n\nimport { triggers } from '@openserv-labs/client'\n\n// Webhook (free, public endpoint)\ntriggers.webhook({\n  input: { query: { type: 'string', description: 'Search query' } },\n  waitForCompletion: true,\n  timeout: 600\n})\n\n// x402 (paid API with paywall)\ntriggers.x402({\n  name: 'AI Research Assistant',\n  description: 'Get comprehensive research reports on any topic',\n  price: '0.01',\n  timeout: 600,\n  input: {\n    prompt: {\n      type: 'string',\n      title: 'Your Request',\n      description: 'Describe what you would like the agent to do'\n    }\n  }\n})\n\n// Cron (scheduled)\ntriggers.cron({\n  schedule: '0 9 * * *', // Daily at 9 AM\n  timezone: 'America/New_York'\n})\n\n// Manual (platform UI only)\ntriggers.manual()"
      },
      {
        "title": "Timeout",
        "body": "Important: Always set timeout to at least 600 seconds (10 minutes) for webhook and x402 triggers. Agents often take significant time to process requests — especially in multi-agent workflows or when performing research, content generation, or other complex tasks. A low timeout (e.g., 180s) will cause premature failures. When in doubt, err on the side of a longer timeout. For multi-agent pipelines with many sequential steps, consider 900 seconds or more."
      },
      {
        "title": "Input Schema",
        "body": "Define fields for webhook/x402 paywall UI:\n\ntriggers.x402({\n  name: 'Content Writer',\n  description: 'Generate polished content on any topic',\n  price: '0.01',\n  input: {\n    topic: {\n      type: 'string',\n      title: 'Content Topic',\n      description: 'Enter the subject you want covered'\n    },\n    style: {\n      type: 'string',\n      title: 'Writing Style',\n      enum: ['formal', 'casual', 'humorous'],\n      default: 'casual'\n    }\n  }\n})"
      },
      {
        "title": "Cron Expressions",
        "body": "┌───────────── minute (0-59)\n│ ┌───────────── hour (0-23)\n│ │ ┌───────────── day of month (1-31)\n│ │ │ ┌───────────── month (1-12)\n│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)\n* * * * *\n\nCommon: 0 9 * * * (daily 9 AM), */5 * * * * (every 5 min), 0 9 * * 1-5 (weekdays 9 AM)"
      },
      {
        "title": "State Management",
        "body": "import { getProvisionedInfo, clearProvisionedState } from '@openserv-labs/client'\n\n// Get stored IDs and tokens\nconst info = getProvisionedInfo('my-agent', 'My Awesome Workflow')\n\n// Clear state (forces fresh creation)\nclearProvisionedState()"
      },
      {
        "title": "Discover Available Services (No Auth Required)",
        "body": "discoverServices() lists all public x402-enabled workflows. No authentication is needed — you can call it on a bare PlatformClient:\n\nimport { PlatformClient } from '@openserv-labs/client'\n\nconst client = new PlatformClient() // no API key or wallet needed\nconst services = await client.payments.discoverServices()\n\nfor (const service of services) {\n  console.log(`${service.name}: $${service.x402Pricing}`)\n  console.log(`URL: ${service.webhookUrl}`)\n}"
      },
      {
        "title": "Firing Triggers",
        "body": "// By workflow ID (recommended — resolves the URL automatically)\nconst result = await client.triggers.fireWebhook({\n  workflowId: 123,\n  input: { query: 'hello world' }\n})\n\n// Or by direct URL\nconst result = await client.triggers.fireWebhook({\n  triggerUrl: 'https://api.openserv.ai/webhooks/trigger/TOKEN',\n  input: { query: 'hello world' }\n})\n\nx402 (Programmatic)\n\n// By workflow ID (recommended)\nconst result = await client.payments.payWorkflow({\n  workflowId: 123,\n  input: { prompt: 'Hello world' }\n})\n\n// Or by direct URL\nconst result = await client.payments.payWorkflow({\n  triggerUrl: 'https://api.openserv.ai/webhooks/x402/trigger/TOKEN',\n  input: { prompt: 'Hello world' }\n})"
      },
      {
        "title": "Environment Variables",
        "body": "VariableDescriptionRequiredOPENSERV_USER_API_KEYUser API key (from platform)Yes*WALLET_PRIVATE_KEYWallet for SIWE authYes*OPENSERV_API_URLCustom API URLNo\n\n*Either API key or wallet key required"
      },
      {
        "title": "ERC-8004: On-Chain Agent Identity",
        "body": "Register your agent on-chain after provisioning. This mints an NFT on the Identity Registry and publishes your agent's service endpoints to IPFS.\n\nRequires ETH on Base. The wallet created by provision() starts with zero balance. Fund it with a small amount of ETH on Base mainnet before registration. Always wrap in try/catch so failures don't prevent run(agent) from starting.\n\nReload .env after provision(). provision() writes WALLET_PRIVATE_KEY to .env at runtime, but process.env already loaded the empty value at startup. Use dotenv.config({ override: true }) after provision() to pick up the freshly written key. See openserv-agent-sdk skill for the full dotenv pattern.\n\nimport { PlatformClient } from '@openserv-labs/client'\n\n// Reload .env to pick up WALLET_PRIVATE_KEY written by provision()\ndotenv.config({ override: true })\n\ntry {\n  const client = new PlatformClient()\n  await client.authenticate(process.env.WALLET_PRIVATE_KEY)\n\n  const erc8004 = await client.erc8004.registerOnChain({\n    workflowId: result.workflowId,\n    privateKey: process.env.WALLET_PRIVATE_KEY!,\n    name: 'My Agent',\n    description: 'What this agent does'\n  })\n\n  console.log(`Agent ID: ${erc8004.agentId}`) // \"8453:42\"\n  console.log(`Explorer: ${erc8004.blockExplorerUrl}`)\n  console.log(`Scan: ${erc8004.scanUrl}`) // \"https://www.8004scan.io/agents/base/42\"\n} catch (error) {\n  console.warn('ERC-8004 registration skipped:', error instanceof Error ? error.message : error)\n}\n\nFirst run mints a new NFT. Re-runs update the URI — agent ID stays the same.\nDefault chain is Base mainnet (8453). Pass chainId and rpcUrl for other chains.\nNever clear the wallet state unless you intentionally want a new agent ID.\n\nSee reference.md for the full ERC-8004 API (wallet management, chain helpers, troubleshooting)."
      },
      {
        "title": "Cleanup",
        "body": "await client.workflows.delete({ id: workflowId })\nawait client.agents.delete({ id: agentId })\nclearProvisionedState()"
      },
      {
        "title": "Updating This Skill",
        "body": "This skill may be outdated. The OpenServ team ships updates regularly—new features, API changes, and bug fixes won't be reflected here until you update. If something isn't working as expected, or you want to make sure you have the latest information, update the skill before proceeding.\n\n# Check if updates are available\nnpx skills check\n\n# Update all installed skills to latest versions\nnpx skills update\n\nOr reinstall the OpenServ skills directly:\n\nnpx skills add openserv-labs/skills"
      },
      {
        "title": "Related Skills",
        "body": "openserv-agent-sdk - Building agents with capabilities\nopenserv-multi-agent-workflows - Multi-agent collaboration patterns\nopenserv-launch - Launch tokens on Base blockchain\nopenserv-ideaboard-api - Find ideas and ship agent services on the Ideaboard"
      }
    ],
    "body": "OpenServ Client\n\nThe @openserv-labs/client package is the TypeScript client for the OpenServ Platform API. You use it whenever your code needs to talk to the platform—to register an agent, create workflows, set up triggers, or run tasks.\n\nWhy you need this package\n\nYour agent (built with @openserv-labs/sdk) runs on your machine or server. The platform doesn’t know about it until you tell it: what the agent is, where it’s reachable, and how it can be triggered. The client is how you do that. It lets you create a platform account (or reuse one), register your agent, define workflows and triggers (webhook, cron, manual, or x402 paid), and bind credentials so your agent can accept tasks. Without it, your agent would have no way to get onto the platform or receive work.\n\nWhat you can do with it\nProvision — One-shot setup: create or reuse an account (via wallet), register the agent, create a workflow with trigger and task, and get API key and auth token. Typically you call provision() once per app startup; it’s idempotent.\nPlatform API — Full control via PlatformClient: create and list agents, workflows, triggers, and tasks; fire triggers; run workflows; manage credentials. Use this when you need more than the default provision flow.\nModel Parameters — Configure which LLM model and parameters the platform uses for your agent's tasks. Set model_parameters on agent creation/update or via provision().\nModels API — Discover available LLM models and their parameter schemas via client.models.list().\nx402 payments — Expose your agent behind a paywall; callers pay per request (e.g. USDC) before the task runs. Provision can set up an x402 trigger and return a paywall URL.\nERC-8004 on-chain identity — Register your agent on-chain (Base), mint an identity NFT, and publish service metadata to IPFS so others can discover and pay your agent in a standard way.\n\nReference: reference.md (full API) · troubleshooting.md (common issues) · examples/ (runnable code)\n\nInstallation\nnpm install @openserv-labs/client\n\nQuick Start: Just provision() + run()\n\nThe simplest deployment is just two calls: provision() and run(). That's it.\n\nYou need an account on the platform to register agents and workflows. The easiest way is to let provision() create one for you: it creates a wallet and signs you up with it (no email required). That account is reused on every run.\n\nSee examples/agent.ts for a complete runnable example.\n\nKey Point: provision() is idempotent. Call it every time your app starts - no need to check isProvisioned() first.\n\nWhat provision() Does\nCreates or reuses an Ethereum wallet (and platform account if new)\nAuthenticates with the OpenServ platform\nCreates or updates the agent (idempotent)\nGenerates API key and auth token\nBinds credentials to agent instance (if agent.instance is provided)\nCreates or updates the workflow with trigger and task\nCreates workflow graph (edges linking trigger to task)\nActivates trigger and sets workflow to running\nPersists state to .openserv.json\nWorkflow Name & Goal\n\nThe workflow config requires two important properties:\n\nname (string) - This becomes the agent name in ERC-8004. Make it polished, punchy, and memorable — this is the public-facing brand name users see. Think product launch, not variable name. Examples: 'Viral Content Engine', 'Crypto Alpha Scanner', 'Life Catalyst Pro'.\ngoal (string, required) - A detailed description of what the workflow accomplishes. Must be descriptive and thorough — short or vague goals will cause API calls to fail. Write at least a full sentence explaining the workflow's purpose.\nworkflow: {\n  name: 'Deep Research Pro',\n  goal: 'Research any topic in depth, synthesize findings from multiple sources, and produce a comprehensive report with citations',\n  trigger: triggers.webhook({ waitForCompletion: true, timeout: 600 }),\n  task: { description: 'Research the given topic' }\n}\n\nAgent Instance Binding (v1.1+)\n\nPass your agent instance to provision() for automatic credential binding:\n\nconst agent = new Agent({ systemPrompt: '...' })\n\nawait provision({\n  agent: {\n    instance: agent, // Calls agent.setCredentials() automatically\n    name: 'my-agent',\n    description: '...',\n    model_parameters: { model: 'gpt-5', verbosity: 'medium', reasoning_effort: 'high' } // Optional\n  },\n  workflow: { ... }\n})\n\n// agent now has apiKey and authToken set - ready for run()\nawait run(agent)\n\n\nThis eliminates the need to manually set OPENSERV_API_KEY environment variables.\n\nModel Parameters\n\nThe optional model_parameters field controls which LLM model and parameters the platform uses when executing tasks for your agent (including runless capabilities and generate() calls). If not provided, the platform default is used.\n\nawait provision({\n  agent: {\n    instance: agent,\n    name: 'my-agent',\n    description: '...',\n    model_parameters: {\n      model: 'gpt-4o',\n      temperature: 0.5,\n      parallel_tool_calls: false\n    }\n  },\n  workflow: { ... }\n})\n\n\nDiscover available models and their parameters:\n\nconst { models, default: defaultModel } = await client.models.list()\n// models: [{ model: 'gpt-5', provider: 'openai', parameters: { ... } }, ...]\n// default: 'gpt-5-mini'\n\nProvision Result\ninterface ProvisionResult {\n  agentId: number\n  apiKey: string\n  authToken?: string\n  workflowId: number\n  triggerId: string\n  triggerToken: string\n  paywallUrl?: string // For x402 triggers\n  apiEndpoint?: string // For webhook triggers\n}\n\nAPI Keys: Agent vs User\n\nprovision() creates two types of credentials. They are not interchangeable:\n\nCredential\tEnv Variable\tUsed By\tPurpose\nAgent API key\tOPENSERV_API_KEY\tSDK internals\tAuthenticates the agent when receiving tasks from the platform. Set automatically via agent.instance. Do not use with PlatformClient.\nWallet key\tWALLET_PRIVATE_KEY\tPlatformClient\tAuthenticates your account for management calls (list tasks, debug workflows, manage agents).\nUser API key\tOPENSERV_USER_API_KEY\tPlatformClient\tAlternative to wallet auth. Get from the platform dashboard.\n\nIf you get a 401 Unauthorized when using PlatformClient, you are likely using the agent API key by mistake. Use wallet authentication or the user API key instead.\n\nPlatformClient: Full API Access\n\nFor advanced use cases, use PlatformClient directly:\n\nimport { PlatformClient } from '@openserv-labs/client'\n\n// Using wallet authentication (recommended — uses wallet from provision)\nconst client = new PlatformClient()\nawait client.authenticate(process.env.WALLET_PRIVATE_KEY)\n\n// Or using User API key (NOT the agent API key)\nconst client = new PlatformClient({\n  apiKey: process.env.OPENSERV_USER_API_KEY // NOT OPENSERV_API_KEY\n})\n\n\nSee reference.md for full API documentation on:\n\nclient.agents.* - Agent management\nclient.workflows.* - Workflow management\nclient.triggers.* - Trigger management\nclient.tasks.* - Task management\nclient.models.* - Available LLM models and parameters\nclient.integrations.* - Integration connections\nclient.payments.* - x402 payments\nclient.web3.* - Credits top-up\nTriggers Factory\n\nUse the triggers factory for type-safe trigger configuration:\n\nimport { triggers } from '@openserv-labs/client'\n\n// Webhook (free, public endpoint)\ntriggers.webhook({\n  input: { query: { type: 'string', description: 'Search query' } },\n  waitForCompletion: true,\n  timeout: 600\n})\n\n// x402 (paid API with paywall)\ntriggers.x402({\n  name: 'AI Research Assistant',\n  description: 'Get comprehensive research reports on any topic',\n  price: '0.01',\n  timeout: 600,\n  input: {\n    prompt: {\n      type: 'string',\n      title: 'Your Request',\n      description: 'Describe what you would like the agent to do'\n    }\n  }\n})\n\n// Cron (scheduled)\ntriggers.cron({\n  schedule: '0 9 * * *', // Daily at 9 AM\n  timezone: 'America/New_York'\n})\n\n// Manual (platform UI only)\ntriggers.manual()\n\nTimeout\n\nImportant: Always set timeout to at least 600 seconds (10 minutes) for webhook and x402 triggers. Agents often take significant time to process requests — especially in multi-agent workflows or when performing research, content generation, or other complex tasks. A low timeout (e.g., 180s) will cause premature failures. When in doubt, err on the side of a longer timeout. For multi-agent pipelines with many sequential steps, consider 900 seconds or more.\n\nInput Schema\n\nDefine fields for webhook/x402 paywall UI:\n\ntriggers.x402({\n  name: 'Content Writer',\n  description: 'Generate polished content on any topic',\n  price: '0.01',\n  input: {\n    topic: {\n      type: 'string',\n      title: 'Content Topic',\n      description: 'Enter the subject you want covered'\n    },\n    style: {\n      type: 'string',\n      title: 'Writing Style',\n      enum: ['formal', 'casual', 'humorous'],\n      default: 'casual'\n    }\n  }\n})\n\nCron Expressions\n┌───────────── minute (0-59)\n│ ┌───────────── hour (0-23)\n│ │ ┌───────────── day of month (1-31)\n│ │ │ ┌───────────── month (1-12)\n│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)\n* * * * *\n\n\nCommon: 0 9 * * * (daily 9 AM), */5 * * * * (every 5 min), 0 9 * * 1-5 (weekdays 9 AM)\n\nState Management\nimport { getProvisionedInfo, clearProvisionedState } from '@openserv-labs/client'\n\n// Get stored IDs and tokens\nconst info = getProvisionedInfo('my-agent', 'My Awesome Workflow')\n\n// Clear state (forces fresh creation)\nclearProvisionedState()\n\nDiscovering & Firing x402 Services\nDiscover Available Services (No Auth Required)\n\ndiscoverServices() lists all public x402-enabled workflows. No authentication is needed — you can call it on a bare PlatformClient:\n\nimport { PlatformClient } from '@openserv-labs/client'\n\nconst client = new PlatformClient() // no API key or wallet needed\nconst services = await client.payments.discoverServices()\n\nfor (const service of services) {\n  console.log(`${service.name}: $${service.x402Pricing}`)\n  console.log(`URL: ${service.webhookUrl}`)\n}\n\nFiring Triggers\n// By workflow ID (recommended — resolves the URL automatically)\nconst result = await client.triggers.fireWebhook({\n  workflowId: 123,\n  input: { query: 'hello world' }\n})\n\n// Or by direct URL\nconst result = await client.triggers.fireWebhook({\n  triggerUrl: 'https://api.openserv.ai/webhooks/trigger/TOKEN',\n  input: { query: 'hello world' }\n})\n\nx402 (Programmatic)\n// By workflow ID (recommended)\nconst result = await client.payments.payWorkflow({\n  workflowId: 123,\n  input: { prompt: 'Hello world' }\n})\n\n// Or by direct URL\nconst result = await client.payments.payWorkflow({\n  triggerUrl: 'https://api.openserv.ai/webhooks/x402/trigger/TOKEN',\n  input: { prompt: 'Hello world' }\n})\n\nEnvironment Variables\nVariable\tDescription\tRequired\nOPENSERV_USER_API_KEY\tUser API key (from platform)\tYes*\nWALLET_PRIVATE_KEY\tWallet for SIWE auth\tYes*\nOPENSERV_API_URL\tCustom API URL\tNo\n\n*Either API key or wallet key required\n\nERC-8004: On-Chain Agent Identity\n\nRegister your agent on-chain after provisioning. This mints an NFT on the Identity Registry and publishes your agent's service endpoints to IPFS.\n\nRequires ETH on Base. The wallet created by provision() starts with zero balance. Fund it with a small amount of ETH on Base mainnet before registration. Always wrap in try/catch so failures don't prevent run(agent) from starting.\n\nReload .env after provision(). provision() writes WALLET_PRIVATE_KEY to .env at runtime, but process.env already loaded the empty value at startup. Use dotenv.config({ override: true }) after provision() to pick up the freshly written key. See openserv-agent-sdk skill for the full dotenv pattern.\n\nimport { PlatformClient } from '@openserv-labs/client'\n\n// Reload .env to pick up WALLET_PRIVATE_KEY written by provision()\ndotenv.config({ override: true })\n\ntry {\n  const client = new PlatformClient()\n  await client.authenticate(process.env.WALLET_PRIVATE_KEY)\n\n  const erc8004 = await client.erc8004.registerOnChain({\n    workflowId: result.workflowId,\n    privateKey: process.env.WALLET_PRIVATE_KEY!,\n    name: 'My Agent',\n    description: 'What this agent does'\n  })\n\n  console.log(`Agent ID: ${erc8004.agentId}`) // \"8453:42\"\n  console.log(`Explorer: ${erc8004.blockExplorerUrl}`)\n  console.log(`Scan: ${erc8004.scanUrl}`) // \"https://www.8004scan.io/agents/base/42\"\n} catch (error) {\n  console.warn('ERC-8004 registration skipped:', error instanceof Error ? error.message : error)\n}\n\nFirst run mints a new NFT. Re-runs update the URI — agent ID stays the same.\nDefault chain is Base mainnet (8453). Pass chainId and rpcUrl for other chains.\nNever clear the wallet state unless you intentionally want a new agent ID.\n\nSee reference.md for the full ERC-8004 API (wallet management, chain helpers, troubleshooting).\n\nCleanup\nawait client.workflows.delete({ id: workflowId })\nawait client.agents.delete({ id: agentId })\nclearProvisionedState()\n\nUpdating This Skill\n\nThis skill may be outdated. The OpenServ team ships updates regularly—new features, API changes, and bug fixes won't be reflected here until you update. If something isn't working as expected, or you want to make sure you have the latest information, update the skill before proceeding.\n\n# Check if updates are available\nnpx skills check\n\n# Update all installed skills to latest versions\nnpx skills update\n\n\nOr reinstall the OpenServ skills directly:\n\nnpx skills add openserv-labs/skills\n\nRelated Skills\nopenserv-agent-sdk - Building agents with capabilities\nopenserv-multi-agent-workflows - Multi-agent collaboration patterns\nopenserv-launch - Launch tokens on Base blockchain\nopenserv-ideaboard-api - Find ideas and ship agent services on the Ideaboard"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/issa-me-sush/openserv-client",
    "publisherUrl": "https://clawhub.ai/issa-me-sush/openserv-client",
    "owner": "issa-me-sush",
    "version": "1.0.4",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openserv-client",
    "downloadUrl": "https://openagent3.xyz/downloads/openserv-client",
    "agentUrl": "https://openagent3.xyz/skills/openserv-client/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openserv-client/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openserv-client/agent.md"
  }
}