What is relayfor.si?

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

GET

Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.

Request
curl https://relayfor.si/api/project/v1/usage \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Query

  • fromstring

    The first day, YYYY-MM-DD (UTC); default 6 days before `to`.

  • tostring

    The last day, YYYY-MM-DD (UTC); default today. At most 31 days in all.

  • accountstring

    Only this account's calls: acc_... or its token's mint.

  • keystring

    Only this key's calls: key_...

Answer

Answers 200 with Usage.

Example answer
{  "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
  • fromstringRequired

    The first day read, YYYY-MM-DD (UTC).

  • tostringRequired

    The last day read, YYYY-MM-DD (UTC).

  • dataobject[]Required

    One row per day, account, key and model.

    • daystringRequired

      The day, YYYY-MM-DD in UTC.

    • accountstringRequired

      The credit account: acc_...

    • keystringRequired

      The router key: key_...

    • modelstringRequired

      The model id the calls named.

    • callsintegerRequired

      Calls charged.

    • prompt_tokensintegerRequired

      Tokens read.

    • completion_tokensintegerRequired

      Tokens written, reasoning included.

    • reasoning_tokensintegerRequired

      Of those written, the model's thinking.

    • cached_tokensintegerRequired

      Of those read, served from the provider's cache at its lower price.

    • spent_usdstringRequired

      What the calls were charged: OpenRouter's cost + 20%.

  • totalsobjectRequired

    The rows added up.

    • callsintegerRequired

      Calls charged.

    • prompt_tokensintegerRequired

      Tokens read.

    • completion_tokensintegerRequired

      Tokens written.

    • spent_usdstringRequired

      What they were charged, in dollars.

Errors

A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.

On this page