Skip to main content
Glama
dlaporte

openai-usage-mcp

by dlaporte

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENAI_ADMIN_KEYYesYour OpenAI Admin API key

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
costsA

Query OpenAI dollar-amount spend data.

USE THIS TOOL FOR:

  • Total spend over a date range (summary mode, default)

  • Daily cost breakdown by line item or project

  • Month-to-date spend with projected month-end forecast

  • Identifying cost anomalies (spike days highlighted in summary)

DO NOT USE THIS TOOL FOR:

  • Token or request counts (use 'usage' tool instead)

  • Comparing two different months side by side (use 'cost-comparison' tool)

DETAIL LEVELS:

  • summary (default): Compact total + top-N breakdown table (~20 lines). Includes projected month-end spend and anomaly detection when applicable.

  • daily: Per-day breakdown with per-item amounts.

  • raw: Full unprocessed data, every line item every day.

DEFAULTS: detail_level='summary', group_by='line_item', top_n=10, end_time=today

EXAMPLES:

  • This month's spend: start_time="2026-03-01"

  • Last 7 days by project: start_time="2026-03-23", group_by="project_id"

  • Daily breakdown for February: start_time="2026-02-01", end_time="2026-03-01", detail_level="daily"

Dates in YYYY-MM-DD format.

usageA

Query OpenAI token and request usage data by service type.

USE THIS TOOL FOR:

  • Token consumption (input, output, cached) by model

  • Request counts over time

  • Usage breakdown by model, project, or API key

  • Image generation counts, audio seconds, etc.

DO NOT USE THIS TOOL FOR:

  • Dollar-amount costs (use 'costs' tool instead)

  • Month-over-month cost comparisons (use 'cost-comparison' tool)

SERVICE TYPES: completions, embeddings, images, audio_speeches, audio_transcriptions, moderations, vector_stores, code_interpreter_sessions

DETAIL LEVELS:

  • summary (default): Compact table aggregated by model with totals.

  • daily: Per-day breakdown.

  • raw: Full unprocessed data.

DEFAULTS: detail_level='summary', bucket_width='1d', top_n=10, end_time=today

EXAMPLES:

  • GPT-4o usage this month: service_type="completions", start_time="2026-03-01", models="gpt-4o"

  • All completions last week: service_type="completions", start_time="2026-03-23"

  • Embeddings by project: service_type="embeddings", start_time="2026-03-01", group_by="project_id"

Dates in YYYY-MM-DD format.

cost-comparisonA

Compare OpenAI costs between two months to identify spending changes.

USE THIS TOOL FOR:

  • Month-over-month cost variance analysis (e.g., February vs March)

  • Identifying which line items increased or decreased the most

  • Executive-level cost change summaries

DO NOT USE THIS TOOL FOR:

  • Single-month cost analysis (use 'costs' tool instead)

  • Token or request usage data (use 'usage' tool instead)

  • Arbitrary date range comparisons (this tool compares full calendar months only)

PARAMETERS:

  • baseline_month: Earlier month in YYYY-MM format (e.g., "2026-02")

  • comparison_month: Later month in YYYY-MM format (e.g., "2026-03")

  • group_by: "line_item" (default), "project_id", or both

  • top_n: Number of items to show (default 10)

OUTPUT includes:

  • Total spend for each month with overall delta and % change

  • Per-line-item comparison table with delta and % change

  • Biggest movers section highlighting largest increase and decrease

EXAMPLES:

  • February vs March: baseline_month="2026-02", comparison_month="2026-03"

  • By project: baseline_month="2026-02", comparison_month="2026-03", group_by="project_id"

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dlaporte/openai-usage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server