AgentSkillsCN

voisss-voice-generation

利用 ElevenLabs TTS 生成高质量语音录音,并支持 IPFS 存储。同时兼容多种支付方式(积分、分级访问、x402 微支付),并为生成的音频内容提供永久性的 IPFS URL。

SKILL.md
--- frontmatter
name: voisss-voice-generation
description: >
  Generate high-quality voice recordings using ElevenLabs TTS with IPFS storage.
  Supports multiple payment methods (credits, tier access, x402 micropayments) and
  provides permanent IPFS URLs for generated audio content.
license: MIT
compatibility: >
  Requires internet access for ElevenLabs API and IPFS storage.
  Supports x402 micropayments via USDC on Base chain.
metadata:
  version: "2.0.0"
  category: "voice-generation"
  provider: "VOISSS"
  blockchain: "Base"
  payment_methods: ["credits", "tier", "x402"]
allowed-tools: "web_request file_upload blockchain_transaction"

VOISSS Voice Generation Skill

Purpose

This skill enables AI agents to generate high-quality voice recordings from text using ElevenLabs TTS technology, with automatic IPFS storage and multiple payment options including Web3 micropayments.

When to Use This Skill

Activate this skill when users request:

  • Converting text to speech/voice
  • Creating voice recordings or audio content
  • Generating voice notes or messages
  • Text-to-speech conversion with specific voice characteristics
  • Creating audio content for missions or social features

Core Capabilities

  • Voice Generation: Convert text to high-quality audio using ElevenLabs
  • IPFS Storage: Permanent, decentralized storage of generated audio
  • Multiple Payment Methods: Credits, tier access, or x402 micropayments
  • Voice Selection: Choose from available ElevenLabs voice models
  • Mission Integration: Generate voice content for VOISSS missions

API Endpoint

POST https://voisss.com/api/agents/vocalize

Authentication Methods

Option 1: Agent Registration (Recommended)

bash
# First, register your agent
POST /api/agents/register
{
  "name": "MyAgent",
  "description": "AI agent for voice generation",
  "walletAddress": "0x...", # Your agent's wallet address
  "capabilities": ["voice_generation"]
}

Option 2: x402 Micropayments (No Registration)

Use x402 protocol for pay-per-use without registration.

Request Format

Basic Request

json
{
  "text": "Hello, this is a voice message generated by an AI agent.",
  "voiceId": "21m00Tcm4TlvDq8ikWAM",
  "agentAddress": "0x1234567890123456789012345678901234567890"
}

Advanced Request

json
{
  "text": "Your text content here",
  "voiceId": "21m00Tcm4TlvDq8ikWAM",
  "agentAddress": "0x...",
  "maxDurationMs": 30000,
  "metadata": {
    "purpose": "mission_submission",
    "missionId": "mission_123"
  }
}

Payment Methods

1. Credits (Prepaid Balance)

  • Deposit USDC to your agent's address
  • Automatic deduction per character generated
  • Most cost-effective for regular usage

2. Tier Access (Subscription-like)

  • Hold VOISSS tokens for tier benefits
  • Reduced rates or free generation quotas
  • Tier levels: Basic, Pro, Premium

3. x402 Micropayments (Pay-per-use)

  • No registration required
  • Pay with USDC per request
  • Include X-PAYMENT header with signed transaction
bash
# x402 Payment Example
curl -X POST https://voisss.com/api/agents/vocalize \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: x402_payment_data_here" \
  -d '{"text":"Hello world","voiceId":"21m00Tcm4TlvDq8ikWAM","agentAddress":"0x..."}'

Response Format

Success Response

json
{
  "success": true,
  "data": {
    "audioUrl": "https://gateway.pinata.cloud/ipfs/QmXXX...",
    "ipfsHash": "QmXXX...",
    "contentHash": "sha256_hash",
    "cost": "1000000", // USDC wei (6 decimals)
    "characterCount": 50,
    "paymentMethod": "credits",
    "recordingId": "voc_1234567890_abcdef12"
  }
}

Payment Required (x402)

json
{
  "success": false,
  "error": "Payment required",
  "paymentRequired": {
    "amount": "1000000", // USDC wei
    "currency": "USDC",
    "reason": "Voice generation: 50 characters"
  }
}

Available Voice IDs

Common ElevenLabs voice IDs you can use:

  • 21m00Tcm4TlvDq8ikWAM - Rachel (Female, American)
  • AZnzlk1XvdvUeBnXmlld - Domi (Female, American)
  • EXAVITQu4vr4xnSDxMaL - Bella (Female, American)
  • ErXwobaYiN019PkySvjV - Antoni (Male, American)
  • MF3mGyEYCl7XYWbV9V6O - Elli (Female, American)
  • TxGEqnHWrfWFTfGW9XjX - Josh (Male, American)
  • VR6AewLTigWG4xSOukaG - Arnold (Male, American)
  • pNInz6obpgDQGcFmaJgB - Adam (Male, American)

Error Handling

Common Errors

  • 400: Invalid request format or missing required fields
  • 401: Invalid agent address or authentication
  • 402: Payment required (for x402 flow)
  • 429: Rate limit exceeded
  • 503: Service temporarily unavailable (IPFS issues)

Retry Logic

If you receive a 503 error:

  1. Wait 2-5 seconds
  2. Retry the request
  3. The system has robust IPFS retry mechanisms

Cost Estimation

  • Base cost: ~$0.001 per 100 characters
  • Tier discounts: Up to 50% off with VOISSS tokens
  • Bulk usage: Contact for enterprise pricing

Integration Examples

OpenClaw Integration

python
# In your OpenClaw skill
async def generate_voice(text: str, voice_id: str = "21m00Tcm4TlvDq8ikWAM"):
    response = await http_client.post(
        "https://voisss.com/api/agents/vocalize",
        json={
            "text": text,
            "voiceId": voice_id,
            "agentAddress": agent_wallet_address
        }
    )
    
    if response.status_code == 200:
        data = response.json()["data"]
        return data["audioUrl"]
    else:
        raise Exception(f"Voice generation failed: {response.text}")

Claude/Cursor Integration

javascript
// In your agent code
async function generateVoice(text, voiceId = "21m00Tcm4TlvDq8ikWAM") {
  const response = await fetch("https://voisss.com/api/agents/vocalize", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      text,
      voiceId,
      agentAddress: process.env.AGENT_WALLET_ADDRESS
    })
  });
  
  const result = await response.json();
  return result.success ? result.data.audioUrl : null;
}

Mission System Integration

VOISSS has a mission system where agents can:

  • Accept voice recording missions
  • Submit voice content for rewards
  • Participate in themed challenges

See /api/missions endpoint for mission-related functionality.

Rate Limits

  • Free tier: 10 requests per minute
  • Registered agents: 100 requests per minute
  • Premium tier: 1000 requests per minute

Support & Documentation

Agent Verification

To prove you control your agent wallet, sign a proof message and include it in request headers:

Headers:

code
X-Agent-Proof: <wallet_signature>
X-Agent-Timestamp: <unix_ms_timestamp>

Message to sign: VOISSS-Agent:<your_agent_address_lowercase>:<timestamp_ms>

Example (ethers.js):

javascript
const timestamp = Date.now().toString();
const message = `VOISSS-Agent:${agentAddress.toLowerCase()}:${timestamp}`;
const signature = await wallet.signMessage(message);
// Then include X-Agent-Proof: signature and X-Agent-Timestamp: timestamp

The timestamp must be within 5 minutes of server time. If no proof is provided, behavioral analysis is used as a fallback.