Lingara Lingara Docs Guides API Libraries Apps Build Web app
Language: English

Get your remaining allowance

API version 2026-10-affable-towhee

get https://api.getlingara.com/v1/usage

Lists each allowance that applies to your account, with how much is used and when it resets.

Scopes usage:read

Parameters

Lingara-Versionheaderstringoptional
The API version to answer this request under. Without it, an access token gets the version its client is pinned to, and a request with no token gets the current version. The version still in development is reached only by naming it here. An unknown version answers 400 with code api_version_unknown. GET /v1/versions lists the versions.

Responses

200 Your allowance

allowancearray of AllowanceRowrequired
featurestringrequired
windowstringrequired
limitintegerrequired
usedintegerrequired
remainingintegerrequired
reset_atinteger | nulloptional
ledgerUsageLedger | nulloptional

This client's calls and units since midnight UTC on the first of the month. Present only for a metered client, whose calls spend no allowance. It can trail your latest call by up to five seconds.

sincestringrequired
callsintegerrequired
unitsintegerrequired

Errors

410application/json
The API version this request is answered under has been discontinued. Send a supported version in Lingara-Version, or re-pin the client.
4XXapplication/json
The request was refused. code says why, and error says it in words.
503application/json · text/plain
The service is temporarily unavailable; retry after the number of seconds in Retry-After. During maintenance the body is plain text rather than the error envelope.
5XXapplication/json
The request was refused. code says why, and error says it in words.
codestringrequired

Why the request was refused, as a stable code to branch on: for example insufficient_scope (403), rate_limited (429) and, for a metered client, spend_cap_reached (402) and metered_billing_inactive (402).

errorstringrequired

Example

Code sample language

curl

curl "https://api.getlingara.com/v1/usage" \
  -H "Authorization: Bearer $LINGARA_TOKEN"

TypeScript

const usage = await client.getUsage();
for (const row of usage.allowance) {
  console.log(row.feature, row.window, `${row.remaining} of ${row.limit} left`);
}

Rust

let usage = client.get_usage().await?;
for row in &usage.allowance {
    println!("{} {}: {} of {} left", row.feature, row.window, row.remaining, row.limit);
}

Go

usage, err := client.GetUsage(ctx)
if err != nil {
	return err
}
for _, row := range usage.Value.Allowance {
	fmt.Printf("%s (%s): %d of %d left\n", row.Feature, row.Window, row.Remaining, row.Limit)
}

Java

import com.getlingara.client.model.AllowanceRow;
import com.getlingara.client.model.Usage;

Usage usage = client.getUsage().body();
for (AllowanceRow row : usage.getAllowance()) {
  System.out.println(
      row.getFeature()
          + " ("
          + row.getWindow()
          + "): "
          + row.getRemaining()
          + " of "
          + row.getLimit()
          + " left");
}

Kotlin

val usage = client.getUsage().body
for (row in usage.allowance) {
    println("${row.feature} (${row.window}): ${row.remaining} of ${row.limit} left")
}

Ruby

usage = client.get_usage.value
usage.allowance.each { |row| puts "#{row.feature} (#{row.window}): #{row.remaining} of #{row.limit} left" }
puts "#{usage.ledger.calls} calls this month" if usage.ledger

PHP

foreach ($client->getUsage()->value->getAllowance() as $row) {
    echo $row->getFeature(), ': ', $row->getRemaining(), ' of ', $row->getLimit(), ' left this ', $row->getWindow(), "\n";
}

Prefer a library? See the Libraries section.