9.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'.
Skill Snapshot
| 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'. OpenClaw Skills integration. |
| owner | createpjf |
| repository | createpjf/flock-in-v1 |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @createpjf/flock-in-v1 |
| last updated | Feb 7, 2026 |
Maintainer

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/*
- Environment variable
- 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:
~/.openclaw/flock-credentials.json(if OpenClaw installed)./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
| Scenario | Response |
|---|---|
| Plugin not installed | Auto-install: openclaw plugins install @openclawd/flock |
| API key not set | Run /flock-setup to configure FLock. |
| No funds detected | No funds on Ethereum or Base. Please fund the wallet. |
| Invalid API key | Invalid key format. Keys start with sk- |
| Model not found | Model not found. Available models: [show list] |
Model Reference
| # | Model ID | Price (in/out per 1M) |
|---|---|---|
| 1 | flock/qwen3-235b-a22b-thinking-2507 | $0.23/$2.30 |
| 2 | flock/qwen3-235b-a22b-thinking-qwfin | $0.23/$2.30 |
| 3 | flock/kimi-k2-thinking | $0.60/$2.50 |
| 4 | flock/qwen3-30b-a3b-instruct-2507 | $0.20/$0.80 |
| 5 | flock/qwen3-235b-a22b-instruct-2507 | $0.70/$2.80 |
| 6 | flock/qwen3-30b-a3b-instruct-coding | $0.20/$0.80 |
| 7 | flock/deepseek-v3.2 | $0.28/$0.42 |
| 8 | flock/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
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
| Requirement | Details |
|---|---|
| Node.js | v18+ |
| OpenClaw CLI | Latest version |
| Funding | ~$0.50 ETH on Ethereum or Base |
Cost Breakdown
| Operation | Cost | Network |
|---|---|---|
| Wallet generation | Free | Local |
| Platform registration | Free | ā |
| API calls (x402) | $0.001ā$0.01/request | Base (USDC) |
| Model inference | $0.20ā$2.80/1M tokens | Via 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
| Feature | x402 | API Key |
|---|---|---|
| Setup | Wallet only | Dashboard login |
| Payment | Per-request | Prepaid balance |
| Minimum | $0.001 | ~$5 deposit |
| Agent-friendly | Yes | Requires 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
| Command | Description |
|---|---|
/flock-setup | Full setup wizard |
/flock | Model switcher |
/flock-balance | Check wallet balance |
/flock-x402 | x402 payment status |
Available Models
| Model | ID | Price (in/out per 1M tokens) | Best For |
|---|---|---|---|
| DeepSeek V3.2 | deepseek-v3.2 | $0.28 / $0.42 | General, cost-effective |
| Qwen3 30B Coding | qwen3-30b-coding | $0.20 / $0.80 | Code generation |
| Qwen3 30B Instruct | qwen3-30b-instruct | $0.20 / $0.80 | Instructions |
| Qwen3 235B Instruct | qwen3-235b-instruct | $0.70 / $2.80 | Complex reasoning |
| Qwen3 235B Thinking | qwen3-235b-thinking | $0.23 / $2.30 | Deep analysis |
| Qwen3 235B Finance | qwen3-235b-finance | $0.23 / $2.30 | Financial analysis |
| Kimi K2 Thinking | kimi-k2-thinking | $0.60 / $2.50 | Extended thinking |
| MiniMax M2.1 | minimax-m2.1 | $0.30 / $1.20 | Balanced |
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):
~/.openclaw/flock-credentials.json./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
| Error | Cause | Solution |
|---|---|---|
insufficient_funds | Wallet needs funding | Send ETH/USDC to wallet address |
invalid_api_key | Key not created or expired | Generate new key at platform.flock.io |
402 Payment Required | x402 payment failed | Check USDC balance on Base |
rate_limit_exceeded | Too many requests | Wait 60s or upgrade plan |
model_not_found | Invalid model ID | Check available models table |
network_error | RPC connection failed | Retry 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
- x402 Protocol ā Payment protocol specification
- x402 GitHub ā Reference implementation
- FLock API Platform ā Dashboard
- FLock Documentation
- Farcaster Agent ā Pattern inspiration
- OpenClaw ā Skill framework
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.
