Node.js API server powered by agent-core.
firecrawl create agent -t expressOr manually:
npm install
cp .env.example .env # fill in FIRECRAWL_API_KEY + provider key
npm run doctor # verify env vars
npm run dev # starts on http://localhost:3000See .env.example for the full list. Minimum:
FIRECRAWL_API_KEY=fc-... # required
GOOGLE_GENERATIVE_AI_API_KEY=AIza... # or ANTHROPIC_API_KEY / OPENAI_API_KEY
# MODEL=google:gemini-3-flash-preview (default, free tier)
All endpoints return JSON. CORS is enabled by default — override with CORS_ORIGIN.
Health + config overview. Handy for verifying setup in the browser.
curl http://localhost:3000/
# → {"status":"ok","model":"google:gemini-3-flash-preview","keys":["firecrawl","google"],"routes":{...}}Main endpoint — executes the agent.
curl -X POST http://localhost:3000/v1/run \
-H "Content-Type: application/json" \
-d '{"prompt": "Get pricing for Vercel", "format": "json"}'Parameters: prompt (required), stream, model, subAgentModel, format (json | markdown), schema, urls, skills, maxSteps.
Response shape: { text, data, format, steps, usage, durationMs, model }.
Preview the agent's execution plan without running it.
curl -X POST http://localhost:3000/v1/plan \
-H "Content-Type: application/json" \
-d '{"prompt": "compare Vercel vs Netlify pricing"}'
# → {"plan": "1. search for Vercel pricing page...\n2. scrape..."}List available skills.
curl http://localhost:3000/v1/skills
# → [{"name":"deep-research","description":"Multi-source research...","category":"Research"}, ...]Live progress of parallel workers during a run.
curl http://localhost:3000/v1/workers/progressSet stream: true for Server-Sent Events. Use curl -N for real-time output:
curl -N -X POST http://localhost:3000/v1/run \
-H "Content-Type: application/json" \
-d '{"prompt": "Get pricing for Vercel", "stream": true}'Each event is a JSON line: data: {"type":"text","content":"..."}\n\n
npm run dev # dev server with watch
npm start # production server
npm run doctor # verify env vars (no network calls)
npm run typecheck # tsc --noEmit
npm run example:basic # single prompt
npm run example:structured # JSON schema output
npm run example:parallel # parallel Subagents
npm run example:skills # load a Skill
npm run example:stream # streaming outputdocker build -t my-agent .
docker run -p 3000:3000 --env-file .env my-agentThe included Dockerfile is multi-stage (small final image), runs as a non-root user, and sets up a healthcheck on GET /.
Railway, Fly, Render, and any Node 22+ host work out of the box. The server handles SIGTERM gracefully, letting in-flight requests finish.