Skip to content
Product Docs

Get Organization Usage

organizations.get_usage(strorganization_id, OrganizationGetUsageParams**kwargs) -> UsageAndPlan
GET/api/v1/organizations/{organization_id}/usage

Get usage for a specific organization.

ParametersExpand Collapse
organization_id: str
get_current_invoice_total: Optional[bool]
ReturnsExpand Collapse
class UsageAndPlan:
plan: Plan
limits: PlanLimits
allow_pay_as_you_go: bool

Whether usage is allowed after credit grants are exhausted

max_concurrent_index_jobs: Optional[int]
max_concurrent_parse_jobs_other: Optional[int]
max_concurrent_parse_jobs_premium: Optional[int]
max_data_sinks: Optional[int]
max_data_sources: Optional[int]
max_embedding_models: Optional[int]
max_extraction_agents: Optional[int]
max_extraction_jobs: Optional[int]
max_extraction_runs: Optional[int]
max_files_per_index: Optional[int]
max_indexes: Optional[int]
max_monthly_invoice_total_usd: Optional[int]
max_organizations: Optional[int]
max_pages_per_index: Optional[int]
max_projects: Optional[int]
max_published_agents: Optional[int]
max_report_agent_sessions: Optional[int]
max_users: Optional[int]
mfa_enabled: bool
sso_enabled: bool
subscription_cost_usd: int
max_directories: Optional[int]
max_directory_files_per_directory: Optional[int]
max_directory_ingest_files: Optional[int]
max_directory_sync_plan_actions: Optional[int]
spending_soft_alerts_usd_cents: Optional[List[int]]

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

name: Literal["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: Literal["ANNUAL", "MONTHLY", "QUARTERLY"]
One of the following:
"ANNUAL"
"MONTHLY"
"QUARTERLY"
id: Optional[str]

The ID of the plan in Metronome

current_billing_period: Optional[PlanCurrentBillingPeriod]

The current billing period

end_date: datetime
start_date: datetime
ending_before: Optional[datetime]

The date the plan ends on

formatdate-time
failure_count: Optional[int]

The number of payment failures for this organization

is_payment_failed: Optional[bool]

Whether the organization has a failed payment that requires support contact

recurring_credits: Optional[List[PlanRecurringCredit]]
credit_amount: int
credit_type: PlanRecurringCreditCreditType
id: str
name: str
name: str
priority: float
product_id: str

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

rollover_fraction: float

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

periods_duration: Optional[float]

How many billing periods the credit grant will last for

starting_on: Optional[datetime]

The date the plan starts on

formatdate-time
usage: Usage

Account usage totals shown alongside the plan.

active_alerts: Optional[List[Literal["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: Optional[List[UsageActiveFreeCreditsUsage]]
expires_at: datetime
grant_name: str
remaining_balance: int
starting_balance: int
current_invoice_total_usd_cents: Optional[int]
total_extraction_agents: Optional[int]
total_indexed_pages: Optional[int]
total_indexes: Optional[int]
total_users: Optional[int]

Get Organization Usage

import os
from llama_cloud_admin import LlamaCloudAdmin

client = LlamaCloudAdmin(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
usage_and_plan = client.organizations.get_usage(
    organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(usage_and_plan.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
  }
}