diff --git a/plugins/ClaudeConsole/v1/configValidation.json b/plugins/ClaudeConsole/v1/configValidation.json new file mode 100644 index 00000000..897e2460 --- /dev/null +++ b/plugins/ClaudeConsole/v1/configValidation.json @@ -0,0 +1,13 @@ +{ + "steps": [ + { + "displayName": "Authenticate", + "dataStream": { + "name": "organization" + }, + "required": true, + "success": "Connected to your Claude Console organization.", + "error": "Could not authenticate. Check that your Admin API key (sk-ant-admin...) is valid and belongs to an organization, not an individual account." + } + ] +} diff --git a/plugins/ClaudeConsole/v1/custom_types.json b/plugins/ClaudeConsole/v1/custom_types.json new file mode 100644 index 00000000..d77e7b31 --- /dev/null +++ b/plugins/ClaudeConsole/v1/custom_types.json @@ -0,0 +1,23 @@ +[ + { + "name": "Claude Workspace", + "sourceType": "Claude Workspace", + "icon": "layer-group", + "singular": "Workspace", + "plural": "Workspaces" + }, + { + "name": "Claude API Key", + "sourceType": "Claude API Key", + "icon": "key", + "singular": "API Key", + "plural": "API Keys" + }, + { + "name": "Claude Member", + "sourceType": "Claude Member", + "icon": "user", + "singular": "Member", + "plural": "Members" + } +] diff --git a/plugins/ClaudeConsole/v1/dataStreams/apiKeys.json b/plugins/ClaudeConsole/v1/dataStreams/apiKeys.json new file mode 100644 index 00000000..ef9b7630 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/apiKeys.json @@ -0,0 +1,100 @@ +{ + "name": "apiKeys", + "displayName": "API Keys", + "description": "API keys in your Claude Console organization", + "tags": ["API Keys"], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/api_keys", + "getArgs": [ + { + "key": "limit", + "value": "1000" + }, + { + "key": "created_by_user_id", + "value": "{{ (createdBy && createdBy.length) ? (Array.isArray(createdBy[0].rawId) ? createdBy[0].rawId[0] : createdBy[0].rawId) : null }}" + } + ], + "paging": { + "mode": "none" + }, + "expandInnerObjects": true, + "postRequestScript": "apiKeys.js" + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "workspace", + "label": "Workspace (optional)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": ["Claude Workspace"] + } + } + }, + { + "type": "objects", + "name": "createdBy", + "label": "Created by (optional)", + "matches": { + "sourceType": { "type": "oneOf", "values": ["Claude Member"] } + } + } + ], + "metadata": [ + { + "name": "id", + "displayName": "API Key ID", + "shape": "string" + }, + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "status", + "displayName": "Status", + "shape": [ + "state", + { + "map": { + "success": ["active"], + "unknown": ["expired", "archived", "inactive"] + } + } + ] + }, + { + "name": "workspace_id", + "displayName": "Workspace ID", + "shape": "string" + }, + { + "name": "partial_key_hint", + "displayName": "Key Hint", + "shape": "string" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + }, + { + "name": "expires_at", + "displayName": "Expires", + "shape": "date" + }, + { + "name": "created_by.id", + "displayName": "Created By", + "shape": "string" + } + ], + "timeframes": false +} diff --git a/plugins/ClaudeConsole/v1/dataStreams/cost.json b/plugins/ClaudeConsole/v1/dataStreams/cost.json new file mode 100644 index 00000000..84a84686 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/cost.json @@ -0,0 +1,119 @@ +{ + "name": "cost", + "displayName": "Cost", + "description": "Organization spend in USD over time, one row per workspace/model/token-type bucket per day", + "tags": ["Cost", "Billing"], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/cost_report", + "getArgs": [ + { + "key": "starting_at", + "value": "{{timeframe.start}}" + }, + { + "key": "ending_at", + "value": "{{timeframe.end}}" + }, + { + "key": "bucket_width", + "value": "1d" + }, + { + "key": "group_by[]", + "value": "workspace_id" + }, + { + "key": "group_by[]", + "value": "description" + }, + { + "key": "limit", + "value": "31" + } + ], + "paging": { + "mode": "none" + }, + "postRequestScript": "cost.js" + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "workspace", + "label": "Workspace (optional)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": ["Claude Workspace"] + } + } + } + ], + "metadata": [ + { + "name": "date", + "displayName": "Date", + "shape": "date", + "role": "timestamp" + }, + { + "name": "amount", + "displayName": "Cost ($)", + "shape": [ + "currency", + { + "code": "usd", + "decimalPlaces": 2, + "thousandsSeparator": true + } + ], + "role": "value" + }, + { + "name": "workspace_id", + "displayName": "Workspace ID", + "shape": "string" + }, + { + "name": "workspaceName", + "displayName": "Workspace", + "sourceId": "workspace_id", + "sourceType": "Claude Workspace", + "objectPropertyPath": "name" + }, + { + "name": "description", + "displayName": "Description", + "shape": "string" + }, + { + "name": "model", + "displayName": "Model", + "shape": "string" + }, + { + "name": "token_type", + "displayName": "Token Type", + "shape": "string" + }, + { + "name": "cost_type", + "displayName": "Cost Type", + "shape": "string" + }, + { + "name": "service_tier", + "displayName": "Service Tier", + "shape": "string" + }, + { + "name": "context_window", + "displayName": "Context Window", + "shape": "string" + } + ], + "timeframes": ["last7days", "last30days", "thisMonth", "lastMonth"] +} diff --git a/plugins/ClaudeConsole/v1/dataStreams/members.json b/plugins/ClaudeConsole/v1/dataStreams/members.json new file mode 100644 index 00000000..e1802cd4 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/members.json @@ -0,0 +1,60 @@ +{ + "name": "members", + "displayName": "Members", + "description": "Organization members in your Claude Console organization, with email and role", + "tags": [ + "Members" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/users", + "getArgs": [ + { + "key": "limit", + "value": "1000" + } + ], + "paging": { + "mode": "none" + }, + "pathToData": "data" + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "User ID", + "shape": "string" + }, + { + "name": "name", + "displayName": "Name", + "shape": "string" + }, + { + "name": "email", + "displayName": "Email", + "shape": "string" + }, + { + "name": "role", + "displayName": "Role", + "shape": "string" + }, + { + "name": "added_at", + "displayName": "Added", + "shape": "date" + }, + { + "name": "memberName", + "displayName": "Member", + "computed": true, + "valueExpression": "{{ $['name']?.__isNone ? $['email'] : $['name'] }}", + "shape": "string", + "role": "label" + } + ], + "timeframes": false +} diff --git a/plugins/ClaudeConsole/v1/dataStreams/organization.json b/plugins/ClaudeConsole/v1/dataStreams/organization.json new file mode 100644 index 00000000..463555c2 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/organization.json @@ -0,0 +1,41 @@ +{ + "name": "organization", + "displayName": "Organization", + "description": "Your Claude Console organization id, name, and type", + "tags": [ + "Organization" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/me", + "paging": { + "mode": "none" + }, + "getArgs": [], + "headers": [] + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Organization ID", + "shape": "string" + }, + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "type", + "displayName": "Type", + "shape": "string" + } + ], + "timeframes": false, + "visibility": { + "type": "hidden" + } +} diff --git a/plugins/ClaudeConsole/v1/dataStreams/scripts/apiKeys.js b/plugins/ClaudeConsole/v1/dataStreams/scripts/apiKeys.js new file mode 100644 index 00000000..8cde0c50 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/scripts/apiKeys.js @@ -0,0 +1,20 @@ +const unwrap = (v) => (Array.isArray(v) ? v[0] : v); + +// Build set of selected workspace rawIds (empty → account-wide, no filter) +const selected = (context.config && context.config.workspace) || []; +const workspaceIds = new Set( + selected.map((o) => unwrap(o.rawId)).filter(Boolean), +); + +let rows = data.data.map((a) => ({ + ...a, + // Claude does not let us filter by the default workspace on their api. + workspace_id: a.workspace_id || "default", +})); + +// Apply optional workspace scope filter +if (workspaceIds.size) { + rows = rows.filter((r) => workspaceIds.has(r.workspace_id)); +} + +result = rows; diff --git a/plugins/ClaudeConsole/v1/dataStreams/scripts/cost.js b/plugins/ClaudeConsole/v1/dataStreams/scripts/cost.js new file mode 100644 index 00000000..82fd46e6 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/scripts/cost.js @@ -0,0 +1,37 @@ +// 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); + +// Build set of selected workspace rawIds (empty → account-wide, no filter) +const selected = (context.config && context.config.workspace) || []; +const workspaceIds = new Set( + selected.map((o) => unwrap(o.rawId)).filter(Boolean), +); + +// Flatten buckets × results into one row per combination +let rows = (data.data || []).flatMap((bucket) => + (bucket.results || []).map((r) => ({ + date: bucket.starting_at, + // API returns `amount` in lowest currency units (cents) as a decimal string, + // e.g. "300" cents = $3.00 — divide by 100 to get USD. Verified empirically: + // cost/token matches Claude's published per-model list prices exactly only in cents. + amount: Number(r.amount) / 100, + currency: r.currency, + workspace_id: r.workspace_id ?? "default", + description: r.description, + model: r.model, + token_type: r.token_type, + cost_type: r.cost_type, + service_tier: r.service_tier, + context_window: r.context_window, + })), +); + +// Apply optional workspace scope filter +if (workspaceIds.size) { + rows = rows.filter((r) => workspaceIds.has(r.workspace_id)); +} + +result = rows; + diff --git a/plugins/ClaudeConsole/v1/dataStreams/scripts/usage.js b/plugins/ClaudeConsole/v1/dataStreams/scripts/usage.js new file mode 100644 index 00000000..c06f3160 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/scripts/usage.js @@ -0,0 +1,51 @@ +const unwrap = (v) => (Array.isArray(v) ? v[0] : v); + +// Build set of selected workspace rawIds (empty → account-wide, no filter) +const selected = (context.config && context.config.workspace) || []; +const workspaceIds = new Set( + selected.map((o) => unwrap(o.rawId)).filter(Boolean), +); + +// Flatten nested time-bucket response: data[].results[] → one row per bucket×group +let rows = (data.data || []).flatMap(function (bucket) { + var results = bucket.results; + if (!results || results.length === 0) return []; + return results.map(function (r) { + var uncached = r.uncached_input_tokens || 0; + var cacheRead = r.cache_read_input_tokens || 0; + var creation5m = + (r.cache_creation && r.cache_creation.ephemeral_5m_input_tokens) || + 0; + var creation1h = + (r.cache_creation && r.cache_creation.ephemeral_1h_input_tokens) || + 0; + var output = r.output_tokens || 0; + return { + start: bucket.starting_at, + uncached_input_tokens: uncached, + cache_read_input_tokens: cacheRead, + cache_creation_5m: creation5m, + cache_creation_1h: creation1h, + output_tokens: output, + web_search_requests: + (r.server_tool_use && r.server_tool_use.web_search_requests) || + 0, + total_tokens: + uncached + cacheRead + creation5m + creation1h + output, + model: r.model || null, + workspace_id: r.workspace_id || "default", + api_key_id: r.api_key_id || null, + service_tier: r.service_tier || null, + context_window: r.context_window || null, + account_id: r.account_id || null, + }; + }); +}); + +// Apply optional workspace scope filter +if (workspaceIds.size) { + rows = rows.filter((r) => workspaceIds.has(r.workspace_id)); +} + +result = rows; + diff --git a/plugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.js b/plugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.js new file mode 100644 index 00000000..54257033 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/scripts/workspaces.js @@ -0,0 +1,7 @@ +// List workspaces by default does not include the default workspace +const defaultWorkspace = { + id: "default", + name: "Default", +}; + +result = [...data.data, defaultWorkspace]; diff --git a/plugins/ClaudeConsole/v1/dataStreams/usage.json b/plugins/ClaudeConsole/v1/dataStreams/usage.json new file mode 100644 index 00000000..a1c323de --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/usage.json @@ -0,0 +1,199 @@ +{ + "name": "usage", + "displayName": "Token Usage", + "description": "Organization token usage over time", + "tags": ["Usage", "Tokens"], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/usage_report/messages", + "getArgs": [ + { + "key": "starting_at", + "value": "{{timeframe.start}}" + }, + { + "key": "ending_at", + "value": "{{timeframe.end}}" + }, + { + "key": "bucket_width", + "value": "{{ timeframe.enum === 'last1hour' ? '1m' : (timeframe.enum === 'last12hours' || timeframe.enum === 'last24hours') ? '1h' : '1d' }}" + }, + { + "key": "limit", + "value": "{{ timeframe.enum === 'last1hour' ? '60' : timeframe.enum === 'last12hours' ? '12' : timeframe.enum === 'last24hours' ? '24' : '31' }}" + }, + { + "key": "group_by[]", + "value": "{{ ['workspace_id', 'api_key_id', 'model'] }}" + }, + { + "key": "api_key_ids[]", + "value": "{{ apiKeyFilter?.map(a => a.rawId) || null }}" + }, + { + "key": "account_ids[]", + "value": "{{ member?.map(a => a.rawId) || null }}" + } + ], + "paging": { + "mode": "none" + }, + "postRequestScript": "usage.js" + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "workspace", + "label": "Workspace (optional)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": ["Claude Workspace"] + } + } + }, + { + "type": "objects", + "name": "apiKeyFilter", + "label": "API Key (optional)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": ["Claude API Key"] + } + } + }, + { + "type": "objects", + "name": "member", + "label": "Member (optional)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": ["Claude Member"] + } + } + } + ], + "metadata": [ + { + "name": "start", + "displayName": "Time", + "shape": "date", + "role": "timestamp" + }, + { + "name": "total_tokens", + "displayName": "Total Tokens", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ], + "role": "value" + }, + { + "name": "uncached_input_tokens", + "displayName": "Uncached Input Tokens", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "cache_read_input_tokens", + "displayName": "Cache Read Tokens", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "cache_creation_5m", + "displayName": "Cache Creation (5m)", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "cache_creation_1h", + "displayName": "Cache Creation (1h)", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "output_tokens", + "displayName": "Output Tokens", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "web_search_requests", + "displayName": "Web Search Requests", + "shape": [ + "number", + { + "thousandsSeparator": true + } + ] + }, + { + "name": "model", + "displayName": "Model", + "shape": "string" + }, + { + "name": "workspace_id", + "displayName": "Workspace ID", + "shape": "string" + }, + { + "name": "api_key_id", + "displayName": "API Key ID", + "shape": "string" + }, + { + "name": "service_tier", + "displayName": "Service Tier", + "shape": "string" + }, + { + "name": "context_window", + "displayName": "Context Window", + "shape": "string" + }, + { + "name": "account_id", + "displayName": "Account ID", + "shape": "string" + } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/ClaudeConsole/v1/dataStreams/workspaces.json b/plugins/ClaudeConsole/v1/dataStreams/workspaces.json new file mode 100644 index 00000000..26cc85d4 --- /dev/null +++ b/plugins/ClaudeConsole/v1/dataStreams/workspaces.json @@ -0,0 +1,65 @@ +{ + "name": "workspaces", + "displayName": "Workspaces", + "description": "Workspaces in your Claude Console organization", + "tags": ["Workspaces"], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "v1/organizations/workspaces", + "getArgs": [ + { + "key": "limit", + "value": "1000" + }, + { + "key": "include_archived", + "value": "true" + } + ], + "paging": { + "mode": "none" + }, + "postRequestScript": "workspaces.js" + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Workspace ID", + "shape": "string" + }, + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "display_color", + "displayName": "Display Color", + "shape": "string" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + }, + { + "name": "archived_at", + "displayName": "Archived", + "shape": "string" + }, + { + "name": "status", + "displayName": "Status", + "computed": true, + "valueExpression": "{{ $['archived_at']?.__isNone ? 'active' : 'archived' }}", + "shape": "string" + }, + { + "pattern": ".*" + } + ], + "timeframes": false +} diff --git a/plugins/ClaudeConsole/v1/defaultContent/apiKey.dash.json b/plugins/ClaudeConsole/v1/defaultContent/apiKey.dash.json new file mode 100644 index 00000000..d60f2729 --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/apiKey.dash.json @@ -0,0 +1,99 @@ +{ + "name": "API Key", + "schemaVersion": "1.5", + "timeframe": "last30days", + "variables": ["{{variables.[Claude API Key]}}"], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "b1fb62c0-436b-4a5f-a09b-a341354bc6d4", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "", + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[Claude API Keys]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude API Key]}}" + }, + "variables": ["{{variables.[Claude API Key]}}"], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "columnOrder": ["name", "sourceId", "sourceType"], + "hiddenColumns": ["id", "links", "type", "label"] + } + } + } + } + }, + { + "i": "9f6cee89-ed40-4dce-8e19-da4da8147afb", + "x": 1, + "y": 0, + "w": 3, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Token usage", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude API Key]}}"], + "dataStream": { + "id": "{{dataStreams.usage}}", + "name": "usage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": "model", + "apiKeyFilter": { + "scope": "{{scopes.[Claude API Keys]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude API Key]}}" + } + }, + "group": { + "by": [["start", "byDay"], ["model", "uniqueValues"]], + "aggregate": [{ "type": "sum", "names": ["total_tokens"] }] + }, + "sort": { "by": [["start_byDay", "asc"]] } + }, + "visualisation": { + "type": "data-stream-line-graph", + "config": { + "data-stream-line-graph": { + "xAxisColumn": "start_byDay", + "yAxisColumn": ["total_tokens_sum"], + "seriesColumn": "model_uniqueValues", + "showLegend": true, + "legendPosition": "bottom", + "yAxisLabel": "Tokens", + "showYAxisLabel": true, + "showTrendLine": false + } + } + } + } + } + ] + } +} diff --git a/plugins/ClaudeConsole/v1/defaultContent/manifest.json b/plugins/ClaudeConsole/v1/defaultContent/manifest.json new file mode 100644 index 00000000..2f03e2ad --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/manifest.json @@ -0,0 +1,8 @@ +{ + "items": [ + { "name": "overview", "type": "dashboard" }, + { "name": "workspace", "type": "dashboard" }, + { "name": "apiKey", "type": "dashboard" }, + { "name": "member", "type": "dashboard" } + ] +} diff --git a/plugins/ClaudeConsole/v1/defaultContent/member.dash.json b/plugins/ClaudeConsole/v1/defaultContent/member.dash.json new file mode 100644 index 00000000..46f98c88 --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/member.dash.json @@ -0,0 +1,164 @@ +{ + "name": "Member", + "schemaVersion": "1.5", + "timeframe": "last30days", + "variables": ["{{variables.[Claude Member]}}"], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "61835d71-5aa3-4700-a3f8-763c0377212e", + "x": 0, + "y": 0, + "w": 1, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "", + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[Claude Members]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Member]}}" + }, + "variables": ["{{variables.[Claude Member]}}"], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "columnOrder": [ + "name", + "sourceId", + "sourceType" + ], + "hiddenColumns": [ + "id", + "links", + "type", + "label" + ] + } + } + } + } + }, + { + "i": "1c2d8cbf-0d72-4458-b603-600746125408", + "x": 1, + "y": 0, + "w": 3, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Account usage", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude Member]}}"], + "dataStream": { + "id": "{{dataStreams.usage}}", + "name": "usage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": "model", + "member": { + "scope": "{{scopes.[Claude Members]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Member]}}" + } + }, + "group": { + "by": [ + ["start", "byDay"], + ["model", "uniqueValues"] + ], + "aggregate": [ + { "type": "sum", "names": ["total_tokens"] } + ] + }, + "sort": { "by": [["start_byDay", "asc"]] } + }, + "visualisation": { + "type": "data-stream-line-graph", + "config": { + "data-stream-line-graph": { + "xAxisColumn": "start_byDay", + "yAxisColumn": ["total_tokens_sum"], + "seriesColumn": "model_uniqueValues", + "showLegend": true, + "legendPosition": "bottom", + "yAxisLabel": "Tokens", + "showYAxisLabel": true, + "showTrendLine": false + } + } + } + } + }, + { + "i": "834eb786-b31d-4de2-9c76-20324e0c954a", + "x": 0, + "y": 3, + "w": 4, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "API keys created by this member", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude Member]}}"], + "dataStream": { + "id": "{{dataStreams.apiKeys}}", + "name": "apiKeys", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "createdBy": { + "scope": "{{scopes.[Claude Members]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Member]}}" + } + }, + "sort": { "by": [["created_at", "desc"]] } + }, + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": false, + "columnOrder": [ + "name", + "status", + "workspace_id", + "partial_key_hint", + "created_at" + ], + "hiddenColumns": [ + "id", + "expires_at", + "created_by.id" + ] + } + } + } + } + } + ] + } +} diff --git a/plugins/ClaudeConsole/v1/defaultContent/overview.dash.json b/plugins/ClaudeConsole/v1/defaultContent/overview.dash.json new file mode 100644 index 00000000..34e12dc8 --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/overview.dash.json @@ -0,0 +1,350 @@ +{ + "name": "Overview", + "schemaVersion": "1.5", + "timeframe": "last30days", + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "3b936e1d-5a51-4564-8433-ab653eda871b", + "x": 0, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Spend (this month)", + "description": "", + "timeframe": "thisMonth", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.cost}}", + "name": "cost", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { "type": "sum", "names": ["amount"] } + ] + } + }, + "visualisation": { + "type": "data-stream-scalar", + "config": { + "data-stream-scalar": { + "value": "amount_sum", + "comparisonColumn": "none", + "label": "Spend (this month)" + } + } + } + } + }, + { + "i": "bbb0886c-95d0-4e3d-8f0c-b7238e9a0bdf", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "API Keys", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.apiKeys}}", + "name": "apiKeys", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [{ "type": "count" }] + } + }, + "visualisation": { + "type": "data-stream-scalar", + "config": { + "data-stream-scalar": { + "value": "count", + "comparisonColumn": "none", + "label": "API Keys" + } + } + } + } + }, + { + "i": "93f1f08a-15f9-417d-af84-e9f61b944b1d", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Workspaces", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.workspaces}}", + "name": "workspaces", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [{ "type": "count" }] + } + }, + "visualisation": { + "type": "data-stream-scalar", + "config": { + "data-stream-scalar": { + "value": "count", + "comparisonColumn": "none", + "label": "Workspaces" + } + } + } + } + }, + { + "i": "cc4271c5-4213-4fe2-a711-496805956d23", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Members", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.members}}", + "name": "members", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [{ "type": "count" }] + } + }, + "visualisation": { + "type": "data-stream-scalar", + "config": { + "data-stream-scalar": { + "value": "count", + "comparisonColumn": "none", + "label": "Members" + } + } + } + } + }, + { + "i": "5a4e12dc-5519-4f71-9bd2-32cab4851b7c", + "x": 0, + "y": 2, + "w": 2, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by model", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.cost}}", + "name": "cost", + "pluginConfigId": "{{configId}}", + "group": { + "by": [["model", "uniqueValues"]], + "aggregate": [ + { "type": "sum", "names": ["amount"] } + ] + }, + "sort": { "by": [["amount_sum", "desc"]] } + }, + "visualisation": { + "type": "data-stream-bar-chart", + "config": { + "data-stream-bar-chart": { + "xAxisData": "model_uniqueValues", + "yAxisData": ["amount_sum"], + "xAxisGroup": "none", + "xAxisLabel": "Model", + "yAxisLabel": "Cost ($)", + "showXAxisLabel": true, + "showYAxisLabel": true, + "showLegend": false, + "legendPosition": "bottom", + "showGrid": true, + "horizontalLayout": "vertical", + "displayMode": "actual", + "showTotals": false, + "showValue": false, + "grouping": false, + "range": { "type": "auto" } + } + } + } + } + }, + { + "i": "395568a1-011b-4bd5-97b5-82a6036751bf", + "x": 2, + "y": 2, + "w": 2, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Top workspaces by cost", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.cost}}", + "name": "cost", + "pluginConfigId": "{{configId}}", + "group": { + "by": [["workspaceName", "uniqueValues"]], + "aggregate": [ + { "type": "sum", "names": ["amount"] } + ] + }, + "sort": { "by": [["amount_sum", "desc"]], "top": 10 } + }, + "visualisation": { + "type": "data-stream-bar-chart", + "config": { + "data-stream-bar-chart": { + "xAxisData": "workspaceName_uniqueValues", + "yAxisData": ["amount_sum"], + "xAxisGroup": "none", + "xAxisLabel": "Workspace", + "yAxisLabel": "Cost ($)", + "showXAxisLabel": true, + "showYAxisLabel": true, + "showLegend": false, + "legendPosition": "bottom", + "showGrid": true, + "horizontalLayout": "vertical", + "displayMode": "actual", + "showTotals": false, + "showValue": false, + "grouping": false, + "range": { "type": "auto" } + } + } + } + } + }, + { + "i": "f34dba89-1604-452f-b664-4ee17dd121d5", + "x": 0, + "y": 4, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Token usage by model", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.usage}}", + "name": "usage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { "groupBy": "model" }, + "group": { + "by": [ + ["start", "byDay"], + ["model", "uniqueValues"] + ], + "aggregate": [ + { "type": "sum", "names": ["total_tokens"] } + ] + }, + "sort": { "by": [["start_byDay", "asc"]] } + }, + "visualisation": { + "type": "data-stream-line-graph", + "config": { + "data-stream-line-graph": { + "xAxisColumn": "start_byDay", + "yAxisColumn": ["total_tokens_sum"], + "seriesColumn": "model_uniqueValues", + "showLegend": true, + "legendPosition": "bottom", + "yAxisLabel": "Tokens", + "showYAxisLabel": true, + "showTrendLine": false + } + } + } + } + }, + { + "i": "b2fa736c-a4c6-4f30-9738-ae448be278df", + "x": 0, + "y": 6, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "API Keys", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "dataStream": { + "id": "{{dataStreams.apiKeys}}", + "name": "apiKeys", + "pluginConfigId": "{{configId}}", + "sort": { "by": [["created_at", "desc"]] } + }, + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": false, + "columnOrder": [ + "name", + "status", + "workspace_id", + "partial_key_hint", + "created_at" + ], + "hiddenColumns": [ + "id", + "expires_at", + "created_by.id" + ] + } + } + } + } + } + ] + } +} diff --git a/plugins/ClaudeConsole/v1/defaultContent/scopes.json b/plugins/ClaudeConsole/v1/defaultContent/scopes.json new file mode 100644 index 00000000..80f0ef9d --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/scopes.json @@ -0,0 +1,38 @@ +[ + { + "name": "Claude Workspaces", + "matches": { + "sourceType": { "type": "oneOf", "values": ["Claude Workspace"] } + }, + "variable": { + "name": "Claude Workspace", + "type": "object", + "default": "none", + "allowMultipleSelection": false + } + }, + { + "name": "Claude API Keys", + "matches": { + "sourceType": { "type": "oneOf", "values": ["Claude API Key"] } + }, + "variable": { + "name": "Claude API Key", + "type": "object", + "default": "none", + "allowMultipleSelection": false + } + }, + { + "name": "Claude Members", + "matches": { + "sourceType": { "type": "oneOf", "values": ["Claude Member"] } + }, + "variable": { + "name": "Claude Member", + "type": "object", + "default": "none", + "allowMultipleSelection": false + } + } +] diff --git a/plugins/ClaudeConsole/v1/defaultContent/workspace.dash.json b/plugins/ClaudeConsole/v1/defaultContent/workspace.dash.json new file mode 100644 index 00000000..3a4da9c7 --- /dev/null +++ b/plugins/ClaudeConsole/v1/defaultContent/workspace.dash.json @@ -0,0 +1,215 @@ +{ + "name": "Workspace", + "schemaVersion": "1.5", + "timeframe": "last30days", + "variables": ["{{variables.[Claude Workspace]}}"], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "000cafdc-39cc-4259-b46c-6bfe01bc61dd", + "x": 0, + "y": 0, + "w": 1, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "", + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[Claude Workspaces]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Workspace]}}" + }, + "variables": ["{{variables.[Claude Workspace]}}"], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "columnOrder": [ + "name", + "sourceId", + "sourceType" + ], + "hiddenColumns": [ + "id", + "links", + "type", + "label" + ] + } + } + } + } + }, + { + "i": "f5562a7c-2bbc-42e9-bf03-2cb3cadef87e", + "x": 1, + "y": 0, + "w": 3, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost over time", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude Workspace]}}"], + "dataStream": { + "id": "{{dataStreams.cost}}", + "name": "cost", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "workspace": { + "scope": "{{scopes.[Claude Workspaces]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Workspace]}}" + } + }, + "group": { + "by": [["date", "byDay"]], + "aggregate": [ + { "type": "sum", "names": ["amount"] } + ] + }, + "sort": { "by": [["date_byDay", "asc"]] } + }, + "visualisation": { + "type": "data-stream-line-graph", + "config": { + "data-stream-line-graph": { + "xAxisColumn": "date_byDay", + "yAxisColumn": ["amount_sum"], + "seriesColumn": "none", + "showLegend": false, + "legendPosition": "bottom", + "yAxisLabel": "Cost ($)", + "showYAxisLabel": true, + "showTrendLine": false + } + } + } + } + }, + { + "i": "393d5f28-2dbc-407d-936e-9da6d15886ec", + "x": 0, + "y": 3, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Usage by model", + "description": "", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude Workspace]}}"], + "dataStream": { + "id": "{{dataStreams.usage}}", + "name": "usage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": "model", + "workspace": { + "scope": "{{scopes.[Claude Workspaces]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Workspace]}}" + } + }, + "group": { + "by": [ + ["start", "byDay"], + ["model", "uniqueValues"] + ], + "aggregate": [ + { "type": "sum", "names": ["total_tokens"] } + ] + }, + "sort": { "by": [["start_byDay", "asc"]] } + }, + "visualisation": { + "type": "data-stream-line-graph", + "config": { + "data-stream-line-graph": { + "xAxisColumn": "start_byDay", + "yAxisColumn": ["total_tokens_sum"], + "seriesColumn": "model_uniqueValues", + "showLegend": true, + "legendPosition": "bottom", + "yAxisLabel": "Tokens", + "showYAxisLabel": true, + "showTrendLine": false + } + } + } + } + }, + { + "i": "bd36baee-a12c-4bae-9a05-503ff39ca34e", + "x": 0, + "y": 6, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "API keys in this workspace", + "description": "", + "timeframe": "none", + "activePluginConfigIds": ["{{configId}}"], + "variables": ["{{variables.[Claude Workspace]}}"], + "dataStream": { + "id": "{{dataStreams.apiKeys}}", + "name": "apiKeys", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "workspace": { + "scope": "{{scopes.[Claude Workspaces]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Claude Workspace]}}" + } + }, + "sort": { "by": [["created_at", "desc"]] } + }, + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": false, + "columnOrder": [ + "name", + "status", + "partial_key_hint", + "created_at", + "expires_at" + ], + "hiddenColumns": [ + "id", + "workspace_id", + "created_by.id" + ] + } + } + } + } + } + ] + } +} diff --git a/plugins/ClaudeConsole/v1/docs/README.md b/plugins/ClaudeConsole/v1/docs/README.md new file mode 100644 index 00000000..9197434b --- /dev/null +++ b/plugins/ClaudeConsole/v1/docs/README.md @@ -0,0 +1,53 @@ +# Claude Console + +Monitor your organization's **Claude Console** (Anthropic) usage, spend, and administrative resources in SquaredUp using the [Anthropic Admin API](https://platform.claude.com/docs/en/api/administration-api) and [Usage & Cost API](https://platform.claude.com/docs/en/api/usage-cost-api). + +This plugin imports your workspaces, API keys, and organization members into the SquaredUp graph, and provides data streams for token usage and cost — broken down by model, workspace, API key, member, and service tier, over time. + +## Prerequisites — getting an Admin API key + +> ⚠️ **The Admin API is unavailable for individual accounts.** You need an Anthropic **organization** (Console → Settings → Organization) and the **admin**, **owner**, or **primary owner** role. + +1. Sign in to the [Claude Console](https://console.anthropic.com/). +2. Go to **Settings → Admin keys** (see [Create an Admin API key](https://platform.claude.com/docs/en/manage-claude/admin-api-keys)). +3. Create a new Admin API key. It will start with **`sk-ant-admin…`** — this is different from a standard API key (`sk-ant-api…`) and a standard key will **not** work. +4. Copy the key somewhere safe; you will paste it into SquaredUp during setup. + +> **Note:** This plugin targets the **Claude Console (Claude Platform)** Admin API. Claude **Enterprise** (claude.ai) organizations use a different Analytics API and key type, which this plugin does not support. The programmatic Usage & Cost API is also not currently available on Claude Platform on AWS. + +## Configuration fields + +| Field | What it is | Where to find it | Required | +| ----------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------- | +| **Admin API Key** | Your organization's Admin API key, used to authenticate every request via the `x-api-key` header. | Claude Console → Settings → Admin keys (starts with `sk-ant-admin…`). | Yes | + +On save, the plugin validates the key by calling `GET /v1/organizations/me`. If the key is invalid, not an admin key, or belongs to an individual account, setup will fail with an authentication error. + +## What this plugin monitors + +- **Token usage** — uncached input, cache read, cache creation (5-minute and 1-hour), and output tokens, plus web-search request counts, grouped by model / workspace / API key / member / service tier / context window over a chosen time range. +- **Cost** — daily spend in USD, broken down by model, token type, cost type (tokens / web search / code execution / session usage), and workspace. +- **Workspaces, API keys, and members** — imported as objects you can scope dashboards to, search, and drill into. + +The out-of-the-box dashboards include an account-wide **Overview** plus a perspective for each **Workspace**, **API Key**, and **Member**. + +## What gets indexed + +| Object type | API source | Represents | +| -------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| **Claude Workspace** | `GET /v1/organizations/workspaces` | A workspace in your organization — the container for API keys and the primary cost/usage attribution dimension. | +| **Claude API Key** | `GET /v1/organizations/api_keys` | An API key, including its status, partially-redacted hint, creating user, and owning workspace. | +| **Claude Member** | `GET /v1/organizations/users` | An organization member, including email, name, and organization role. | + +**Relationships:** each API Key links to its owning Workspace and to the Member who created it. + +## Known limitations + +- **Admin/organization access required** — see Prerequisites. Individual accounts and Enterprise/claude.ai organizations are not supported. +- **Cost is daily-granularity only.** The Cost API only returns daily (`1d`) buckets, so cost dashboards are limited to ranges up to ~31 days (last 7 days, last 30 days, this month, last month). Quarter/year ranges are not offered. +- **Usage time granularity is capped by the API.** The Usage API limits a single response to 31 daily, 168 hourly, or 1440 minute buckets, so usage timeframes are limited to ranges up to ~31 days. The bucket width is chosen automatically from the selected timeframe. +- **Default-workspace attribution.** Usage and cost incurred against the _default_ workspace (and Console/Workbench usage with no API key) are reported by the API with a `null` workspace/API-key — they appear as unattributed rather than under a named workspace object. +- **Priority Tier costs** are billed differently and are not included in the Cost API; track Priority Tier through token usage instead. +- **Data freshness** — usage and cost data typically appears within ~5 minutes of an API request completing. +- **Large organizations (>1000 objects).** Workspaces, API keys, and members are imported up to 1000 of each per type; organizations with more than 1000 of any one type would have the remainder omitted. +- **Read-only.** This plugin only reads data; it does not create, modify, or delete any Anthropic resources. diff --git a/plugins/ClaudeConsole/v1/icon.svg b/plugins/ClaudeConsole/v1/icon.svg new file mode 100644 index 00000000..f56d39fd --- /dev/null +++ b/plugins/ClaudeConsole/v1/icon.svg @@ -0,0 +1,7 @@ + + Claude + + + + + diff --git a/plugins/ClaudeConsole/v1/indexDefinitions/default.json b/plugins/ClaudeConsole/v1/indexDefinitions/default.json new file mode 100644 index 00000000..db17cb52 --- /dev/null +++ b/plugins/ClaudeConsole/v1/indexDefinitions/default.json @@ -0,0 +1,67 @@ +{ + "steps": [ + { + "name": "workspaces", + "dataStream": { + "name": "workspaces" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "name", + "type": { + "value": "Claude Workspace" + }, + "properties": [ + "display_color", + "created_at", + "archived_at", + "status" + ] + } + }, + { + "name": "apiKeys", + "dataStream": { + "name": "apiKeys" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "name", + "type": { + "value": "Claude API Key" + }, + "properties": [ + "status", + "workspace_id", + "partial_key_hint", + "created_at", + "expires_at", + { + "createdByUserId": "created_by.id" + } + ] + } + }, + { + "name": "members", + "dataStream": { + "name": "members" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "memberName", + "type": { + "value": "Claude Member" + }, + "properties": [ + "email", + "role", + "added_at" + ] + } + } + ] +} diff --git a/plugins/ClaudeConsole/v1/metadata.json b/plugins/ClaudeConsole/v1/metadata.json new file mode 100644 index 00000000..2b2bee53 --- /dev/null +++ b/plugins/ClaudeConsole/v1/metadata.json @@ -0,0 +1,63 @@ +{ + "name": "claude-console", + "displayName": "Claude Console", + "version": "1.0.0", + "author": { + "name": "@andrewmumblebee", + "type": "community" + }, + "description": "Monitor your Claude Console (Anthropic) organization's token usage, cost, API keys, workspaces, and members via the Anthropic Admin API.", + "category": "Monitoring", + "type": "hybrid", + "schemaVersion": "2.1", + "importNotSupported": false, + "restrictedToPlatforms": [], + "keywords": [ + "claude", + "anthropic", + "ai", + "llm", + "cost", + "usage", + "tokens", + "billing", + "admin api", + "console" + ], + "objectTypes": [ + "Claude Workspace", + "Claude API Key", + "Claude Member" + ], + "links": [ + { + "category": "documentation", + "url": "https://github.com/squaredup/plugins/blob/main/plugins/ClaudeConsole/v1/docs/README.md", + "label": "Help adding this plugin" + }, + { + "category": "source", + "url": "https://github.com/squaredup/plugins/tree/main/plugins/ClaudeConsole/v1", + "label": "Repository" + } + ], + "base": { + "plugin": "WebAPI", + "majorVersion": "1", + "config": { + "baseUrl": "https://api.anthropic.com/", + "authMode": "none", + "headers": [ + { + "key": "x-api-key", + "value": "{{adminApiKey}}" + }, + { + "key": "anthropic-version", + "value": "2023-06-01" + } + ], + "queryArgs": [] + } + } +} diff --git a/plugins/ClaudeConsole/v1/ui.json b/plugins/ClaudeConsole/v1/ui.json new file mode 100644 index 00000000..98901248 --- /dev/null +++ b/plugins/ClaudeConsole/v1/ui.json @@ -0,0 +1,12 @@ +[ + { + "type": "password", + "name": "adminApiKey", + "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" + } +]