-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Describe the Bug
When polling the Get Agent Status endpoint (GET /v1/agent/{agentId}) while an agent job is in progress, the creditsUsed attribute is never included in the response. It only appears once the agent job reaches status=complete. This makes it impossible to track credit consumption in real time while a job is running.
To Reproduce
- Start an agent crawl job via
POST /v1/agent - Poll the agent status endpoint
GET /v1/agent/{agentId}while the job is still running (statusis notcomplete) - Observe that the
creditsUsedfield is missing from the response body - Wait for the job to complete (
status=complete) - Poll the status endpoint again —
creditsUsednow appears in the response
Expected Behavior
The creditsUsed attribute should be returned in the Get Agent Status response at all stages of the job lifecycle (e.g. processing, running, complete), reflecting the credits consumed so far. This would allow consumers to monitor credit usage in real time rather than only after completion.
Screenshots
N/A
Environment (please complete the following information):
- OS: macOS
- Deployment Type: Cloud (firecrawl.dev)
- Firecrawl Version: Latest (API)
- Node.js Version: N/A (using REST API directly)
Logs
N/A
Additional Context
The API documentation for Get Agent Status lists creditsUsed as a response field, but it is only populated when the job is complete. It would be helpful to either update the docs to clarify this limitation, or (preferably) return the running credit total at every status check.