Browse documentation

Integrations

Make

Read your AI-coding spend, savings, allowance and cost alerts from a Make scenario, and use the numbers anywhere Make can reach: a Google Sheet, a Teams message, an approval, a Slack digest.

No Lineman app to install, and none needed. Make's built-in HTTP module calls the Lineman API directly, so there is nothing to add to your organisation and nothing to keep updated. A dedicated Lineman app for Make is written but not published, because publishing an app to Make cannot be undone and that is a decision we have not taken yet.

Set it up

  1. 1In Lineman, go to Dashboard → Keys and create an API key, then copy it. It starts with fa_live_.
  2. 2In Make, add the HTTP module to a scenario and choose Make a request. Set the method to GET and the URL to the report you want, for example https://api.lineman.io/v1/spend/summary?days=30.
  3. 3Under Headers, add one header named Authorization with the value Bearer followed by a space and your key. The word Bearer belongs in the header, not in the key itself.
  4. 4Set Parse response to yes so Make turns the answer into fields you can map, then run the scenario once. Every field is then available to the modules that follow.

Store the key in a Make connection or a data store rather than typing it into each module. A key pasted into five modules is a key you have to change in five places, and a scenario's execution log keeps whatever you typed.

What you can read

Fourteen reports, all of them read-only. Nothing you can call from Make will change a budget, dismiss an alert or edit a cost centre. The full list is in the API reference; these are the four people start with:

  • Spend - /v1/spend/summary for the headline number and how it compares with the window before, /v1/spend/breakdown to split it by developer, repository, branch, ticket, model or cost centre.
  • Savings - /v1/savings/summary for what Lineman saved you in a calendar month.
  • Alerts - /v1/alerts for budget breaches and cost spikes, so a scenario can post them somewhere people will see them.
  • Allowance - /v1/allowance for how much of your plan's monthly tokens you have used, which is the usual trigger for a 'we are running low' scenario.

What the key can see

A scenario can do only what the person who created the key can do in Lineman. Their role, not the scenario, decides what comes back:

  • Administrator - company-wide figures, across every member and repository.
  • Auditor - the same company-wide figures.
  • Everyone else - their own spend and savings only.

Four reports fail rather than narrow. Alerts, company, members and cost centres return an error to a key that is not an administrator's or an auditor's, instead of quietly shrinking to one person's figures. That is deliberate: a narrowed number sitting in a finance report is worse than a scenario that stops. Every other report tells you which you got in its scope field.

Reading the numbers

  • Every amount comes back twice. One field ends in _usd and is meant for display; the other ends in _micro and is a whole number of millionths of a dollar, meant for arithmetic. Add up the _micro field and convert once at the end, because summing the display values across a long list drifts as the rounding accumulates. Lineman never returns cents.
  • Two fields are text that contains JSON, not fields you can map. An alert's detail and a cost centre's rules arrive as a string, because their contents differ from one row to the next. Run those two through Make's parseJSON() function before reading anything inside them.
  • Spend takes days, savings takes a month. Spend reports accept a days value from 1 to 92 and use 7 if you leave it out. Savings reports take a calendar month written as YYYY-MM instead. Anything longer than 92 days is refused rather than quietly truncated, so a bigger export has to be fetched in chunks.

Why there is no Lineman app in Make

There is one, written and tested against the same API this page describes, but it has not been published. Make cannot import an API description, so an app has to be built by hand in their editor, and publishing one is permanent: an app cannot be deleted or made private again afterwards. The faster of Make's two publishing routes also needs a signed partner agreement. Neither is a decision to take quietly, and the HTTP module above gives you everything the app would, so we have not taken them yet.