get_costs
Retrieve OpenAI usage costs for a specified time period, optionally filtering by project IDs and grouping by fields like project_id or line_item.
Instructions
Fetches OpenAI costs for the specified period.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
end_time | No | The end time as a UTC timestamp (defaults to now). | |
group_by | No | 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. | |
project_ids | No | The project IDs to filter by (optional). | |
start_time | Yes | The 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"
}