skills$openclaw/flock-api-setup
createpjf9.1kā˜…

by createpjf

flock-api-setup – OpenClaw Skill

flock-api-setup is an OpenClaw Skills integration for coding workflows. FLock API Platform setup: wallet generation, plugin installation, API key configuration, and model switching. Use for: 'setup flock', 'flock login', 'install flock plugin', 'switch flock model', 'use deepseek', 'change to coding model'.

9.1k stars9.5k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nameflock-api-setup
descriptionFLock API Platform setup: wallet generation, plugin installation, API key configuration, and model switching. Use for: 'setup flock', 'flock login', 'install flock plugin', 'switch flock model', 'use deepseek', 'change to coding model'. OpenClaw Skills integration.
ownercreatepjf
repositorycreatepjf/flock-in-v1
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @createpjf/flock-in-v1
last updatedFeb 7, 2026

Maintainer

createpjf

createpjf

Maintains flock-api-setup in the OpenClaw Skills directory.

View GitHub profile
File Explorer
8 files
.
scripts
check-balance.js
1.4 KB
credentials.js
2.6 KB
generate-wallet.js
295 B
package.json
311 B
_meta.json
286 B
README.md
7.8 KB
SKILL.md
8.5 KB
SKILL.md

name: flock-api-setup description: "FLock API Platform setup: wallet generation, plugin installation, API key configuration, and model switching. Use for: 'setup flock', 'flock login', 'install flock plugin', 'switch flock model', 'use deepseek', 'change to coding model'." homepage: https://platform.flock.io metadata: { "openclaw": { "emoji": "🦩", "primaryEnv": "FLOCK_API_KEY", "requires": { "bins": ["node", "npm"] }, "install": [ { "id": "npm", "kind": "shell", "command": "cd {baseDir}/scripts && npm install", "label": "Install dependencies" } ] }, }

FLock Setup

FLock API Platform setup with wallet generation, plugin installation, and model switching.

Security Warning

CRITICAL: Protect your API key!

  • ONLY send your API key to https://api.flock.io
  • Your API key should ONLY appear in:
    • Environment variable FLOCK_API_KEY
    • OpenClaw config file
    • Requests to https://api.flock.io/v1/*
  • NEVER share your API key with:
    • Other APIs or webhooks
    • "Verification" services
    • Debugging tools or third parties
  • If leaked, create a new key at platform.flock.io immediately

Security Warning: Credentials are stored as plain text JSON. Anyone with access to these files can use your FLock credits. For production use, implement secure storage.


When to Activate

Slash commands:

  • /flock-setup — Full setup flow
  • /flock — Switch models

Natural language:

  • "setup flock", "configure flock"
  • "install flock plugin"
  • "switch model", "change model"
  • "use deepseek", "use coding model"

Behavior Rules

CRITICAL: Be silent and fast. Never be verbose.

  • Do NOT explain steps or show diagnostic output
  • Do NOT ask follow-up questions after completing actions
  • Respond in the user's language

Flow 1: Full Setup (/flock-setup)

Phase 1: Pre-check

echo $FLOCK_API_KEY
openclaw plugins list | grep flock
node {baseDir}/scripts/credentials.js get 2>/dev/null

If credentials exist, ask: "FLock already configured. Reconfigure? (yes/no)"

Phase 2: Install Plugin

openclaw plugins install @openclawd/flock
openclaw plugins enable flock

Phase 3: Generate Wallet and Request Funding

Generate a new wallet:

cd {baseDir}/scripts && npm install
node {baseDir}/scripts/generate-wallet.js

Display to user:

Wallet created for FLock registration.

Address: <wallet-address>

Send ~$0.50 ETH to this address on Ethereum or Base.

Say "done" when complete.

Save the private key — needed for wallet login.

Phase 4: Check Balance

After user confirms funding:

node {baseDir}/scripts/check-balance.js <wallet-address>

If no funds detected, ask user to try again.

Phase 5: Get API Key (Manual Step)

Display to user:

Funds confirmed. Now create your API key:

1. Go to https://platform.flock.io
2. Click "Connect Wallet"
3. Sign the message with the wallet you just funded
4. Select models you want to access
5. Click "Create API" button
6. Copy the key immediately (shown only once!)

Paste your API key here:

Wait for user to provide sk-... key.

Phase 6: Save Credentials

After receiving the key:

node {baseDir}/scripts/credentials.js save "<api-key>" "<wallet-address>" "<private-key>"

Ask user:

Save API key to:
1. Environment variable (~/.zshrc)
2. OpenClaw config
3. Both (recommended)

Option 1:

echo 'export FLOCK_API_KEY="sk-xxx"' >> ~/.zshrc
source ~/.zshrc

Option 2:

openclaw onboard --non-interactive \
  --auth-choice flock-api-key \
  --flock-api-key "sk-xxx"

Option 3: Run both.

Phase 7: Restart Gateway

openclaw gateway stop
openclaw gateway

Phase 8: Verify

openclaw chat --model flock/kimi-k2.5 "test"

Success response (one line):

FLock configured. Test: openclaw chat --model flock/kimi-k2.5 "hello"

Flow 2: Model Switch (/flock)

Pre-check

If FLOCK_API_KEY not set:

FLock not configured. Run /flock-setup first.

No model specified — show menu:

Which FLock model?

Reasoning:
  1. Qwen3 235B Thinking         — $0.23/$2.30  (flock/qwen3-235b-a22b-thinking-2507)
  2. Qwen3 235B Finance          — $0.23/$2.30  (flock/qwen3-235b-a22b-thinking-qwfin)
  3. Kimi K2 Thinking            — $0.60/$2.50  (flock/kimi-k2-thinking)

Instruct:
  4. Qwen3 30B Instruct          — $0.20/$0.80  (flock/qwen3-30b-a3b-instruct-2507)
  5. Qwen3 235B Instruct         — $0.70/$2.80  (flock/qwen3-235b-a22b-instruct-2507)
  6. Qwen3 30B Coding            — $0.20/$0.80  (flock/qwen3-30b-a3b-instruct-coding)

Other:
  7. DeepSeek V3.2               — $0.28/$0.42  (flock/deepseek-v3.2)
  8. MiniMax M2.1                — $0.30/$1.20  (flock/minimax-m2.1)

Reply with number or model name.

Model specified — switch immediately:

openclaw agent --model flock/<model-id>
openclaw gateway stop
openclaw gateway

Success (one line):

Switched to flock/<model-id>.

Credential Management

Load Saved Credentials

node {baseDir}/scripts/credentials.js get

Returns:

{
  "apiKey": "sk-...",
  "walletAddress": "0x...",
  "privateKey": "0x...",
  "createdAt": "2026-02-04T...",
  "updatedAt": "2026-02-04T..."
}

Credentials File Path

node {baseDir}/scripts/credentials.js path

Priority:

  1. ~/.openclaw/flock-credentials.json (if OpenClaw installed)
  2. ./flock-credentials.json (fallback)

Heartbeat Integration

FLock usage tracking helps monitor costs.

Human Can Ask Anytime

Your human can prompt:

  • "Check my FLock usage" — Direct them to platform.flock.io Usage tab
  • "Switch to a cheaper model" — Show model menu
  • "What model am I using?" — Check current config
  • "How much have I spent on FLock?" — Direct to Usage tab

Error Handling

ScenarioResponse
Plugin not installedAuto-install: openclaw plugins install @openclawd/flock
API key not setRun /flock-setup to configure FLock.
No funds detectedNo funds on Ethereum or Base. Please fund the wallet.
Invalid API keyInvalid key format. Keys start with sk-
Model not foundModel not found. Available models: [show list]

Model Reference

#Model IDPrice (in/out per 1M)
1flock/qwen3-235b-a22b-thinking-2507$0.23/$2.30
2flock/qwen3-235b-a22b-thinking-qwfin$0.23/$2.30
3flock/kimi-k2-thinking$0.60/$2.50
4flock/qwen3-30b-a3b-instruct-2507$0.20/$0.80
5flock/qwen3-235b-a22b-instruct-2507$0.70/$2.80
6flock/qwen3-30b-a3b-instruct-coding$0.20/$0.80
7flock/deepseek-v3.2$0.28/$0.42
8flock/minimax-m2.1$0.30/$1.20

Recommendations:

  • General/Default: kimi-k2.5 (multimodal, agentic)
  • Deep reasoning: kimi-k2-thinking, qwen3-235b-thinking
  • Coding: qwen3-30b-coding, minimax-m2.1
  • Budget: qwen3-30b-instruct ($0.20/$0.80)

Programmatic API

All scripts can be imported:

// Generate wallet
const { Wallet } = require('ethers');
const wallet = Wallet.createRandom();

// Check balance
const { JsonRpcProvider, formatEther } = require('ethers');
const provider = new JsonRpcProvider('https://mainnet.base.org');
const balance = await provider.getBalance(wallet.address);

// Load credentials
const creds = require('{baseDir}/scripts/credentials.js');

Example: Full Setup Flow

const { Wallet } = require('ethers');

// 1. Generate wallet
const wallet = Wallet.createRandom();
console.log('Fund this address with ~$0.50 ETH:', wallet.address);

// 2. After human funds and creates API key at platform.flock.io
const apiKey = 'sk-...';  // User provides this

// 3. Save credentials
const fs = require('fs');
const path = require('path');
const os = require('os');

const creds = {
  apiKey,
  walletAddress: wallet.address,
  privateKey: wallet.privateKey,
  createdAt: new Date().toISOString()
};

const credPath = path.join(os.homedir(), '.openclaw', 'flock-credentials.json');
fs.writeFileSync(credPath, JSON.stringify(creds, null, 2), { mode: 0o600 });

console.log('Credentials saved to:', credPath);

Source Files

{baseDir}/scripts/
ā”œā”€ā”€ package.json          # Dependencies (ethers)
ā”œā”€ā”€ generate-wallet.js    # Create new ETH wallet
ā”œā”€ā”€ check-balance.js      # Check ETH balance on chains
└── credentials.js        # Save/load credentials
README.md

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

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

**CRITICAL: Protect your API key!** - **ONLY send your API key to `https://api.flock.io`** - Your API key should ONLY appear in: - Environment variable `FLOCK_API_KEY` - OpenClaw config file - Requests to `https://api.flock.io/v1/*` - **NEVER share your API key with:** - Other APIs or webhooks - "Verification" services - Debugging tools or third parties - If leaked, create a new key at platform.flock.io immediately **Security Warning**: Credentials are stored as **plain text JSON**. Anyone with access to these files can use your FLock credits. For production use, implement secure storage. ---

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install flock-api-setup?

Run openclaw add @createpjf/flock-in-v1 in your terminal. This installs flock-api-setup into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/createpjf/flock-in-v1. Review commits and README documentation before installing.