Openai Usage Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Openai Usage Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
MCP server for accessing OpenAI platform usage and cost data through the OpenAI Admin API.
Note: This server accesses cost and usage data from the OpenAI Admin API. All API calls are performed using the caller's admin key and are subject to OpenAI's rate limits.
Add to your MCP client configuration (e.g., Claude Desktop, Claude Code):
{
"mcpServers": {
"openai-usage-mcp": {
"command": "uv",
"args": ["run", "--directory", "/path/to/openai-usage-mcp", "openai-usage-mcp"],
"env": {
"OPENAI_ADMIN_KEY": "sk-admin-..."
}
}
}
}{
"mcpServers": {
"openai-usage-mcp": {
"command": "uvx",
"args": ["openai-usage-mcp"],
"env": {
"OPENAI_ADMIN_KEY": "sk-admin-..."
}
}
}
}costsQuery OpenAI dollar-amount spend data.
| Parameter | Type | Default | Description |
|---|---|---|---|
start_time | string | (required) | Start date (YYYY-MM-DD) |
end_time | string | today | End date (YYYY-MM-DD) |
detail_level | string | "summary" | "summary", "daily", or "raw" |
group_by | string | "line_item" | "line_item", "project_id", or both |
top_n | int | 10 | Number of top items to show |
limit | int | 180 | Max daily buckets to fetch (1-180) |
Detail levels:
Examples:
# This month's spend
costs(start_time="2026-03-01")
# Last 7 days by project
costs(start_time="2026-03-23", group_by="project_id")
# Daily breakdown for February
costs(start_time="2026-02-01", end_time="2026-03-01", detail_level="daily")cost-comparisonCompare OpenAI costs between two calendar months.
| Parameter | Type | Default | Description |
|---|---|---|---|
baseline_month | string | (required) | Earlier month (YYYY-MM) |
comparison_month | string | (required) | Later month (YYYY-MM) |
group_by | string | "line_item" | "line_item", "project_id", or both |
top_n | int | 10 | Number of top items to show |
Output includes:
Examples:
# February vs March
cost-comparison(baseline_month="2026-02", comparison_month="2026-03")
# By project
cost-comparison(baseline_month="2026-02", comparison_month="2026-03", group_by="project_id")usageQuery OpenAI token and request usage data by service type.
| Parameter | Type | Default | Description |
|---|---|---|---|
service_type | string | (required) | See supported types below |
start_time | string | (required) | Start date (YYYY-MM-DD) |
end_time | string | today | End date (YYYY-MM-DD) |
detail_level | string | "summary" | "summary" or "raw" |
bucket_width | string | "1d" | "1m", "1h", or "1d" |
group_by | string | — | "model", "project_id", etc. |
models | string | — | Filter by model name(s) |
project_ids | string | — | Filter by project ID(s) |
top_n | int | 10 | Number of top models to show |
limit | int | 180 | Max buckets to fetch |
Supported service types: completions, embeddings, images, audio_speeches, audio_transcriptions, moderations, vector_stores, code_interpreter_sessions
Examples:
# GPT-4o usage this month
usage(service_type="completions", start_time="2026-03-01", models="gpt-4o")
# All completions last week
usage(service_type="completions", start_time="2026-03-23")
# Embeddings by project
usage(service_type="embeddings", start_time="2026-03-01", group_by="project_id")This server requires an OpenAI Admin API key set via the OPENAI_ADMIN_KEY environment variable.
Admin keys can be created at platform.openai.com/settings/organization/admin-keys.
The key needs the Usage read permission to access cost and usage data.
# Clone and install
git clone https://github.com/dlaporte/openai-usage-mcp.git
cd openai-usage-mcp
uv sync --dev
# Run tests
uv run pytest -v
# Run the server locally
OPENAI_ADMIN_KEY=sk-admin-... uv run openai-usage-mcpMIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.