Skip to content

Importing cloud usage costs

The server imports the usage charges of the providers listed in the setting billing_sources, or of a plugin for a provider it has no adapter of, every 24 hours and adds them to the instance’s costs. The default is empty, which imports nothing. It imports the charges of the current and the previous billing month (through the 15th of the month, or until the previous month is final), as one line per service and charge type (usage, credit, refund, tax, support, fee, other). Until the provider closes a month, the values are recorded as estimates; after it closes, as final; and when a value changes after it is final, as a correction. Records of the past are never rewritten. The state of the imports (the last success, the kind of the last failure, and the number of requests this month) is shown on the “Billing imports” page of “Costs and income” in the administration (/admin/finance/imports), which also lists each billing month as an estimate, final, or corrected, with “Import now”, and by GET /api/v1/admin/billing_imports. The metrics count every attempt by source, outcome, and kind of failure (my.billing.imports) and report the sources whose newest attempt failed (my.billing.import.failing); Alerts and runbook has the alert on them.

For AWS and Google Cloud, no credentials are kept in this server’s configuration. Give the runtime environment what the default credential chain of each provider’s SDK reads (for AWS, the execution role, environment variables, or shared credential files; for Google Cloud, Application Default Credentials). Cloudflare has no such chain, so its import reads an API token from billing_cloudflare_api_token.

On Google Cloud, the billing section of mycroblog-gcp sets billing_sources = gcp and does the parts of this guide that the provider’s API allows, with billing_account_id, method (bigquery or budget), and dataset_location. It imports Google Cloud’s costs alone. On AWS, the module billing-aws of the AWS example does the same for AWS’s costs. Neither has been applied on a real account yet.

Step in this guide With the modules
The IAM policy of AWS billing-aws
Enable Cost Explorer, Linked Account Access, cost allocation tags By hand, in the AWS console
The dataset of the export, and the roles of “IAM roles” The billing section
Enable the export (“Standard usage cost”) By hand, in the Google Cloud console, with a role on the billing account
The topic and the pull subscription of a budget, and the subscriber role The billing section with method = "budget"
Create the budget and connect it to the topic By hand, in the Google Cloud console, with a role on the billing account
Enable the BigQuery or Pub/Sub API By hand, as in Deploying on Cloud Run
AWS’s costs on Cloud Run Not by mycroblog-gcp. Create the role of Calling from Cloud Run with web identity by hand, and set billing_sources = aws and billing_aws_role_arn in settings, without the billing section
Cloudflare Not by these modules. On Cloud Run, without the billing section, set billing_sources, billing_cloudflare_account_id in settings, and billing_cloudflare_api_token in secrets, as for a plugin
A plugin Not by these modules. On Cloud Run, without the billing section, set billing_sources = plugin and the settings of the plugin in settings. Beside the billing section, the module refuses billing_sources in settings

The server calls GetCostAndUsage of AWS Cost Explorer once per billing month (a UTC calendar month), grouped by service (SERVICE) and record type (RECORD_TYPE). The endpoint is always us-east-1. Amounts are in USD. While Cost Explorer marks a month as estimated (Estimated), the server records the amount up to the previous day as an estimate, and once it no longer does, as final.

The Cost Explorer API charges $0.01 for each paginated request. A small account needs one request of one page a day, about $0.31 a month. To prevent unexpected charges, the server counts requests per UTC day (billing_aws_max_requests_per_day, default 4) and per UTC calendar month (billing_aws_max_requests_per_month, default 120 = $1.20), and stops without calling once a limit is reached. Scheduled imports, job retries, and “Import now” in the administration all count. An import that hits a limit is recorded as a failure of kind request_cap, and the import of the next day (for the daily limit) or of the first day of the next month (for the monthly limit) tries again. Before it calls, an import sets aside the requests that the limits leave, so imports that run at the same time cannot exceed the limits together. Imports of one provider run one at a time: an import that starts while another has not finished tries again a minute later, and a job that already imported successfully calls nothing when it runs again. An import that stopped before it finished (the process exited) counts the requests it set aside, and the next import waits for it for up to 15 minutes.

  1. Open Cost Explorer in the Billing and Cost Management console and enable it. It cannot be disabled once enabled. It takes up to 24 hours for data to be ready.
  2. An account where it is not enabled returns DataUnavailableException, and the import fails with not_enabled.

The only permission needed is ce:GetCostAndUsage (resource *).

{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": "ce:GetCostAndUsage", "Resource": "*" }
]
}

How to pass credentials in each runtime environment:

Runtime Credentials
AWS ECS Attach this policy to the task role. No configuration is needed
Google Cloud (Cloud Run) Create the IAM role of “Calling from Cloud Run with web identity” below and set its ARN in billing_aws_role_arn. No AWS keys are needed
Your own server Pass the access key of an IAM user with this policy in AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (or a shared credentials file and AWS_PROFILE). Pass it from a secret store

Missing permissions or invalid credentials fail with permission.

When billing_aws_role_arn is set, the server gets a Google ID token of the Cloud Run service account from the metadata server (the audience is the role’s ARN) and exchanges it for temporary credentials of that role with AssumeRoleWithWebIdentity.

  1. In Google Cloud, note the unique ID (the numeric uniqueId) of the service account of the Cloud Run service: gcloud iam service-accounts describe <email> --format='value(uniqueId)'.

  2. In AWS IAM, create a role with the policy of the permissions above, and make its trust policy trust accounts.google.com.

    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Principal": { "Federated": "accounts.google.com" },
    "Action": "sts:AssumeRoleWithWebIdentity",
    "Condition": {
    "StringEquals": {
    "accounts.google.com:aud": "<uniqueId of the service account>",
    "accounts.google.com:oaud": "<ARN of this role>"
    }
    }
    }
    ]
    }

    accounts.google.com:aud corresponds to the token’s azp (the service account’s ID), and accounts.google.com:oaud to the token’s aud (the audience the server requests, which is the role’s ARN).

  3. Set MY_BILLING_AWS_ROLE_ARN=arn:aws:iam::<account ID>:role/<role name>.

This setup has not yet been verified on a real account.

Calling from a linked account of Organizations

Section titled “Calling from a linked account of Organizations”

The management account of AWS Organizations can see the costs of every member account of the organization. To call with the credentials of a member (linked) account, turn on “Linked Account Access” in the management account’s Cost Explorer preferences. When it is off, the call is refused whatever the IAM permissions are, and the import fails with not_enabled or permission.

Choosing which costs to import (filtering)

Section titled “Choosing which costs to import (filtering)”

Choose with billing_aws_filter.

billing_aws_filter Costs imported Additional settings
none (default) Every cost the credentials can see None
linked_account The costs of the member accounts you name (LINKED_ACCOUNT) billing_aws_linked_accounts (12-digit account IDs, comma-separated)
tag The costs of resources that carry the cost allocation tag you name billing_aws_tag (key=value, for example app=my)

The most accurate setup is an AWS account dedicated to this server (it may be a member account of Organizations), imported with none (calling with that account’s credentials) or linked_account (calling from the management account). Taxes, support fees, and some credits cannot carry a tag, and may fall out of a tag filter (not yet verified on a real account).

Activating a cost allocation tag (billing_aws_filter = tag)

Section titled “Activating a cost allocation tag (billing_aws_filter = tag)”

A tag on a resource does not appear in the billing data until you activate it as a cost allocation tag.

  1. Put the same tag (for example app=my) on this server’s resources (ECS services, RDS, S3 buckets, load balancers, and so on).
  2. In “Cost allocation tags” of the Billing and Cost Management console, select the tag key and activate it. It takes up to 24 hours for a tag to show in this list after you attach it, and up to another 24 hours after activation for it to show in the billing data.
  3. To reflect the costs of the period before activation, use “Backfill” on the same screen (the API StartCostAllocationTagBackfill).
  4. Set MY_BILLING_AWS_FILTER=tag and MY_BILLING_AWS_TAG=app=my.

billing_aws_metric is either NetUnblendedCost (the default, closer to the invoice), which is after discounts (Savings Plans, reserved instances, negotiated prices), or UnblendedCost, which is before them. Cost Explorer’s values and the invoice can differ because of update timing and rounding. When they differ, the invoice is right.

Kind AWS response How to fix
permission AccessDeniedException, invalid credentials Check the IAM permissions and how the credentials are passed
not_enabled DataUnavailableException Enable Cost Explorer. For a linked account, enable Linked Account Access
not_found BillExpirationException Cost Explorer no longer has the billing data of the period to import
throttled LimitExceededException The job retries after a pause (it counts toward the request limit)
unavailable 5xx, network failure The job retries after a pause (it counts toward the request limit)
invalid_response An unreadable response, ValidationException, and the like Check the settings (tag, account IDs)
request_cap (no call is made) Wait for the limiting day or month to pass, or raise the limit

Retrying cannot fix a failure other than throttled and unavailable, so the server records it and stops, and the next day’s scheduled import tries again.

Google Cloud has no API that returns actual costs, so the server aggregates the Cloud Billing export to BigQuery (standard usage cost) once a day with a BigQuery jobs.query (billing_gcp_method = bigquery, the default). When you cannot set up the export, there is also a simple method that imports only an approximate total from the Pub/Sub notifications of a budget (see Importing from budget notifications). The billing month is the export’s invoice.month, a calendar month in US Pacific time (with daylight saving time). Dates are recorded in Pacific time as they are. Amounts are in the billing account’s currency, summed as NUMERIC per billing month, service (service.description), and charge type (cost_type), and credits (credits[]) become one credit line per service. The export’s correction rows that cancel earlier rows are part of the sum. The export has no mark for finality, so the import that runs from the 5th (Pacific time) of the next month treats the month as final, and until then records it as an estimate from the first day of the month to the day of the last usage. After it is final, the import still reads the month again until the 15th and records any difference as a correction.

One import is one query, and BigQuery bills the bytes each query scans (at least 10 MB). A small account scans about 0.3 GB a month, which fits the first 1 TiB a month of the free tier (shared with the billing account’s other uses), so it costs $0. To prevent unexpected scans, every query carries maximumBytesBilled (billing_gcp_max_bytes_billed, default 1 GiB). A query that would exceed it is not billed and fails, and it is recorded as a failure of kind bytes_cap. The administration shows the billed bytes.

The operator sets this up once, in the console (no way to set it through an API has been found).

  1. In a project linked to the billing account, create a BigQuery dataset (for example billing_export). Choose a multi-region location (US or EU). The data of the current and the previous month is backfilled (with a single region, the data starts the day you enable it). The location cannot be changed later. Do not set an expiration on the tables. Rows that expire do not come back.
  2. Under “Billing > Billing export > BigQuery export”, enable “Standard usage cost” and select the dataset of step 1. The setup needs “Billing Account Costs Manager” or “Billing Account Administrator” on the billing account and the BigQuery User role on the project.
  3. After a few hours to a day, the table gcp_billing_export_v1_<BILLING_ACCOUNT_ID> is created (the hyphens of the ID become _).
  4. Set MY_BILLING_GCP_TABLE=<project>.billing_export.gcp_billing_export_v1_<BILLING_ACCOUNT_ID>.

When the dataset or the table cannot be found, the import fails with not_found.

Give the importing server’s service account these two roles.

Role Where to grant it Use
roles/bigquery.jobUser (BigQuery Job User) The project that runs the query (billing_gcp_query_project, or the table’s project when empty) bigquery.jobs.create. The scanned bytes are billed to this project
roles/bigquery.dataViewer (BigQuery Data Viewer) The export’s dataset bigquery.tables.getData
Terminal window
gcloud projects add-iam-policy-binding <query project> \
--member=serviceAccount:<service account> --role=roles/bigquery.jobUser
bq add-iam-policy-binding --member=serviceAccount:<service account> \
--role=roles/bigquery.dataViewer <project>:billing_export

When the BigQuery API is not enabled in the query project, the import fails with not_enabled, and when a role is missing, with permission.

Authentication is Application Default Credentials (ADC).

Runtime Credentials
Google Cloud (Cloud Run) ADC with the service’s service account. No key and no configuration
AWS ECS Place a credential configuration file of Workload Identity Federation (the AWS type) and pass its path in GOOGLE_APPLICATION_CREDENTIALS (not yet verified on a real account)
Your own server Workload Identity Federation, or a service account JSON key passed in GOOGLE_APPLICATION_CREDENTIALS. Pass a key from a secret store

Choosing which costs to import (filtering)

Section titled “Choosing which costs to import (filtering)”

By default the server imports every cost of the billing account. The most accurate setup is a billing account dedicated to this server, imported without filters.

Setting Costs imported
billing_gcp_projects (project IDs, comma-separated) The costs of the projects you name (project.id)
billing_gcp_label (key=value, for example app=my) The costs of resources that carry the label you name (labels)

When you set both, the server imports only the costs that match both. Costs at the level of the invoice, such as tax, may carry neither a project nor a label, and then fall out of the filter (not yet verified on a real account).

Kind BigQuery response How to fix
permission 401, 403 (accessDenied) Check the service account’s roles and how the credentials are passed
not_enabled 403 (accessNotConfigured and the like) Enable the BigQuery API in the query project
not_found 404 Check billing_gcp_table and the export setup
bytes_cap 400 (bytesBilledLimitExceeded) The scan exceeded billing_gcp_max_bytes_billed. Raise the limit if the table is large
throttled 429, 403 (rateLimitExceeded, quotaExceeded) The job retries after a pause
unavailable 5xx, network failure, a query that does not finish The job retries after a pause
invalid_response An unreadable response, rows that mix currencies within a month, any other 400 Check the export table (is it the standard usage cost?)

Retrying cannot fix a failure other than throttled and unavailable, so the server records it and stops, and the next day’s scheduled import tries again.

Importing from budget notifications (billing_gcp_method = budget)

Section titled “Importing from budget notifications (billing_gcp_method = budget)”

This is a simple method for when you cannot set up the BigQuery export. Once a day, the server reads from a pull subscription the notifications that a Cloud Billing budget sends to a Pub/Sub topic. It uses pull rather than push, so a notification never wakes the server (Cloud Run, for example).

This method imports only an approximate total based on estimates.

  • A notification’s costAmount is the estimated cumulative cost of the budget period, with no breakdown by service or charge type. The server imports only one line per month and budget (the service name is the budget’s display name, the charge type is usage, and the category is other). Credits and taxes are in the total as the budget is configured.
  • As with BigQuery, a month becomes final in the import that runs from the 5th (Pacific time) of the next month. A budget notification knows nothing about the invoice closing, so even a value treated as final can differ from the invoice amount.
  • An estimated month is recorded as the cost from the first day of the month to the day (Pacific time) the last notification was published.
  • Filtering is decided by the budget’s scope (projects, services, one label key and value), and billing_gcp_projects and billing_gcp_label are not used.

Prepare the budget, the topic, and the subscription

Section titled “Prepare the budget, the topic, and the subscription”
  1. Create a topic and a pull subscription that only this server reads. See “How notifications are read” below for the reasons behind the retention period and the expiration.

    Terminal window
    gcloud pubsub topics create billing-budget --project=<project>
    gcloud pubsub subscriptions create my-billing-budget --project=<project> \
    --topic=billing-budget --ack-deadline=60 \
    --message-retention-duration=31d --expiration-period=never
  2. In the console, under “Billing > Budgets & alerts”, create a budget. Make its period monthly (a notification of a budget that is not monthly fails with invalid_response). Select this server’s project as the scope, and under “Manage notifications > Connect a Pub/Sub topic to this budget” select the topic of step 1. Creating the budget needs “Billing Account Costs Manager” or “Billing Account Administrator” on the billing account, and pubsub.topics.setIamPolicy and pubsub.topics.list on the topic’s project. The first notification takes a few hours to arrive, and after that several arrive a day.

  3. Give the importing server’s service account roles/pubsub.subscriber (Pub/Sub Subscriber) on the subscription. It is used to pull messages and acknowledge them (pubsub.subscriptions.consume).

    Terminal window
    gcloud pubsub subscriptions add-iam-policy-binding my-billing-budget --project=<project> \
    --member=serviceAccount:<service account> --role=roles/pubsub.subscriber
  4. Set MY_BILLING_GCP_METHOD=budget and MY_BILLING_GCP_BUDGET_SUBSCRIPTION=projects/<project>/subscriptions/my-billing-budget.

Authentication is the same Application Default Credentials as for BigQuery (see the table in IAM roles above).

  • One import repeats Pull until no new message arrives, and takes, for each budget and month, the notification with the latest publish time. This absorbs duplicate Pub/Sub deliveries, repeated notifications with the same value, and reordering, so receiving the same notification many times counts once in the total. The number of requests counted for an import is the number of Pulls, normally two: one that returns messages and one that comes back empty. The acknowledgments made at the end (Acknowledge, ModifyAckDeadline) are not counted.
  • The server acknowledges (acks) only a notification that a newer notification of the same budget and month has replaced, and a notification of a month that is no longer imported (the previous month, once it has been recorded as final). The latest notification of an imported month is not acked but returned to the subscription, so the next import reads the same notification again, and the value does not change on a day with no new notification.
  • Therefore, set the subscription’s message retention to at least 14 days (31 days recommended). The last notification of a month’s budget arrives around the 2nd of the next month, and the previous month is read again until the 15th. A month whose notifications have expired is recorded as a cost of 0.
  • By default a subscription expires after 31 days without use. Set the expiration to “never” so that it survives a period in which imports were stopped.
  • Do not send other messages to the topic. A message that cannot be read as a budget notification fails that import with invalid_response, and is acked so that the next import does not stall on it.
  • Cost: a few dozen messages a day fit the Pub/Sub free tier (10 GiB a month), so it costs $0. The server sets no limit.
Kind Pub/Sub response How to fix
permission PERMISSION_DENIED, UNAUTHENTICATED Check roles/pubsub.subscriber on the subscription and how the credentials are passed
not_enabled PERMISSION_DENIED (SERVICE_DISABLED) Enable the Pub/Sub API in the subscription’s project
not_found NOT_FOUND Check billing_gcp_budget_subscription and whether the subscription has expired
throttled RESOURCE_EXHAUSTED The job retries after a pause
unavailable UNAVAILABLE, INTERNAL, and the like, network failure The job retries after a pause
invalid_response A message that cannot be read as a budget notification, a budget that is not monthly, two budgets with the same display name Make the budget monthly, give the budgets distinct display names, and send no other messages to the topic

The server reads the billable usage of a Cloudflare account: the usage charges of its pay-as-you-go products, such as R2, Workers, and D1, one record per metric and day. It sums them by product (R2, Workers, D1) into UTC calendar months, so each product is one usage line a month. Usage within a free allowance is imported too, at 0. Only an account billed pay-as-you-go has this data; an Enterprise contract account fails with not_enabled.

Cloudflare’s billable usage holds usage charges alone. Plans and add-ons with a fixed fee (Pro, Business, Workers Paid, and the like), taxes, and credits are not in it, so the costs show only the usage part of the invoice. Add the fixed fees as costs of your own on the “Costs” page of “Costs and income” (/admin/finance/costs), or import them from a plugin.

Cloudflare bills in cycles that start on the same day of every month, the day of the account’s first purchase, in UTC (a cycle that would start on the 31st starts on the last day of a shorter month). The invoice of a cycle comes when the cycle ends, so a calendar month spans parts of two cycles. The server reads each cycle that overlaps the months it imports and places every daily record in the calendar month of its day, so a month’s lines are the charges of its own days, not of one invoice. A month is final once the cycle that holds its last day has ended two days ago, or once the next month is over, whichever comes first. Until then it is an estimate from the first of the month to the last day with data. Cloudflare’s data runs a day or two behind.

Cloudflare does not bill its API, so the server sets no cap on the requests. An import makes one request for the account’s subscriptions and one for each billing cycle it reads: up to four for two months. The API allows 1,200 requests every five minutes per user, shared with the dashboard and your other uses of the token’s owner.

  1. In the Cloudflare dashboard, open the account, and note its account ID on the account’s overview (32 hexadecimal digits).
  2. Under “Manage Account” → “Account API Tokens” (or “My Profile” → “API Tokens”), create a custom token with the single permission Account → Billing → Read, for this account only.
  3. Set MY_BILLING_SOURCES=cloudflare, MY_BILLING_CLOUDFLARE_ACCOUNT_ID=<account ID>, and MY_BILLING_CLOUDFLARE_API_TOKEN=<token>, the token from a secret store (or MY_BILLING_CLOUDFLARE_API_TOKEN_FILE).

Give the import a token of its own. The server never reads CLOUDFLARE_API_TOKEN, which Wrangler and the OpenTofu provider use, so a token that can edit DNS or Workers is not picked up by mistake.

Kind Cloudflare response How to fix
permission 400 with code 9106 (an invalid token), 401, 403 (the token lacks Billing Read, or the account ID is wrong: Cloudflare answers both with code 10000) Check the token’s permission and billing_cloudflare_account_id
not_enabled The account’s billable usage is not covered The account is not billed pay-as-you-go (an Enterprise contract), so there is nothing to import
not_found 404 Check billing_cloudflare_account_id
throttled 429 The job retries after a pause
unavailable 5xx, network failure The job retries after a pause
invalid_response An unreadable response, a record over more than one day, two currencies in one month Cloudflare changed its answer; report it

Retrying cannot fix a failure other than throttled and unavailable, so the server records it and stops, and the next day’s scheduled import tries again.

For a provider that the server has no adapter of, such as Azure, Hetzner, or Sakura, run a plugin of the kind billing and let it read the provider’s data. The server has one plugin source. A plugin with several providers aggregates them itself and tells them apart by the names of its services.

billing_sources = "plugin"
plugin_billing_address = "unix:///run/my/billing.sock"
plugin_billing_location = "Europe/Berlin"
plugin_billing_provider = "Hetzner"

The three settings are required with this source, and the server starts without calling the plugin, even when it is down.

  • plugin_billing_location is the time zone that cuts the plugin’s billing months.
  • plugin_billing_provider is the name of the provider in the totals, on the billing imports page, and in the audit log.

The server asks the plugin for the current month and, as with the other sources, for the previous one through the 15th or until it is final. The caps of the other sources do not apply: max_requests is 2147483647, which means no cap, and the plugin decides what it may spend. It reports the requests and the bytes it was billed for, which the server records and shows.

The kind allows plain TCP, with a warning at start, since it carries only costs. A bearer token needs https:// or a Unix socket: see the destination of a plugin.

With plugin_billing_protocol = json, the default, a plugin needs an HTTP server and a JSON library alone (A plugin with no library). Fetch lasts 2 minutes at most, or plugin_billing_timeout, below 5 minutes.

POST /my.plugin.billing.v1.BillingService/Fetch
Content-Type: application/json
{"months":["2026-09","2026-10"],"maxRequests":2147483647}
HTTP/1.1 200 OK
Content-Type: application/json
{
"outcome": "OUTCOME_OK",
"requests": 1,
"lines": [
{
"month": "2026-09",
"coveredStart": "2026-09-01",
"coveredEnd": "2026-09-30",
"service": "Hetzner Cloud",
"chargeType": "CHARGE_TYPE_USAGE",
"category": "CATEGORY_COMPUTE",
"amount": "12.3456",
"currency": "EUR",
"final": true
}
]
}
  • A line is one month, service, and charge type, with its offsetting lines, credits, and refunds summed. service has at most 200 characters and no control characters.
  • coveredStart and coveredEnd are inside the month: the whole month when final is true, up to the last day with data before.
  • amount is an unrounded decimal in major units, which may be negative. currency is an ISO 4217 code.
  • chargeType is CHARGE_TYPE_ and one of USAGE, CREDIT, REFUND, TAX, SUPPORT, FEE, ADJUSTMENT, OTHER.
  • category is CATEGORY_ and one of COMPUTE, DATABASE, STORAGE, NETWORK, DOMAIN, EMAIL, SOFTWARE, OTHER.
  • requests is at most maxRequests. bytesBilled is a decimal string, for a provider that bills by bytes.
  • A key that OUTCOME_OK does not return has no cost in its month, so the server records a revision of 0 for it. A plugin that could not read a provider must report a failure, not leave its lines out.
  • Calls may repeat: a retry of a failed import is the same call again.

maxRequests 0 forbids any billed request. The server makes no call when it would send 0, but my plugin test --kind billing does, with the field left out as proto3’s mapping allows, and expects OUTCOME_REQUEST_CAP with no lines and no requests.

A plugin reports a failure in outcome. The server keeps the requests of a failure, ignores its lines, and leaves the earlier imports as they are, as with the other sources.

Outcome Kind Retried
OUTCOME_PERMISSION permission No
OUTCOME_NOT_ENABLED not_enabled No
OUTCOME_NOT_FOUND not_found No
OUTCOME_THROTTLED throttled Yes
OUTCOME_REQUEST_CAP request_cap No
OUTCOME_BYTES_CAP bytes_cap No
OUTCOME_INVALID_RESPONSE invalid_response No
OUTCOME_UNAVAILABLE unavailable Yes
A missing or unknown outcome, or a line or count that breaks the rules above invalid_response No
An HTTP or Connect error, a deadline, an answer over 4 MiB, no answer unavailable Yes

What is not retried waits for the next daily import. A failure’s reason is in the plugin’s log, since the server drops the message of an error, and it also counts in my.plugin.failures.

Terminal window
my plugin test --kind billing unix:///run/my/billing.sock
my plugin test --kind billing --billed unix:///run/my/billing.sock

The first makes no billed request if the plugin follows the contract. The second also makes a real fetch, which may cost money at the plugin’s providers. See Test a plugin.

For LLMs and coding agents:this page as Markdown, llms.txt,llms-full.txt, llms-small.txt

Analytics on this site