String docs

GET /usage

Read your organization's Web Access fetches, searches, browser sessions and spend with an API key, by day or hour.

AI agent? Read https://usestring.ai/agent-onboarding/SKILL.md first. It gets you your own API key with one browser click, and fetch and search work with no key.

Returns your organization's Web Access usage over a window you choose: fetches and searches with their successes, failures and spend, and browser sessions with theirs, in total and for every day or hour, plus your top 50 domains with how their requests were billed. Use it to pull usage into your own reporting on a schedule, with an API key instead of a portal sign-in.

GET https://request.usestring.ai/v1/usage

Authenticate with a Web Access API key that has the usage scope, as a Bearer token. Every key has it unless it was created with scopes that leave it out. The figures always cover the organization that owns the key, across all its keys. Reads are free and work with no balance left.

Query parameters

FieldTypeDefaultDescription
startdate or datetime—Required. Start of the window.
enddate or datetimenowEnd of the window, exclusive.
granularitystringdayday or hour.
domainstring—Only requests to this exact domain, as domains[].domain lists it (1–253 characters).

A date such as 2026-11-01 is midnight UTC. A datetime must carry Z or an offset, such as 2026-11-01T09:00:00Z; URL-encode a + offset as %2B. start rounds down and end rounds up to a whole UTC day or hour, and the window can span at most 31 days. With the default end, the last day or hour is still in progress. Any other parameter is rejected with a 400.

Example request

Usage for November 2026, by day:

curl --get 'https://request.usestring.ai/v1/usage' \
  --header "Authorization: Bearer $STRING_API_KEY" \
  --data-urlencode 'start=2026-11-01' \
  --data-urlencode 'end=2026-12-01' \
  --data-urlencode 'granularity=day'

Response

A 200, with the lists trimmed:

{
  "start": "2026-11-01T00:00:00Z",
  "end": "2026-12-01T00:00:00Z",
  "granularity": "day",
  "total": {
    "fetch": { "requests": 176412, "successes": 173296, "failures": 3116, "spend": 398.45 },
    "search": { "requests": 5928, "successes": 5725, "failures": 203, "spend": 6.87 },
    "browser": { "sessions": 214, "spend": 7.05 },
    "spend": 412.37
  },
  "days": [
    {
      "date": "2026-11-01",
      "fetch": { "requests": 5751, "successes": 5653, "failures": 98, "spend": 12.71 },
      "search": { "requests": 200, "successes": 194, "failures": 6, "spend": 0.23 },
      "browser": { "sessions": 7, "spend": 0.18 },
      "spend": 13.12
    }
  ],
  "domains": [
    {
      "domain": "example.com",
      "requests": 120400,
      "successes": 118950,
      "failures": 1450,
      "spend": 64.55,
      "billing": {
        "request_standard": { "requests": 104200, "spend": 26.05 },
        "request_premium": { "requests": 15800, "spend": 37.92 },
        "browser_premium": { "requests": 120, "spend": 0.58 },
        "not_billed": { "requests": 280, "spend": 0 }
      }
    },
    {
      "domain": "www.google.com",
      "requests": 5928,
      "successes": 5725,
      "failures": 203,
      "spend": 6.87,
      "billing": {
        "search": { "requests": 5725, "spend": 6.87 },
        "not_billed": { "requests": 203, "spend": 0 }
      }
    }
  ]
}
FieldDescription
start, endThe window the figures cover, in UTC, after rounding. end is exclusive.
granularityday or hour, as requested.
totalThe whole window's fetch, search, browser and spend, described below.
daysOne entry for every UTC day of the window, by date, with the same fields as total. A day with no usage reads as zero.
hoursWith granularity=hour, in place of days: one entry for every hour, by hour, such as 2026-11-01T09:00:00Z.
domainsUp to 50 destination domains by requests, each with its requests, successes, failures and spend, and the same requests and spend by billed type in billing. Site integration calls are listed as Site integration: <site>.

total and each day or hour have:

FieldDescription
fetchYour fetches, including browser-based fetches and site integration calls: requests, successes, failures and spend.
searchYour searches, with the same fields.
browserYour browser sessions: sessions and spend. null when you pass domain, since a session has no single domain.
spendThe total of the three.

billing lists only the types a domain used:

TypeBilled as
request_standard, request_premiumA request-based fetch on a standard or premium proxy
browser_standard, browser_premiumA browser-based fetch on a standard or premium proxy
searchA search
site_integrationA site integration call
not_billedNot billed, such as a request that failed
unrecordedNo type was recorded, as on requests from before billing recorded one
  • Spend is in USD. See Pricing for the rates.
  • A request counts once, however many times it was retried, and failures are the requests that did not succeed.
  • A type can show spend with no requests: each billed attempt of a retried request counts toward its spend, while the request itself counts once, under its last attempt's type.
  • With domain, only that domain's fetches and searches count.

Errors

StatusMeaningRetry
400A parameter is missing, invalid or unknown, or the window is longer than 31 days.After correcting the request
401No usable API key: code is missing_api_key, invalid_api_key or key_expired.After correcting the key
403The key doesn't have the usage scope: code is key_scope_missing.With a key that has it
429Over the usage limit (limit: "usage") or your organization's request rate (limit: "org_rate").After the Retry-After header's seconds
500The figures could not be read.Yes

None of them is billed. A 400 lists each problem in issues:

{
  "error": "Validation error",
  "message": "The window can span at most 31 days",
  "issues": [{ "field": "end", "message": "The window can span at most 31 days" }]
}

A 429 from the usage limit:

{
  "error": "Rate limit exceeded",
  "limit": "usage",
  "code": "usage_rate_limited",
  "message": "Usage reads are limited to 1 a second per organization. Retry in 1 second.",
  "retryable": true,
  "retry_after_seconds": 1,
  "next_actions": [{ "type": "docs", "url": "https://docs.usestring.ai/api-reference/rate-limits" }]
}

A 500:

{ "error": "Internal Server Error", "message": "Usage is unavailable" }

Limits

An organization can read usage once a second, across all its keys. A faster read returns 429 with limit: "usage"; retry after the Retry-After header's seconds. Each read also counts toward your organization's request rate.