Comprehensive tutorial series for OpenClaw AI agent gateway
Neynar is the primary API provider for Farcaster. This guide covers getting your API credentials and configuring them for OpenClaw agents.
The free tier includes:
A signer authorizes your app to take actions on behalf of a Farcaster account.
Use Neynar’s hosted signer flow:
# Request a signer
curl -X POST "https://api.neynar.com/v2/farcaster/signer" \
-H "api_key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response includes a signer_uuid and approval URL. The user must approve the signer in Warpcast.
For full control, generate your own Ed25519 keypair and register it. See Neynar docs for details.
Set these environment variables:
export NEYNAR_API_KEY="your-api-key"
export NEYNAR_SIGNER_UUID="your-signer-uuid"
Add to your shell profile (~/.bashrc, ~/.zshrc):
# Farcaster / Neynar
export NEYNAR_API_KEY="neynar_abc123..."
export NEYNAR_SIGNER_UUID="signer_xyz789..."
Store credentials in a JSON file:
{
"apiKey": "neynar_abc123...",
"signerUuid": "signer_xyz789..."
}
Source them at runtime:
eval $(jq -r '"export NEYNAR_API_KEY=\(.apiKey)\nexport NEYNAR_SIGNER_UUID=\(.signerUuid)"' /path/to/neynar.json)
All scripts accept --api-key and --signer flags:
./scripts/fc_cast.sh --text "Hello" \
--api-key "neynar_abc..." \
--signer "signer_xyz..."
In your config.yaml, add Farcaster credentials:
gateway:
name: my-agent
env:
NEYNAR_API_KEY: ${NEYNAR_API_KEY}
NEYNAR_SIGNER_UUID: ${NEYNAR_SIGNER_UUID}
skills:
- path: ./skills/farcaster-skill
# Look up a user (no signer needed)
./skills/farcaster-skill/scripts/fc_user.sh --username "dwr"
Expected output: JSON with user profile data.
# Post a test cast (requires signer)
./skills/farcaster-skill/scripts/fc_cast.sh --text "Testing OpenClaw integration"
Expected output: JSON with the new cast’s hash.
Environment variable missing. Either:
export NEYNAR_API_KEY="..."--api-key "..."Required for write operations. Either:
export NEYNAR_SIGNER_UUID="..."--signer "..."The signer hasn’t been approved in Warpcast yet. Use the approval URL from signer creation.
Free tier has 1,000 calls/day. Check your usage in the Neynar dashboard or upgrade your plan.
Your agent needs a Farcaster account with its own FID. Options:
To find an account’s FID:
./skills/farcaster-skill/scripts/fc_user.sh --username "yourusername"
# Look for "fid" in the response
With credentials configured, proceed to 02-posting-casts.md to start posting.