DOCUMENT · 1.4 KB
vendor/OpenMontage/.agents/skills/bfl-api/references/api-key-setup.md
Workspace snapshot · 09/04 14:52
name: api-key-setup description: How to obtain and configure a BFL API key
API Key Setup
Important: Always verify your API key before attempting image generation. Missing or invalid keys result in "Not authenticated" errors.
Quick Validation
Run this first to check if your key is configured and valid:
# Check if key is set
[ -z "$BFL_API_KEY" ] && echo "Error: BFL_API_KEY not set" || echo "OK: Key configured"
If not set, follow the steps below.
Get a Key
- Go to https://dashboard.bfl.ai/get-started
- Click "Create Key"
- Select organization (ask user if multiple options)
- Copy the key (starts with
bfl_)
For Agents Making Direct API Calls
When BFL_API_KEY is not set in the current session:
-
Check for existing
.env:grep BFL_API_KEY .env 2>/dev/null -
If found, export it:
export BFL_API_KEY=$(grep BFL_API_KEY .env | cut -d '=' -f2) -
If not found, ask the user for their key:
"I need a BFL API key to generate images. Please:
- Go to https://dashboard.bfl.ai/get-started
- Click 'Create Key' and copy it
- Paste it here"
-
Save and export:
echo 'BFL_API_KEY=bfl_provided_key' >> .env echo '.env' >> .gitignore export BFL_API_KEY=bfl_provided_key
Now $BFL_API_KEY is available for direct curl/API calls in the session.