# Admin

## Get Llm Info

**get** `/api/v1/admin/llms/info`

Get Llm Info

### Cookie Parameters

- `session: optional string`

### Returns

- `llm_info: map[map[object { internal_model_name, valid, error_message, last_validated } ]]`

  - `internal_model_name: string`

  - `valid: boolean`

  - `error_message: optional string`

  - `last_validated: optional string`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/llms/info \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "llm_info": {
    "foo": {
      "foo": {
        "internal_model_name": "internal_model_name",
        "valid": true,
        "error_message": "error_message",
        "last_validated": "2019-12-27T18:11:19.117Z"
      }
    }
  }
}
```

## Get License Info

**get** `/api/v1/admin/license/info`

Get License Info

### Query Parameters

- `include_scopes: optional boolean`

  Whether to include scopes in the response

### Cookie Parameters

- `session: optional string`

### Returns

- `expires_at: string`

  License expiration date

- `status: string`

  License validation status

- `message: optional string`

  License message

- `scopes: optional array of string`

  License scopes

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/license/info \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "expires_at": "2019-12-27T18:11:19.117Z",
  "status": "status",
  "message": "message",
  "scopes": [
    "string"
  ]
}
```

## Get File Store Info

**get** `/api/v1/admin/filestores/info`

Get File Store Info

### Cookie Parameters

- `session: optional string`

### Returns

- `status: "missing_buckets" or "missing_credentials" or "ok"`

  - `"missing_buckets"`

  - `"missing_credentials"`

  - `"ok"`

- `available_buckets: optional map[string]`

- `unavailable_buckets: optional map[string]`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/filestores/info \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "status": "missing_buckets",
  "available_buckets": {
    "foo": "string"
  },
  "unavailable_buckets": {
    "foo": "string"
  }
}
```

## Get Llamaextract Features

**get** `/api/v1/admin/llamaextract/features`

Get LlamaExtract feature availability based on available models.

### Cookie Parameters

- `session: optional string`

### Returns

- `available_modes: array of object { mode, parse_mode, status, 4 more }`

  - `mode: string`

  - `parse_mode: string`

  - `status: "available" or "unavailable"`

    - `"available"`

    - `"unavailable"`

  - `available_extract_models: optional array of string`

  - `available_parse_models: optional array of string`

  - `missing_extract_models: optional array of string`

  - `missing_parse_models: optional array of string`

- `schema_generation: object { model, status }`

  - `model: string`

  - `status: "available" or "unavailable"`

    - `"available"`

    - `"unavailable"`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/llamaextract/features \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "available_modes": [
    {
      "mode": "mode",
      "parse_mode": "parse_mode",
      "status": "available",
      "available_extract_models": [
        "string"
      ],
      "available_parse_models": [
        "string"
      ],
      "missing_extract_models": [
        "string"
      ],
      "missing_parse_models": [
        "string"
      ]
    }
  ],
  "schema_generation": {
    "model": "model",
    "status": "available"
  }
}
```

## Get Ocr Health

**get** `/api/v1/admin/ocr/statusz`

Get OCR service health status including GPU availability.

### Cookie Parameters

- `session: optional string`

### Returns

- `status: "degraded" or "ok" or "unavailable"`

  - `"degraded"`

  - `"ok"`

  - `"unavailable"`

- `device: optional string`

- `error_message: optional string`

- `gpu_available: optional boolean`

- `gpu_device_count: optional number`

- `gpu_device_name: optional string`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/ocr/statusz \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "status": "degraded",
  "device": "device",
  "error_message": "error_message",
  "gpu_available": true,
  "gpu_device_count": 0,
  "gpu_device_name": "gpu_device_name"
}
```

## Domain Types

### Admin Get Llms Info Response

- `AdminGetLlmsInfoResponse object { llm_info }`

  - `llm_info: map[map[object { internal_model_name, valid, error_message, last_validated } ]]`

    - `internal_model_name: string`

    - `valid: boolean`

    - `error_message: optional string`

    - `last_validated: optional string`

### Admin Get License Info Response

- `AdminGetLicenseInfoResponse object { expires_at, status, message, scopes }`

  - `expires_at: string`

    License expiration date

  - `status: string`

    License validation status

  - `message: optional string`

    License message

  - `scopes: optional array of string`

    License scopes

### Admin Get Filestores Info Response

- `AdminGetFilestoresInfoResponse object { status, available_buckets, unavailable_buckets }`

  - `status: "missing_buckets" or "missing_credentials" or "ok"`

    - `"missing_buckets"`

    - `"missing_credentials"`

    - `"ok"`

  - `available_buckets: optional map[string]`

  - `unavailable_buckets: optional map[string]`

### Admin Get Llamaextract Features Response

- `AdminGetLlamaextractFeaturesResponse object { available_modes, schema_generation }`

  - `available_modes: array of object { mode, parse_mode, status, 4 more }`

    - `mode: string`

    - `parse_mode: string`

    - `status: "available" or "unavailable"`

      - `"available"`

      - `"unavailable"`

    - `available_extract_models: optional array of string`

    - `available_parse_models: optional array of string`

    - `missing_extract_models: optional array of string`

    - `missing_parse_models: optional array of string`

  - `schema_generation: object { model, status }`

    - `model: string`

    - `status: "available" or "unavailable"`

      - `"available"`

      - `"unavailable"`

### Admin Get Ocr Status Response

- `AdminGetOcrStatusResponse object { status, device, error_message, 3 more }`

  Response model for OCR service health/GPU status.

  - `status: "degraded" or "ok" or "unavailable"`

    - `"degraded"`

    - `"ok"`

    - `"unavailable"`

  - `device: optional string`

  - `error_message: optional string`

  - `gpu_available: optional boolean`

  - `gpu_device_count: optional number`

  - `gpu_device_name: optional string`

# Users

## Get User Claims

**get** `/api/v1/admin/users/{user_id}/claims`

Get a user's resolved custom claims.

Claims that have not been explicitly set fall back to their system default. Returns 404 if the user does not exist.

Global admin only.

### Path Parameters

- `user_id: string`

### Cookie Parameters

- `session: optional string`

### Returns

- `UserClaims object { claims, user_id }`

  A user's fully resolved custom claims after applying system defaults.

  - `claims: CustomClaims`

    The user's resolved custom claims.

    - `allow_org_deletion: optional boolean`

      Whether the user is allowed to delete organizations.

    - `allowed_org_creation: optional boolean`

      Whether the user is allowed to create organizations.

    - `api_datasource_access: optional boolean`

      Whether the user is allowed to access API data sources.

    - `maximum_org_creation: optional number`

      Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

  - `user_id: string`

    The user ID the claims belong to.

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/users/$USER_ID/claims \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "claims": {
    "allow_org_deletion": true,
    "allowed_org_creation": true,
    "api_datasource_access": true,
    "maximum_org_creation": 0
  },
  "user_id": "user_id"
}
```

## Update User Claims

**patch** `/api/v1/admin/users/{user_id}/claims`

Additively update a user's custom claims.

Claims in `set_claims` are added or overwritten; claims named in `remove_claims` are reset to their system default. Claims not referenced by either field are left unchanged, so a single claim can be changed without resending the full set. Returns the user's resolved claims after the update.

Returns 404 if the user does not exist.

Global admin only.

### Path Parameters

- `user_id: string`

### Cookie Parameters

- `session: optional string`

### Body Parameters

- `remove_claims: optional array of "allow_org_deletion" or "allowed_org_creation" or "api_datasource_access" or "maximum_org_creation"`

  Names of claims to reset to their system default.

  - `"allow_org_deletion"`

  - `"allowed_org_creation"`

  - `"api_datasource_access"`

  - `"maximum_org_creation"`

- `set_claims: optional object { allow_org_deletion, allowed_org_creation, api_datasource_access, maximum_org_creation }`

  A partial set of custom claims for additive updates.

  Every field is optional. Only the claims explicitly provided in a request
  are added or overwritten; claims left unset are not touched, so callers can
  change a single claim without resending the full claim set.

  - `allow_org_deletion: optional boolean`

    Whether the user is allowed to delete organizations.

  - `allowed_org_creation: optional boolean`

    Whether the user is allowed to create organizations.

  - `api_datasource_access: optional boolean`

    Whether the user is allowed to access API data sources.

  - `maximum_org_creation: optional number`

    Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

### Returns

- `UserClaims object { claims, user_id }`

  A user's fully resolved custom claims after applying system defaults.

  - `claims: CustomClaims`

    The user's resolved custom claims.

    - `allow_org_deletion: optional boolean`

      Whether the user is allowed to delete organizations.

    - `allowed_org_creation: optional boolean`

      Whether the user is allowed to create organizations.

    - `api_datasource_access: optional boolean`

      Whether the user is allowed to access API data sources.

    - `maximum_org_creation: optional number`

      Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

  - `user_id: string`

    The user ID the claims belong to.

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/users/$USER_ID/claims \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '{}'
```

#### Response

```json
{
  "claims": {
    "allow_org_deletion": true,
    "allowed_org_creation": true,
    "api_datasource_access": true,
    "maximum_org_creation": 0
  },
  "user_id": "user_id"
}
```

## Domain Types

### Custom Claims

- `CustomClaims object { allow_org_deletion, allowed_org_creation, api_datasource_access, maximum_org_creation }`

  Custom claims that dictate various limits or allowed behaviors.
  Currently these claims reside at a per user level. Claims may expand to a per organization level or project in the future.

  - `allow_org_deletion: optional boolean`

    Whether the user is allowed to delete organizations.

  - `allowed_org_creation: optional boolean`

    Whether the user is allowed to create organizations.

  - `api_datasource_access: optional boolean`

    Whether the user is allowed to access API data sources.

  - `maximum_org_creation: optional number`

    Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

### User Claims

- `UserClaims object { claims, user_id }`

  A user's fully resolved custom claims after applying system defaults.

  - `claims: CustomClaims`

    The user's resolved custom claims.

    - `allow_org_deletion: optional boolean`

      Whether the user is allowed to delete organizations.

    - `allowed_org_creation: optional boolean`

      Whether the user is allowed to create organizations.

    - `api_datasource_access: optional boolean`

      Whether the user is allowed to access API data sources.

    - `maximum_org_creation: optional number`

      Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

  - `user_id: string`

    The user ID the claims belong to.

# Usage Metrics

## Aggregate Usage Metrics

**get** `/api/v1/admin/usage-metrics/aggregate`

Aggregate usage metrics by one or more dimensions, reporting total credits used. Global admin only.

A date range is required, which bounds the scan via the `day`-leading index. Supplying `organization_id` narrows it further via the `(organization_id, day)` index.

Supported `group_by` dimensions: `day`, `organization_id`, `project_id`, `event_type`, `user_id`. Buckets are ordered by total credits descending.

### Query Parameters

- `day_on_or_after: string`

  Inclusive lower bound on the day (YYYY-MM-DD, UTC)

- `day_on_or_before: string`

  Inclusive upper bound on the day (YYYY-MM-DD, UTC)

- `group_by: array of string`

  Dimensions to group by: day, organization_id, project_id, event_type, user_id

- `event_types: optional array of "audio_seconds_parsed" or "chart_parsing_agentic" or "chart_parsing_efficient" or 27 more`

  Filter by event types

  - `"audio_seconds_parsed"`

  - `"chart_parsing_agentic"`

  - `"chart_parsing_efficient"`

  - `"chart_parsing_plus"`

  - `"chat_message_sent"`

  - `"confidence_score_high"`

  - `"directory_count_snapshot"`

  - `"directory_file_count_snapshot"`

  - `"directory_files_exported"`

  - `"directory_files_ingested"`

  - `"directory_pages_exported"`

  - `"extraction_num_pages"`

  - `"form_parsing_pages"`

  - `"image_classified"`

  - `"index_retrieve_query"`

  - `"layout_aware_chart_extraction"`

  - `"layout_aware_parsing"`

  - `"layout_extracted"`

  - `"pages_classified"`

  - `"pages_embedded"`

  - `"pages_indexed"`

  - `"pages_parsed"`

  - `"pages_split"`

  - `"pages_verified"`

  - `"precise_bbox_extraction"`

  - `"set_total_indexes"`

  - `"set_total_pages_indexed"`

  - `"spreadsheet_regions_extracted"`

  - `"stored_file_count"`

  - `"stored_file_mb"`

- `organization_id: optional string`

  Filter by organization ID

- `project_id: optional string`

  Filter by project ID

- `user_id: optional string`

  Filter by user ID

### Cookie Parameters

- `session: optional string`

### Returns

- `buckets: array of object { dimensions, metric_count, total_credits, total_value }`

  The aggregation buckets, ordered by total credits descending

  - `dimensions: map[string]`

    The dimension values that define this bucket

  - `metric_count: number`

    Number of metric rows in this bucket

  - `total_credits: number or string`

    Total credits consumed by metrics in this bucket

    - `number`

    - `string`

  - `total_value: number`

    Total of the metric `value` field in this bucket

- `group_by: array of "day" or "event_type" or "organization_id" or 2 more`

  The dimensions the metrics were grouped by

  - `"day"`

  - `"event_type"`

  - `"organization_id"`

  - `"project_id"`

  - `"user_id"`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/admin/usage-metrics/aggregate \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{
  "buckets": [
    {
      "dimensions": {
        "foo": "string"
      },
      "metric_count": 0,
      "total_credits": 0,
      "total_value": 0
    }
  ],
  "group_by": [
    "day"
  ]
}
```

## Domain Types

### Usage Metric Aggregate Response

- `UsageMetricAggregateResponse object { buckets, group_by }`

  Response containing usage metrics aggregated by one or more dimensions.

  - `buckets: array of object { dimensions, metric_count, total_credits, total_value }`

    The aggregation buckets, ordered by total credits descending

    - `dimensions: map[string]`

      The dimension values that define this bucket

    - `metric_count: number`

      Number of metric rows in this bucket

    - `total_credits: number or string`

      Total credits consumed by metrics in this bucket

      - `number`

      - `string`

    - `total_value: number`

      Total of the metric `value` field in this bucket

  - `group_by: array of "day" or "event_type" or "organization_id" or 2 more`

    The dimensions the metrics were grouped by

    - `"day"`

    - `"event_type"`

    - `"organization_id"`

    - `"project_id"`

    - `"user_id"`
