Add Claude Console plugin#73
Conversation
The APIs generally do not allow filtering by the default workspace, so we have to use scripts to enable this
📝 WalkthroughWalkthroughClaude Console v1 adds plugin metadata, required Admin API key configuration and validation, object type and scope definitions, new data streams for objects and analytics, default dashboards, index mappings, and documentation. ChangesClaude Console v1 plugin rollout
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
|
@clarkd something to consider, is what this plugin should be called. As mentioned, this only api key usage data, not users using Claude Teams/Pro or Enterprise. |
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.js`:
- Line 7: The workspace import logic is spreading data.data directly into
result, which can throw if the response body is missing the array or it is
empty. Update the workspaces handling in the scripts/workspaces.js flow to
safely guard the spread in the data.data path, using a fallback empty array or a
presence check before building result. Keep the fix localized around the result
assignment so the import degrades gracefully when the response shape is
unexpected.
In `@plugins/ClaudeConsole/v1/dataStreams/usage.json`:
- Around line 174-188: The usage report schema includes dimensions that will
always be empty with the current grouping, so fix the data definition in
usage.json by either adding service_tier, context_window, and account_id to the
report’s group_by configuration or removing those columns from the selected
fields. Use the existing usage report dimension definitions around service_tier,
context_window, and account_id to align the columns with the grouping behavior
so only non-null fields are exposed.
In `@plugins/ClaudeConsole/v1/dataStreams/workspaces.json`:
- Around line 48-52: The archived_at field is declared with the wrong shape in
the workspaces JSON schema, so it won’t be treated as a date in the UI. Update
the archived_at entry in workspaces.json to use shape: "date", matching the
created_at field and other ISO 8601 date-time values. Keep the change scoped to
the archived_at schema definition so sorting/parsing behavior is corrected
without affecting other fields.
In `@plugins/ClaudeConsole/v1/defaultContent/apiKey.dash.json`:
- Line 58: The dashboard tile title is not using title case; update the “Token
usage” label in the relevant tile definition to “Token Usage” to match the
dashboard naming guideline. Locate the tile config by its title field in the
dashboard JSON and change only the displayed title text.
In `@plugins/ClaudeConsole/v1/defaultContent/member.dash.json`:
- Line 67: The dashboard tile titles in member.dash.json are not following the
title-case guideline. Update the tile title strings for the affected entries,
including the ones currently labeled Account usage and API keys created by this
member, so they match the title case used by the other dashboard tile names.
In `@plugins/ClaudeConsole/v1/defaultContent/overview.dash.json`:
- Line 21: The dashboard tile titles in overview.dash.json are using sentence
case instead of title case. Update the affected tile name fields (including the
ones for Spend (this month), Cost by model, Top workspaces by cost, and Token
usage by model, plus the other referenced entries) to use title case
consistently, and use the surrounding dashboard tile definitions to locate the
relevant title properties.
In `@plugins/ClaudeConsole/v1/defaultContent/workspace.dash.json`:
- Line 67: Normalize the dashboard tile names in the workspace.dash.json content
to title case: update the tile entries for Cost over time, Usage by model, and
API keys in this workspace so their title strings use proper title
capitalization. Keep the change limited to the affected tile title fields so the
dashboard naming aligns with the title case guideline.
In `@plugins/ClaudeConsole/v1/docs/README.md`:
- Line 1: The README top-level heading in the Claude Console docs repeats the
plugin name, so update the first heading to a neutral title that matches the
docs guideline. Change the heading in the README file to something like “Before
you start” or “Prerequisites” so it no longer duplicates the plugin name and
better reflects the section’s purpose.
In `@plugins/ClaudeConsole/v1/indexDefinitions/default.json`:
- Around line 13-14: The index mapping source type names in default.json are
plugin-prefixed and should be renamed to match the upstream entity names
instead. Update the ClaudeConsole/v1 indexDefinitions entries referenced by the
source type values used for the workspace, API key, and member mappings so they
read as upstream names like workspace, api key, and member rather than Claude
Workspace or similar. Make the change consistently across all affected mapping
objects in the default definition so the source type labels follow the existing
naming guidelines.
In `@plugins/ClaudeConsole/v1/ui.json`:
- Around line 5-10: The UI copy for this field needs to follow the plugin text
rules: update the label in the ClaudeConsole v1 UI config to sentence-style
casing rather than title case, and rewrite the help text in the same config so
it does not start with “Your” and instead begins with a verb while staying
concise and neutral. Use the existing field entry in ui.json (the Admin API key
field) as the target for these copy-only changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4ac7bbb8-6b7b-449b-8cf0-8f0b45eb2acd
⛔ Files ignored due to path filters (1)
plugins/ClaudeConsole/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (22)
plugins/ClaudeConsole/v1/configValidation.jsonplugins/ClaudeConsole/v1/custom_types.jsonplugins/ClaudeConsole/v1/dataStreams/apiKeys.jsonplugins/ClaudeConsole/v1/dataStreams/cost.jsonplugins/ClaudeConsole/v1/dataStreams/members.jsonplugins/ClaudeConsole/v1/dataStreams/organization.jsonplugins/ClaudeConsole/v1/dataStreams/scripts/apiKeys.jsplugins/ClaudeConsole/v1/dataStreams/scripts/cost.jsplugins/ClaudeConsole/v1/dataStreams/scripts/usage.jsplugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.jsplugins/ClaudeConsole/v1/dataStreams/usage.jsonplugins/ClaudeConsole/v1/dataStreams/workspaces.jsonplugins/ClaudeConsole/v1/defaultContent/apiKey.dash.jsonplugins/ClaudeConsole/v1/defaultContent/manifest.jsonplugins/ClaudeConsole/v1/defaultContent/member.dash.jsonplugins/ClaudeConsole/v1/defaultContent/overview.dash.jsonplugins/ClaudeConsole/v1/defaultContent/scopes.jsonplugins/ClaudeConsole/v1/defaultContent/workspace.dash.jsonplugins/ClaudeConsole/v1/docs/README.mdplugins/ClaudeConsole/v1/indexDefinitions/default.jsonplugins/ClaudeConsole/v1/metadata.jsonplugins/ClaudeConsole/v1/ui.json
| name: "Default", | ||
| }; | ||
|
|
||
| result = [...data.data, defaultWorkspace]; |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Guard against a missing/empty data.data before spreading.
If the response body lacks a data array (error envelope, empty org, schema change), [...data.data, ...] throws a TypeError and the workspaces import fails rather than degrading gracefully.
🛡️ Proposed fix
-result = [...data.data, defaultWorkspace];
+result = [...(Array.isArray(data?.data) ? data.data : []), defaultWorkspace];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.js` at line 7, The
workspace import logic is spreading data.data directly into result, which can
throw if the response body is missing the array or it is empty. Update the
workspaces handling in the scripts/workspaces.js flow to safely guard the spread
in the data.data path, using a fallback empty array or a presence check before
building result. Keep the fix localized around the result assignment so the
import degrades gracefully when the response shape is unexpected.
| { | ||
| "name": "service_tier", | ||
| "displayName": "Service Tier", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "context_window", | ||
| "displayName": "Context Window", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "account_id", | ||
| "displayName": "Account ID", | ||
| "shape": "string" | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor
🧩 Analysis chain
🌐 Web query:
Anthropic usage_report messages API: are service_tier and context_window valid group_by[] values, and are these fields null when not grouped?
💡 Result:
Yes, service_tier and context_window are both valid values for the group_by[] parameter in the Anthropic messages usage report API [1][2][3]. Regarding the behavior of these fields when not included in the group_by[] parameter: These fields will be null in the API response when you do not specifically include them in your group_by[] request [1][2][3]. For example, if you do not group by context_window, the context_window field in the returned usage objects will be null [1][2]. Similarly, if you do not group by service_tier, the service_tier field will be null [1][2][3]. When they are included in the group_by[] array, the API will aggregate and break down the usage data by those specific dimensions [1][4][3].
Citations:
- 1: https://platform.claude.com/docs/en/api/admin/usage_report/retrieve_messages
- 2: https://platform.claude.com/docs/en/api/admin/usage_report
- 3: https://www.withone.ai/knowledge/anthropic-admin/conn_mod_def%3A%3AGJgJr9ZYfCM%3A%3Aw9uaAOKuTWCDNxZAy_Wt6A
- 4: https://platform.claude.com/docs/en/manage-claude/usage-cost-api
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- target file outline ---'
ast-grep outline plugins/ClaudeConsole/v1/dataStreams/usage.json || true
echo '--- relevant lines ---'
cat -n plugins/ClaudeConsole/v1/dataStreams/usage.json | sed -n '1,260p'
echo '--- repo search ---'
rg -n '"account_id"|"service_tier"|"context_window"|group_by\[\]' plugins/ClaudeConsole -SRepository: squaredup/plugins
Length of output: 7804
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- target file outline ---'
ast-grep outline plugins/ClaudeConsole/v1/dataStreams/usage.json || true
echo '--- relevant lines ---'
cat -n plugins/ClaudeConsole/v1/dataStreams/usage.json | sed -n '1,260p'
echo '--- repo search ---'
rg -n '"account_id"|"service_tier"|"context_window"|group_by\[\]' plugins/ClaudeConsole -SRepository: squaredup/plugins
Length of output: 7804
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- target file outline ---'
ast-grep outline plugins/ClaudeConsole/v1/dataStreams/usage.json || true
echo '--- relevant lines ---'
cat -n plugins/ClaudeConsole/v1/dataStreams/usage.json | sed -n '1,260p'
echo '--- repo search ---'
rg -n '"account_id"|"service_tier"|"context_window"|group_by\[\]' plugins/ClaudeConsole -SRepository: squaredup/plugins
Length of output: 7804
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- target file outline ---'
ast-grep outline plugins/ClaudeConsole/v1/dataStreams/usage.json || true
echo '--- relevant lines ---'
cat -n plugins/ClaudeConsole/v1/dataStreams/usage.json | sed -n '1,260p'
echo '--- repo search ---'
rg -n '"account_id"|"service_tier"|"context_window"|group_by\[\]' plugins/ClaudeConsole -SRepository: squaredup/plugins
Length of output: 7804
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- target file outline ---'
ast-grep outline plugins/ClaudeConsole/v1/dataStreams/usage.json || true
echo '--- relevant lines ---'
cat -n plugins/ClaudeConsole/v1/dataStreams/usage.json | sed -n '1,260p'
echo '--- repo search ---'
rg -n '"account_id"|"service_tier"|"context_window"|group_by\[\]' plugins/ClaudeConsole -SRepository: squaredup/plugins
Length of output: 7804
🌐 Web query:
Anthropic usage_report retrieve_messages account_id group_by account_id messages report field
💡 Result:
The endpoint used to retrieve message-level usage data from Anthropic is GET /v1/organizations/usage_report/messages [1][2]. This is part of the Usage & Cost Admin API [3]. Regarding your query about parameters and fields: 1. account_id: In the response object, account_id is a field that identifies the user account that performed the request [1][2]. It will return null if you are not grouping by account or if the request was made via a non-OAuth process [2]. 2. group_by: You can use the group_by[] parameter to aggregate usage metrics by specific dimensions [3][4]. Valid dimensions for grouping include model, workspace_id, api_key_id, context_window, inference_geo, service_tier, and product [1][2][5]. 3. messages report field: The endpoint returns a MessagesUsageReport object containing a data array [1][2]. Each entry in the data array includes a results array containing usage metrics such as uncached_input_tokens, output_tokens, cache_read_input_tokens, and cache_creation (which breaks down into ephemeral_1h_input_tokens and ephemeral_5m_input_tokens) [1][2][6]. To use this, you must authenticate with an Admin API key (prefixed with sk-ant-admin-...) [7]. Example request structure: curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\ starting_at=2026-06-01T00:00:00Z&\ group_by[]=account_id&\ group_by[]=model" \ --header "anthropic-version: 2023-06-01" \ --header "x-api-key: $ANTHROPIC_ADMIN_KEY" [3][7]
Citations:
- 1: https://platform.claude.com/docs/en/api/admin/usage_report/retrieve_messages
- 2: https://platform.claude.com/docs/en/api/admin/usage_report
- 3: https://platform.claude.com/docs/en/manage-claude/usage-cost-api
- 4: https://claude.yourdocs.dev/docs/build-with-claude/usage-cost-api
- 5: https://platform.claude.com/docs/en/api/admin/analytics/usage/list_by_user
- 6: https://platform.claude.com/cookbook/observability-usage-cost-api
- 7: https://claudeguide.io/anthropic-admin-api-tutorial
Either group by these dimensions or remove the columns
service_tier and context_window are null unless added to group_by[], and account_id is also null unless the report is grouped by account_id. The current request only groups by workspace_id, api_key_id, and model, so these columns will render empty as-is.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/dataStreams/usage.json` around lines 174 - 188, The
usage report schema includes dimensions that will always be empty with the
current grouping, so fix the data definition in usage.json by either adding
service_tier, context_window, and account_id to the report’s group_by
configuration or removing those columns from the selected fields. Use the
existing usage report dimension definitions around service_tier, context_window,
and account_id to align the columns with the grouping behavior so only non-null
fields are exposed.
| { | ||
| "name": "archived_at", | ||
| "displayName": "Archived", | ||
| "shape": "string" | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
archived_at should use shape: "date".
archived_at is an ISO 8601 date-time (same as created_at above) but is declared as string, so it won't be parsed/sorted as a date in the UI.
🛠️ Proposed fix
{
"name": "archived_at",
"displayName": "Archived",
- "shape": "string"
+ "shape": "date"
},Based on learnings: ISO 8601 date-time fields should use shape: "date".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| "name": "archived_at", | |
| "displayName": "Archived", | |
| "shape": "string" | |
| }, | |
| { | |
| "name": "archived_at", | |
| "displayName": "Archived", | |
| "shape": "date" | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/dataStreams/workspaces.json` around lines 48 - 52,
The archived_at field is declared with the wrong shape in the workspaces JSON
schema, so it won’t be treated as a date in the UI. Update the archived_at entry
in workspaces.json to use shape: "date", matching the created_at field and other
ISO 8601 date-time values. Keep the change scoped to the archived_at schema
definition so sorting/parsing behavior is corrected without affecting other
fields.
Source: Learnings
| "z": 0, | ||
| "config": { | ||
| "_type": "tile/data-stream", | ||
| "title": "Token usage", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update tile title to title case.
Token usage should be Token Usage.
As per coding guidelines: "Tile names in dashboards should use title case".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/defaultContent/apiKey.dash.json` at line 58, The
dashboard tile title is not using title case; update the “Token usage” label in
the relevant tile definition to “Token Usage” to match the dashboard naming
guideline. Locate the tile config by its title field in the dashboard JSON and
change only the displayed title text.
Source: Coding guidelines
| "z": 0, | ||
| "config": { | ||
| "_type": "tile/data-stream", | ||
| "title": "Account usage", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use title case for these tile titles.
Account usage and API keys created by this member should be title-cased.
As per coding guidelines: "Tile names in dashboards should use title case".
Also applies to: 122-122
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/defaultContent/member.dash.json` at line 67, The
dashboard tile titles in member.dash.json are not following the title-case
guideline. Update the tile title strings for the affected entries, including the
ones currently labeled Account usage and API keys created by this member, so
they match the title case used by the other dashboard tile names.
Source: Coding guidelines
| "z": 0, | ||
| "config": { | ||
| "_type": "tile/data-stream", | ||
| "title": "Spend (this month)", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use title case for tile titles.
These tile names are not in title case (e.g., Spend (this month), Cost by model, Top workspaces by cost, Token usage by model). Please update them to title case for dashboard consistency.
As per coding guidelines: "Tile names in dashboards should use title case".
Also applies to: 167-167, 218-218, 269-269
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/defaultContent/overview.dash.json` at line 21, The
dashboard tile titles in overview.dash.json are using sentence case instead of
title case. Update the affected tile name fields (including the ones for Spend
(this month), Cost by model, Top workspaces by cost, and Token usage by model,
plus the other referenced entries) to use title case consistently, and use the
surrounding dashboard tile definitions to locate the relevant title properties.
Source: Coding guidelines
| "z": 0, | ||
| "config": { | ||
| "_type": "tile/data-stream", | ||
| "title": "Cost over time", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Normalize tile titles to title case.
Cost over time, Usage by model, and API keys in this workspace should be title-cased.
As per coding guidelines: "Tile names in dashboards should use title case".
Also applies to: 118-118, 173-173
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/defaultContent/workspace.dash.json` at line 67,
Normalize the dashboard tile names in the workspace.dash.json content to title
case: update the tile entries for Cost over time, Usage by model, and API keys
in this workspace so their title strings use proper title capitalization. Keep
the change limited to the affected tile title fields so the dashboard naming
aligns with the title case guideline.
Source: Coding guidelines
| @@ -0,0 +1,53 @@ | |||
| # Claude Console | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use a neutral top-level heading.
This repeats the plugin name, which the docs guideline says to avoid. # Before you start or # Prerequisites would fit better here.
Proposed fix
-# Claude Console
+# Before you start📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Claude Console | |
| # Before you start |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/docs/README.md` at line 1, The README top-level
heading in the Claude Console docs repeats the plugin name, so update the first
heading to a neutral title that matches the docs guideline. Change the heading
in the README file to something like “Before you start” or “Prerequisites” so it
no longer duplicates the plugin name and better reflects the section’s purpose.
Source: Coding guidelines
| "value": "Claude Workspace" | ||
| }, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Remove plugin-prefixed source type names in index mappings.
Lines 13/33/57 use Claude ... type values, but index source types should be named as upstream entities (for example workspace, api key, member) and not plugin-prefixed.
As per coding guidelines, “Name source types after how they are referred to in the upstream product or API … Do not prefix them with the plugin name.”
Also applies to: 33-34, 57-58
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/indexDefinitions/default.json` around lines 13 - 14,
The index mapping source type names in default.json are plugin-prefixed and
should be renamed to match the upstream entity names instead. Update the
ClaudeConsole/v1 indexDefinitions entries referenced by the source type values
used for the workspace, API key, and member mappings so they read as upstream
names like workspace, api key, and member rather than Claude Workspace or
similar. Make the change consistently across all affected mapping objects in the
default definition so the source type labels follow the existing naming
guidelines.
Source: Coding guidelines
| "label": "Admin API Key", | ||
| "validation": { | ||
| "required": true | ||
| }, | ||
| "placeholder": "sk-ant-admin...", | ||
| "help": "Your organization's Admin API key from the [Claude Console (Settings → Admin keys)](https://platform.claude.com/settings/admin-keys). Starts with `sk-ant-admin`. This plugin only reads data; it does not create, modify, or delete any Claude resources" |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Adjust UI field label/help text to match plugin UI copy rules.
Line 5 uses title-style casing (Admin API Key), and Line 10 starts with “Your…”. The UI guidelines require neutral concise text, first-word sentence-style casing, and help text that starts with a verb.
As per coding guidelines, “UI field displayName should use first word uppercase then lowercase … Do not use ‘you’ or ‘Your’ … UI field help text … Start with a verb where possible.”
Suggested edit
- "label": "Admin API Key",
+ "label": "Admin API key",
...
- "help": "Your organization's Admin API key from the [Claude Console (Settings → Admin keys)](https://platform.claude.com/settings/admin-keys). Starts with `sk-ant-admin`. This plugin only reads data; it does not create, modify, or delete any Claude resources"
+ "help": "Provide the organization Admin API key from [Claude Console (Settings → Admin keys)](https://platform.claude.com/settings/admin-keys) (starts with `sk-ant-admin`)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "label": "Admin API Key", | |
| "validation": { | |
| "required": true | |
| }, | |
| "placeholder": "sk-ant-admin...", | |
| "help": "Your organization's Admin API key from the [Claude Console (Settings → Admin keys)](https://platform.claude.com/settings/admin-keys). Starts with `sk-ant-admin`. This plugin only reads data; it does not create, modify, or delete any Claude resources" | |
| "label": "Admin API key", | |
| "validation": { | |
| "required": true | |
| }, | |
| "placeholder": "sk-ant-admin...", | |
| "help": "Provide the organization Admin API key from [Claude Console (Settings → Admin keys)](https://platform.claude.com/settings/admin-keys) (starts with `sk-ant-admin`)" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/ClaudeConsole/v1/ui.json` around lines 5 - 10, The UI copy for this
field needs to follow the plugin text rules: update the label in the
ClaudeConsole v1 UI config to sentence-style casing rather than title case, and
rewrite the help text in the same config so it does not start with “Your” and
instead begins with a verb while staying concise and neutral. Use the existing
field entry in ui.json (the Admin API key field) as the target for these
copy-only changes.
Source: Coding guidelines
clarkd
left a comment
There was a problem hiding this comment.
A few CodeRabbit comments to address here.
| // cost.js — flatten nested time-bucket/results structure, coerce amount string→number, | ||
| // and optionally scope to selected workspace(s) via the `workspace` objects param. | ||
|
|
||
| const unwrap = (v) => (Array.isArray(v) ? v[0] : v); |
There was a problem hiding this comment.
Shouldn't be needed with schema 2.1
| }, | ||
| { | ||
| "name": "amount", | ||
| "displayName": "Cost ($)", |
There was a problem hiding this comment.
Is it always USD for every customer?
| { | ||
| "type": "password", | ||
| "name": "adminApiKey", | ||
| "label": "Admin API Key", |
There was a problem hiding this comment.
| "label": "Admin API Key", | |
| "label": "Admin API key", |
🔌 Plugin overview
sk-ant-admin…) sent via thex-api-keyheader (with a staticanthropic-versionheader) againsthttps://api.anthropic.com. Validated on setup viaGET /v1/organizations/me.🖼️ Plugin screenshots
Plugin configuration
Default dashboards
🧪 Testing
Built and tested end-to-end against a live, authenticated tenant (not just file validation):
configValidationprobe (GET /v1/organizations/me) returns 200.squaredup objects.squaredup test):usage— flattens the nesteddata[].results[]time-buckets into rows; auto-selectsbucket_width(1m/1h/1d) from the timeframe and sizeslimitto stay within the API's per-bucket caps; bracketed array params (group_by[],workspace_ids[],api_key_ids[],account_ids[]) verified in the resolved request URL.cost— daily USD;amountunit verified empirically by computing implied $/token against Claude's published list prices — they match exactly only whenamountis treated as cents (/100), catching a would-be 100× error.workspaces/apiKeys/members— return one flat row per object; double-as import streams and visible dashboard tables; optional API-side scope filters (workspace_id,created_by_user_id) tested with a two-object proof.squaredup validatepasses clean (data streams, import definition, UI, icon, default content, config validation, custom types all present).nullworkspace/API-key, it also can't be used in some apis to filter by, so we have to do it via thepostRequestScript🔮 Future work
This does not query individual workspace settings, i.e. to list what skills, files, models, and managed agents are on a workspace.
This can come in an updated version of the plugin, but requires us to get the user to provide individual api keys for each workspace they want to access so we can see their details.
Similar to the Sanity plugin with how it handles dataset queries (Although that is blocked by needing dependant imports)
📚 Checklist
Summary by CodeRabbit
New Features
Documentation