Skip to main content
Glama

OpenAI MCP Server

by Supermaxman

get_costs

Retrieve OpenAI API usage costs within a specified timeframe. Group and filter expenses by project IDs or line items for detailed cost analysis.

Instructions

Fetches OpenAI costs for the specified period.

Input Schema

NameRequiredDescriptionDefault
end_timeNoThe end time as a UTC timestamp (defaults to now).
group_byNoThe fields to group by (optional). Group the costs by the specified fields. Support fields include project_id, line_item and any combination of them.
project_idsNoThe project IDs to filter by (optional).
start_timeYesThe start time as a UTC timestamp.

Input Schema (JSON Schema)

{ "properties": { "end_time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "The end time as a UTC timestamp (defaults to now).", "title": "End Time" }, "group_by": { "anyOf": [ { "items": { "enum": [ "project_id", "line_item" ], "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The fields to group by (optional). Group the costs by the specified fields. Support fields include project_id, line_item and any combination of them.", "title": "Group By" }, "project_ids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The project IDs to filter by (optional).", "title": "Project Ids" }, "start_time": { "description": "The start time as a UTC timestamp.", "format": "date-time", "title": "Start Time", "type": "string" } }, "required": [ "start_time" ], "type": "object" }
Install Server

Other Tools from OpenAI MCP Server

Related Tools

    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/Supermaxman/mcp-server-openai'

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