Skip to content
Product Docs

Get Organization Usage

client.organizations.getUsage(stringorganizationID, OrganizationGetUsageParams { get_current_invoice_total } query?, RequestOptionsoptions?): UsageAndPlan { plan, usage }
GET/api/v1/organizations/{organization_id}/usage

Get usage for a specific organization.

ParametersExpand Collapse
organizationID: string
query: OrganizationGetUsageParams { get_current_invoice_total }
get_current_invoice_total?: boolean
ReturnsExpand Collapse
UsageAndPlan { plan, usage }
plan: Plan { limits, name, plan_frequency, 7 more }
limits: Limits { allow_pay_as_you_go, max_concurrent_index_jobs, max_concurrent_parse_jobs_other, 24 more }
allow_pay_as_you_go: boolean

Whether usage is allowed after credit grants are exhausted

max_concurrent_index_jobs: number | null
max_concurrent_parse_jobs_other: number | null
max_concurrent_parse_jobs_premium: number | null
max_data_sinks: number | null
max_data_sources: number | null
max_embedding_models: number | null
max_extraction_agents: number | null
max_extraction_jobs: number | null
max_extraction_runs: number | null
max_files_per_index: number | null
max_indexes: number | null
max_monthly_invoice_total_usd: number | null
max_organizations: number | null
max_pages_per_index: number | null
max_projects: number | null
max_published_agents: number | null
max_report_agent_sessions: number | null
max_users: number | null
mfa_enabled: boolean
sso_enabled: boolean
subscription_cost_usd: number
max_directories?: number | null
max_directory_files_per_directory?: number | null
max_directory_ingest_files?: number | null
max_directory_sync_plan_actions?: number | null
spending_soft_alerts_usd_cents?: Array<number> | null

The amount of USD cents at which a soft alert should be triggered

name: "enterprise" | "enterprise_contract" | "enterprise_poc" | 12 more
One of the following:
"enterprise"
"enterprise_contract"
"enterprise_poc"
"free"
"free_contract"
"free_v1"
"free_v2"
"llama_parse"
"pro"
"pro_v1"
"pro_v2"
"starter_v1"
"starter_v2"
"unknown"
"yc_deal_v1"
plan_frequency: "ANNUAL" | "MONTHLY" | "QUARTERLY"
One of the following:
"ANNUAL"
"MONTHLY"
"QUARTERLY"
id?: string | null

The ID of the plan in Metronome

current_billing_period?: CurrentBillingPeriod | null

The current billing period

end_date: string
start_date: string
ending_before?: string | null

The date the plan ends on

formatdate-time
failure_count?: number

The number of payment failures for this organization

is_payment_failed?: boolean

Whether the organization has a failed payment that requires support contact

recurring_credits?: Array<RecurringCredit> | null
credit_amount: number
credit_type: CreditType { id, name }
id: string
name: string
name: string
priority: number
product_id: string

The ID of the product in Metronome used to represent the credit grant

rollover_fraction: number

The fraction of the credit that will roll over to the next period, between 0 and 1

periods_duration?: number

How many billing periods the credit grant will last for

starting_on?: string | null

The date the plan starts on

formatdate-time
usage: Usage { active_alerts, active_free_credits_usage, current_invoice_total_usd_cents, 4 more }

Account usage totals shown alongside the plan.

active_alerts?: Array<"configured_spend_limit_exceeded" | "free_credits_exhausted" | "has_spending_alert" | 3 more>
One of the following:
"configured_spend_limit_exceeded"
"free_credits_exhausted"
"has_spending_alert"
"internal_spending_alert"
"plan_spend_limit_exceeded"
"plan_spend_limit_soft_alert"
active_free_credits_usage?: Array<ActiveFreeCreditsUsage>
expires_at: string
grant_name: string
remaining_balance: number
starting_balance: number
current_invoice_total_usd_cents?: number | null
total_extraction_agents?: number
total_indexed_pages?: number
total_indexes?: number
total_users?: number

Get Organization Usage

import LlamaCloudAdmin from '@llamaindex/llama-cloud-admin';

const client = new LlamaCloudAdmin({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const usageAndPlan = await client.organizations.getUsage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(usageAndPlan.plan);
{
  "plan": {
    "limits": {
      "allow_pay_as_you_go": true,
      "max_concurrent_index_jobs": 0,
      "max_concurrent_parse_jobs_other": 0,
      "max_concurrent_parse_jobs_premium": 0,
      "max_data_sinks": 0,
      "max_data_sources": 0,
      "max_embedding_models": 0,
      "max_extraction_agents": 0,
      "max_extraction_jobs": 0,
      "max_extraction_runs": 0,
      "max_files_per_index": 0,
      "max_indexes": 0,
      "max_monthly_invoice_total_usd": 0,
      "max_organizations": 0,
      "max_pages_per_index": 0,
      "max_projects": 0,
      "max_published_agents": 0,
      "max_report_agent_sessions": 0,
      "max_users": 0,
      "mfa_enabled": true,
      "sso_enabled": true,
      "subscription_cost_usd": 0,
      "max_directories": 0,
      "max_directory_files_per_directory": 0,
      "max_directory_ingest_files": 0,
      "max_directory_sync_plan_actions": 0,
      "spending_soft_alerts_usd_cents": [
        0
      ]
    },
    "name": "enterprise",
    "plan_frequency": "ANNUAL",
    "id": "id",
    "current_billing_period": {
      "end_date": "2019-12-27T18:11:19.117Z",
      "start_date": "2019-12-27T18:11:19.117Z"
    },
    "ending_before": "2019-12-27T18:11:19.117Z",
    "failure_count": 0,
    "is_payment_failed": true,
    "recurring_credits": [
      {
        "credit_amount": 0,
        "credit_type": {
          "id": "id",
          "name": "name"
        },
        "name": "name",
        "priority": 0,
        "product_id": "product_id",
        "rollover_fraction": 0,
        "periods_duration": 0
      }
    ],
    "starting_on": "2019-12-27T18:11:19.117Z"
  },
  "usage": {
    "active_alerts": [
      "configured_spend_limit_exceeded"
    ],
    "active_free_credits_usage": [
      {
        "expires_at": "2019-12-27T18:11:19.117Z",
        "grant_name": "grant_name",
        "remaining_balance": 0,
        "starting_balance": 0
      }
    ],
    "current_invoice_total_usd_cents": 0,
    "total_extraction_agents": 0,
    "total_indexed_pages": 0,
    "total_indexes": 0,
    "total_users": 0
  }
}
Returns Examples
{
  "plan": {
    "limits": {
      "allow_pay_as_you_go": true,
      "max_concurrent_index_jobs": 0,
      "max_concurrent_parse_jobs_other": 0,
      "max_concurrent_parse_jobs_premium": 0,
      "max_data_sinks": 0,
      "max_data_sources": 0,
      "max_embedding_models": 0,
      "max_extraction_agents": 0,
      "max_extraction_jobs": 0,
      "max_extraction_runs": 0,
      "max_files_per_index": 0,
      "max_indexes": 0,
      "max_monthly_invoice_total_usd": 0,
      "max_organizations": 0,
      "max_pages_per_index": 0,
      "max_projects": 0,
      "max_published_agents": 0,
      "max_report_agent_sessions": 0,
      "max_users": 0,
      "mfa_enabled": true,
      "sso_enabled": true,
      "subscription_cost_usd": 0,
      "max_directories": 0,
      "max_directory_files_per_directory": 0,
      "max_directory_ingest_files": 0,
      "max_directory_sync_plan_actions": 0,
      "spending_soft_alerts_usd_cents": [
        0
      ]
    },
    "name": "enterprise",
    "plan_frequency": "ANNUAL",
    "id": "id",
    "current_billing_period": {
      "end_date": "2019-12-27T18:11:19.117Z",
      "start_date": "2019-12-27T18:11:19.117Z"
    },
    "ending_before": "2019-12-27T18:11:19.117Z",
    "failure_count": 0,
    "is_payment_failed": true,
    "recurring_credits": [
      {
        "credit_amount": 0,
        "credit_type": {
          "id": "id",
          "name": "name"
        },
        "name": "name",
        "priority": 0,
        "product_id": "product_id",
        "rollover_fraction": 0,
        "periods_duration": 0
      }
    ],
    "starting_on": "2019-12-27T18:11:19.117Z"
  },
  "usage": {
    "active_alerts": [
      "configured_spend_limit_exceeded"
    ],
    "active_free_credits_usage": [
      {
        "expires_at": "2019-12-27T18:11:19.117Z",
        "grant_name": "grant_name",
        "remaining_balance": 0,
        "starting_balance": 0
      }
    ],
    "current_invoice_total_usd_cents": 0,
    "total_extraction_agents": 0,
    "total_indexed_pages": 0,
    "total_indexes": 0,
    "total_users": 0
  }
}