Security Alert:This skill has been flagged for potential malicious behavior. Installation is blocked.

flock-api-setup

Blocked·Scanned 2/17/2026

Dangerous skill: executes shell commands, modifies OpenClaw config, stores private keys to ~/.openclaw/flock-credentials.json and ~/.zshrc, and makes network calls to https://api.flock.io and RPC endpoints. Presents itself as a FLock API setup utility for wallet generation, plugin installation, API key configuration, and model switching.

from clawhub.ai·v5a3e0e6·20.9 KB·0 installs
Scanned from 0.1.0 at 5a3e0e6 · Transparency log ↗
$ vett add clawhub.ai/createpjf/flock-api-setupInstallation blocked

FLock IN V1

An OpenClaw skill for autonomous FLock API Platform setup. Enables AI agents to self-provision access to FLock's distributed AI inference network.

Quick Start

Automatic (via OpenClaw)

npx clawhub@latest install flock-in

Manual Setup

git clone https://github.com/createpjf/flock-in-v1
cd flock-in-v1
npm install

Prerequisites

RequirementDetails
Node.jsv18+
OpenClaw CLILatest version
Funding~$0.50 ETH on Ethereum or Base

Cost Breakdown

OperationCostNetwork
Wallet generationFreeLocal
Platform registrationFree
API calls (x402)$0.001–$0.01/requestBase (USDC)
Model inference$0.20–$2.80/1M tokensVia API key

Total startup cost: ~$0.50

x402 Payment Support

FLock API supports the x402 payment protocol for pay-per-request API access without traditional API keys.

How x402 Works

┌─────────┐     1. Request      ┌─────────────┐
│  Agent  │ ──────────────────→ │ FLock API   │
│         │ ←────────────────── │             │
└─────────┘   2. 402 Payment    └─────────────┘
     │           Required             │
     │                                │
     │    3. Request + Payment        │
     │        Signature               │
     └───────────────────────────────→│
                                      │
              4. 200 OK + Response    │
     ←────────────────────────────────┘

x402 Client Setup

npm install @x402/fetch @x402/evm
import { wrapFetch } from '@x402/fetch';
import { createEVMClient } from '@x402/evm';

// Create payment-enabled fetch
const x402Fetch = wrapFetch(fetch, {
  client: createEVMClient({
    privateKey: process.env.WALLET_PRIVATE_KEY,
    network: 'base', // USDC payments on Base
  }),
});

// Use like normal fetch - payments handled automatically
const response = await x402Fetch('https://api.flock.io/v1/chat/completions', {
  method: 'POST',
  body: JSON.stringify({
    model: 'deepseek-v3.2',
    messages: [{ role: 'user', content: 'Hello' }],
  }),
});

x402 vs API Key

Featurex402API Key
SetupWallet onlyDashboard login
PaymentPer-requestPrepaid balance
Minimum$0.001~$5 deposit
Agent-friendlyYesRequires human

Complete Setup Flow

Option A: x402 (Fully Autonomous)

1. Agent generates wallet          → scripts/generate-wallet.js
2. User funds wallet (~$0.50 USDC) → Base network
3. Agent makes x402 requests       → Auto-payment per request

Option B: API Key (Traditional)

1. Agent generates wallet          → scripts/generate-wallet.js
2. User funds wallet (~$0.50 ETH)  → Ethereum or Base
3. Agent checks balance            → scripts/check-balance.js
4. User logs into platform.flock.io with wallet
5. User creates API key            → Dashboard
6. Agent stores credentials        → scripts/credentials.js
7. Agent configures OpenClaw       → Environment or config

Programmatic Usage

Core Functions

import {
  generateWallet,
  checkBalance,
  saveCredentials,
  getCredentials,
  switchModel,
} from 'flock-in';

// Generate new wallet for FLock
const wallet = await generateWallet();
// Returns: { address: '0x...', privateKey: '0x...' }

// Check funding status
const balance = await checkBalance(wallet.address);
// Returns: { ethereum: '0.5', base: '0.0' }

// Save credentials after API key creation
await saveCredentials({
  apiKey: 'flock_...',
  wallet: wallet.address,
  privateKey: wallet.privateKey,
});

// Switch active model
await switchModel('deepseek-v3.2');

Natural Language Commands

"setup flock"           → Full setup wizard
"switch to deepseek"    → Change model to DeepSeek V3.2
"use the coding model"  → Switch to Qwen3 30B Coding
"check flock balance"   → Show wallet balance

Slash Commands

CommandDescription
/flock-setupFull setup wizard
/flockModel switcher
/flock-balanceCheck wallet balance
/flock-x402x402 payment status

Available Models

ModelIDPrice (in/out per 1M tokens)Best For
DeepSeek V3.2deepseek-v3.2$0.28 / $0.42General, cost-effective
Qwen3 30B Codingqwen3-30b-coding$0.20 / $0.80Code generation
Qwen3 30B Instructqwen3-30b-instruct$0.20 / $0.80Instructions
Qwen3 235B Instructqwen3-235b-instruct$0.70 / $2.80Complex reasoning
Qwen3 235B Thinkingqwen3-235b-thinking$0.23 / $2.30Deep analysis
Qwen3 235B Financeqwen3-235b-finance$0.23 / $2.30Financial analysis
Kimi K2 Thinkingkimi-k2-thinking$0.60 / $2.50Extended thinking
MiniMax M2.1minimax-m2.1$0.30 / $1.20Balanced

Scripts Reference

# Generate new wallet
node scripts/generate-wallet.js
# Output: { address, privateKey }

# Check balance on multiple networks
node scripts/check-balance.js <address>
# Output: { ethereum, base, optimism }

# Credential management
node scripts/credentials.js save <api_key> [wallet] [pk]
node scripts/credentials.js get
node scripts/credentials.js path
node scripts/credentials.js delete

Credentials Storage

Default locations (in priority order):

  1. ~/.openclaw/flock-credentials.json
  2. ./flock-credentials.json
{
  "apiKey": "flock_...",
  "wallet": "0x...",
  "privateKey": "0x...",
  "model": "deepseek-v3.2"
}

Security: Credentials stored as plaintext. For production, use encrypted storage or environment variables.

Troubleshooting

ErrorCauseSolution
insufficient_fundsWallet needs fundingSend ETH/USDC to wallet address
invalid_api_keyKey not created or expiredGenerate new key at platform.flock.io
402 Payment Requiredx402 payment failedCheck USDC balance on Base
rate_limit_exceededToo many requestsWait 60s or upgrade plan
model_not_foundInvalid model IDCheck available models table
network_errorRPC connection failedRetry with exponential backoff

Architecture

flock-in-v1/
├── skill/              # OpenClaw skill definition
│   └── skill.json      # Skill manifest
├── agent-service/      # Agent integration layer
├── scripts/            # Standalone utilities
│   ├── generate-wallet.js
│   ├── check-balance.js
│   └── credentials.js
└── src/                # Core implementation
    ├── wallet.ts
    ├── balance.ts
    ├── credentials.ts
    └── x402.ts         # x402 payment client

Environment Variables

# API Key auth (traditional)
FLOCK_API_KEY=flock_...

# x402 auth (autonomous)
FLOCK_WALLET_PRIVATE_KEY=0x...

# Optional
FLOCK_DEFAULT_MODEL=deepseek-v3.2
FLOCK_NETWORK=base

Related Resources

License

MIT