curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/usage/?date_from=2026-10-01&date_to=2026-10-31' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/usage/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
usage = requests.get(url, headers=headers, params={"date_from": "2026-10-01", "date_to": "2026-10-31"}).json()
print(usage["pages"], usage["error_pages"], usage["credits"])
from datetime import date
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
usage = client.get_workflow_usage(
"0686bb97-8c30-70f0-8000-97669e000eb8", date_from=date(2026, 10, 1), date_to=date(2026, 10, 31)
)
print(usage.pages, usage.error_pages, usage.credits)
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const usage = await af.getWorkflowUsage("0686bb97-8c30-70f0-8000-97669e000eb8", {
dateFrom: "2026-10-01",
dateTo: "2026-10-31",
});
console.log(usage.pages, usage.error_pages, usage.credits);
{
"pages": 1240,
"error_pages": 12,
"credits": 37200
}
{
"error": "Resource not found",
"detail": "Workflow not found",
"error_code": "NOT_FOUND",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
Get Workflow Usage
The pages and credits a workflow’s document runs were billed for over a range of days
curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/usage/?date_from=2026-10-01&date_to=2026-10-31' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/usage/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
usage = requests.get(url, headers=headers, params={"date_from": "2026-10-01", "date_to": "2026-10-31"}).json()
print(usage["pages"], usage["error_pages"], usage["credits"])
from datetime import date
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
usage = client.get_workflow_usage(
"0686bb97-8c30-70f0-8000-97669e000eb8", date_from=date(2026, 10, 1), date_to=date(2026, 10, 31)
)
print(usage.pages, usage.error_pages, usage.credits)
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const usage = await af.getWorkflowUsage("0686bb97-8c30-70f0-8000-97669e000eb8", {
dateFrom: "2026-10-01",
dateTo: "2026-10-31",
});
console.log(usage.pages, usage.error_pages, usage.credits);
{
"pages": 1240,
"error_pages": 12,
"credits": 37200
}
{
"error": "Resource not found",
"detail": "Workflow not found",
"error_code": "NOT_FOUND",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
pages and credits are what those runs were billed for, and error_pages are the pages of its runs that ended in error. The numbers are the workflow’s row on the usage page. See Usage & Billing.
Credits a workflow spends without a document are not counted here: knowledge asks, optimization proposals and edit-reference parses. They are on the invoice, so credits can be lower than the invoice’s total for the workflow.
Pick the days
date_from and date_to are days as YYYY-MM-DD in UTC, and both ends are included. Omit both for the workflow’s whole history, or one of them for an open range. A date_from after date_to answers 400 with error_code: VALIDATION_ERROR.
A charge counts on the day it was made, not on the day its document was uploaded. A document run again on a later day is billed again, and that charge lands on the later day. A deleted document still counts, because its charge stays on the invoice. An error page counts on the day its run started.
To count the pages of the documents uploaded on given days instead, add up usage.pages over List workflow runs filtered by upload day.
An unknown workflow, or one that belongs to another organization, answers 404 with error_code: NOT_FOUND.
curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/usage/?date_from=2026-10-01&date_to=2026-10-31' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/usage/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
usage = requests.get(url, headers=headers, params={"date_from": "2026-10-01", "date_to": "2026-10-31"}).json()
print(usage["pages"], usage["error_pages"], usage["credits"])
from datetime import date
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
usage = client.get_workflow_usage(
"0686bb97-8c30-70f0-8000-97669e000eb8", date_from=date(2026, 10, 1), date_to=date(2026, 10, 31)
)
print(usage.pages, usage.error_pages, usage.credits)
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const usage = await af.getWorkflowUsage("0686bb97-8c30-70f0-8000-97669e000eb8", {
dateFrom: "2026-10-01",
dateTo: "2026-10-31",
});
console.log(usage.pages, usage.error_pages, usage.credits);
{
"pages": 1240,
"error_pages": 12,
"credits": 37200
}
{
"error": "Resource not found",
"detail": "Workflow not found",
"error_code": "NOT_FOUND",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Path Parameters
Query Parameters
First day to count, inclusive, as YYYY-MM-DD in UTC. Omit to count from the start.
"2026-10-01"
Last day to count, inclusive, as YYYY-MM-DD in UTC. Omit to count up to now.
"2026-10-31"
Response
Successful Response
What a workflow's document runs processed: the workflow's row on the usage page.
Credits spent without a document (knowledge asks, optimization proposals and edit-reference parses) are not counted.
The pages the workflow's document runs billed, over the charges made on those days.
The pages of the runs that ended in error, over the runs started on those days.
The credits the workflow's document runs spent, over the charges made on those days.

