Usage
Router usage by day, account, key and model.
What the RFS Router charged, one row per day, account, key and model, in UTC days. The dashboard's Usage page draws the same numbers.
Get usage
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/usage \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Query
fromstringThe first day, YYYY-MM-DD (UTC); default 6 days before `to`.
tostringThe last day, YYYY-MM-DD (UTC); default today. At most 31 days in all.
accountstringOnly this account's calls: acc_... or its token's mint.
keystringOnly this key's calls: key_...
Answer
Answers 200 with Usage.
{ "from": "2026-10-01", "to": "2026-10-07", "data": [ { "day": "2026-10-07", "account": "acc_arqp1qhbpvjhzifE", "key": "key_5128eNz6OrSZ3e1e", "model": "anthropic/claude-sonnet-5.5", "calls": 214, "prompt_tokens": 401220, "completion_tokens": 52806, "reasoning_tokens": 0, "cached_tokens": 188400, "spent_usd": "1.204112" } ], "totals": { "calls": 214, "prompt_tokens": 401220, "completion_tokens": 52806, "spent_usd": "1.204112" }}Its fields
fromstringRequiredThe first day read, YYYY-MM-DD (UTC).
tostringRequiredThe last day read, YYYY-MM-DD (UTC).
dataobject[]RequiredOne row per day, account, key and model.
daystringRequiredThe day, YYYY-MM-DD in UTC.
accountstringRequiredThe credit account: acc_...
keystringRequiredThe router key: key_...
modelstringRequiredThe model id the calls named.
callsintegerRequiredCalls charged.
prompt_tokensintegerRequiredTokens read.
completion_tokensintegerRequiredTokens written, reasoning included.
reasoning_tokensintegerRequiredOf those written, the model's thinking.
cached_tokensintegerRequiredOf those read, served from the provider's cache at its lower price.
spent_usdstringRequiredWhat the calls were charged: OpenRouter's cost + 20%.
totalsobjectRequiredThe rows added up.
callsintegerRequiredCalls charged.
prompt_tokensintegerRequiredTokens read.
completion_tokensintegerRequiredTokens written.
spent_usdstringRequiredWhat they were charged, in dollars.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.