Skip to content
Hayonix

API reference · Billing

The rate-limit level: per-minute limits in force and what reaches the next level

GET/v1/orgs/{org_id}/billing/rate-level
API keybilling:readOrganization
TypeScript
client.billing.getRateLevel()
Python
client.billing.get_rate_level()
CLI
hayonix billing rate-limits

Inference and batch requests and tokens per minute (per model) come from the organization’s level. A level is reached by credit paid and kept and by account age, both at once; it rises by itself (right after a payment, and as the account ages) and never goes down by itself. A limit set for this organization by the platform wins over its level.

Project API key (Authorization: Bearer sk_…), or a console session. Requires the billing:read permission (a key's scope, or a role that includes it).

Examples

The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.

# The org of your key: GET /v1/caller
ORG_ID=$(curl -sS "$API_BASE_URL/caller" -H "Authorization: Bearer $API_KEY" | jq -r .org_id)

curl -sS "$API_BASE_URL/orgs/$ORG_ID/billing/rate-level" \
  -H "Authorization: Bearer $API_KEY"

Request

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.

Path parameters

  • org_idstring

    Your organization. The SDKs and the CLI fill it in from the API key.

    ID with prefix org_

Response

200 RateLevel — The rate-limit level

  • objectstringrequired

    Always `rate_level`: the type of this object

    One ofrate_level

  • org_idstringrequired

    Organization it belongs to

    ID with prefix org_

  • levelRateLevelRefrequired

    The level in force

    Show 2 fields of level
    • idstringrequired

      Level identifier

    • labelstringrequired

      Name to show

  • earnedany JSONrequired
    Show 2 fields of earned
    • idstringrequired

      Level identifier

    • labelstringrequired

      Name to show

  • set_by_platformbooleanrequired

    The platform set this organization’s level; it does not move by itself until that is lifted

  • limitsobjectrequired

    Per-minute limits in force, per model

    Show 4 fields of limits
    • inference_rpmRateLimitInForcerequired
      Show 2 fields of inference_rpm
      • limitintegerrequired

        The limit that applies now

      • sourcestringrequired

        `level`: from the organization’s level. `override`: set for this organization by the platform; it wins over the level.

        One ofleveloverride

    • inference_tpmRateLimitInForcerequired
      Show 2 fields of inference_tpm
      • limitintegerrequired

        The limit that applies now

      • sourcestringrequired

        `level`: from the organization’s level. `override`: set for this organization by the platform; it wins over the level.

        One ofleveloverride

    • batch_rpmRateLimitInForcerequired
      Show 2 fields of batch_rpm
      • limitintegerrequired

        The limit that applies now

      • sourcestringrequired

        `level`: from the organization’s level. `override`: set for this organization by the platform; it wins over the level.

        One ofleveloverride

    • batch_tpmRateLimitInForcerequired
      Show 2 fields of batch_tpm
      • limitintegerrequired

        The limit that applies now

      • sourcestringrequired

        `level`: from the organization’s level. `override`: set for this organization by the platform; it wins over the level.

        One ofleveloverride

  • progressRateLevelRequirementrequired

    Where the organization stands: credit paid and kept (refunds and open disputes deducted; promotional credit does not count) and account age

    Show 2 fields of progress
    • paid_creditstringrequired

      Credit paid by card and kept (nano-USD)

      pattern ^-?[0-9]+$

    • account_age_daysintegerrequired

      Days since the organization was created

  • nextobject | nullrequired

    The next level and what reaching it takes; null on the highest level

    Show 3 fields of next
    • levelRateLevelRefrequired

      The level in force

      Show 2 fields of level
      • idstringrequired

        Level identifier

      • labelstringrequired

        Name to show

    • requiresRateLevelRequirementrequired

      Where the organization stands: credit paid and kept (refunds and open disputes deducted; promotional credit does not count) and account age

      Show 2 fields of requires
      • paid_creditstringrequired

        Credit paid by card and kept (nano-USD)

        pattern ^-?[0-9]+$

      • account_age_daysintegerrequired

        Days since the organization was created

    • missingany JSONrequired
      Show 2 fields of missing
      • paid_creditstringrequired

        Credit paid by card and kept (nano-USD)

        pattern ^-?[0-9]+$

      • account_age_daysintegerrequired

        Days since the organization was created

  • levelsarray of objectrequired

    Every level, lowest first

    Show 3 fields of levels
    • levelRateLevelRefrequired

      The level in force

      Show 2 fields of level
      • idstringrequired

        Level identifier

      • labelstringrequired

        Name to show

    • requiresRateLevelRequirementrequired

      Where the organization stands: credit paid and kept (refunds and open disputes deducted; promotional credit does not count) and account age

      Show 2 fields of requires
      • paid_creditstringrequired

        Credit paid by card and kept (nano-USD)

        pattern ^-?[0-9]+$

      • account_age_daysintegerrequired

        Days since the organization was created

    • limitsRateLevelLimitsrequired
      Show 4 fields of limits
      • inference_rpmintegerrequired

        Inference requests per minute, per model

      • inference_tpmintegerrequired

        Inference tokens (prompt + completion) per minute, per model

      • batch_rpmintegerrequired

        Batch requests per minute, per model

      • batch_tpmintegerrequired

        Batch tokens per minute, per model

Example response
Example response
{
  "object": "rate_level",
  "org_id": "org_01jc5zq4m8k3v6x9t2w7r0b1e4",
  "level": {
    "id": "level_2",
    "label": "Level 2"
  },
  "earned": {
    "id": "level_2",
    "label": "Level 2"
  },
  "set_by_platform": true,
  "limits": {
    "inference_rpm": {
      "limit": 1,
      "source": "level"
    },
    "inference_tpm": {
      "limit": 1,
      "source": "level"
    },
    "batch_rpm": {
      "limit": 1,
      "source": "level"
    },
    "batch_tpm": {
      "limit": 1,
      "source": "level"
    }
  },
  "progress": {
    "paid_credit": "1500000000",
    "account_age_days": 1
  },
  "next": {
    "level": {
      "id": "level_2",
      "label": "Level 2"
    },
    "requires": {
      "paid_credit": "1500000000",
      "account_age_days": 1
    },
    "missing": {
      "paid_credit": "1500000000",
      "account_age_days": 1
    }
  },
  "levels": [
    {
      "level": {
        "id": "level_2",
        "label": "Level 2"
      },
      "requires": {
        "paid_credit": "1500000000",
        "account_age_days": 1
      },
      "limits": {
        "inference_rpm": 1,
        "inference_tpm": 1,
        "batch_rpm": 1,
        "batch_tpm": 1
      }
    }
  ]
}

Errors

Errors use the standard envelope. What this operation can answer:

Errors
StatusTypeWhen
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
402insufficient_credit_errorThe organization is out of credit or over a spend limit.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.