Skip to content
Product Docs

Get Organization Usage

UsageAndPlan organizations().getUsage(OrganizationGetUsageParamsparams = OrganizationGetUsageParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/api/v1/organizations/{organization_id}/usage

Get usage for a specific organization.

ParametersExpand Collapse
OrganizationGetUsageParams params
Optional<String> organizationId
Optional<Boolean> getCurrentInvoiceTotal
ReturnsExpand Collapse
class UsageAndPlan:
Plan plan
Limits limits
boolean allowPayAsYouGo

Whether usage is allowed after credit grants are exhausted

Optional<Long> maxConcurrentIndexJobs
Optional<Long> maxConcurrentParseJobsOther
Optional<Long> maxConcurrentParseJobsPremium
Optional<Long> maxDataSinks
Optional<Long> maxDataSources
Optional<Long> maxEmbeddingModels
Optional<Long> maxExtractionAgents
Optional<Long> maxExtractionJobs
Optional<Long> maxExtractionRuns
Optional<Long> maxFilesPerIndex
Optional<Long> maxIndexes
Optional<Long> maxMonthlyInvoiceTotalUsd
Optional<Long> maxOrganizations
Optional<Long> maxPagesPerIndex
Optional<Long> maxProjects
Optional<Long> maxPublishedAgents
Optional<Long> maxReportAgentSessions
Optional<Long> maxUsers
boolean mfaEnabled
boolean ssoEnabled
long subscriptionCostUsd
Optional<Long> maxDirectories
Optional<Long> maxDirectoryFilesPerDirectory
Optional<Long> maxDirectoryIngestFiles
Optional<Long> maxDirectorySyncPlanActions
Optional<List<Long>> spendingSoftAlertsUsdCents

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

Name name
One of the following:
ENTERPRISE("enterprise")
ENTERPRISE_CONTRACT("enterprise_contract")
ENTERPRISE_POC("enterprise_poc")
FREE("free")
FREE_CONTRACT("free_contract")
FREE_V1("free_v1")
FREE_V2("free_v2")
LLAMA_PARSE("llama_parse")
PRO("pro")
PRO_V1("pro_v1")
PRO_V2("pro_v2")
STARTER_V1("starter_v1")
STARTER_V2("starter_v2")
UNKNOWN("unknown")
YC_DEAL_V1("yc_deal_v1")
PlanFrequency planFrequency
One of the following:
ANNUAL("ANNUAL")
MONTHLY("MONTHLY")
QUARTERLY("QUARTERLY")
Optional<String> id

The ID of the plan in Metronome

Optional<CurrentBillingPeriod> currentBillingPeriod

The current billing period

LocalDateTime endDate
LocalDateTime startDate
Optional<LocalDateTime> endingBefore

The date the plan ends on

formatdate-time
Optional<Long> failureCount

The number of payment failures for this organization

Optional<Boolean> isPaymentFailed

Whether the organization has a failed payment that requires support contact

Optional<List<RecurringCredit>> recurringCredits
long creditAmount
CreditType creditType
String id
String name
String name
double priority
String productId

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

double rolloverFraction

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

Optional<Double> periodsDuration

How many billing periods the credit grant will last for

Optional<LocalDateTime> startingOn

The date the plan starts on

formatdate-time
Usage usage

Account usage totals shown alongside the plan.

Optional<List<ActiveAlert>> activeAlerts
One of the following:
CONFIGURED_SPEND_LIMIT_EXCEEDED("configured_spend_limit_exceeded")
FREE_CREDITS_EXHAUSTED("free_credits_exhausted")
HAS_SPENDING_ALERT("has_spending_alert")
INTERNAL_SPENDING_ALERT("internal_spending_alert")
PLAN_SPEND_LIMIT_EXCEEDED("plan_spend_limit_exceeded")
PLAN_SPEND_LIMIT_SOFT_ALERT("plan_spend_limit_soft_alert")
Optional<List<ActiveFreeCreditsUsage>> activeFreeCreditsUsage
LocalDateTime expiresAt
String grantName
long remainingBalance
long startingBalance
Optional<Long> currentInvoiceTotalUsdCents
Optional<Long> totalExtractionAgents
Optional<Long> totalIndexedPages
Optional<Long> totalIndexes
Optional<Long> totalUsers

Get Organization Usage

package ai.llamaindex.llamacloudadmin.example;

import ai.llamaindex.llamacloudadmin.client.LlamaCloudAdminClient;
import ai.llamaindex.llamacloudadmin.client.okhttp.LlamaCloudAdminOkHttpClient;
import ai.llamaindex.llamacloudadmin.models.organizations.OrganizationGetUsageParams;
import ai.llamaindex.llamacloudadmin.models.organizations.UsageAndPlan;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudAdminClient client = LlamaCloudAdminOkHttpClient.fromEnv();

        UsageAndPlan usageAndPlan = client.organizations().getUsage("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
    }
}
{
  "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
  }
}