Portkey MCP Server

get_cost_analytics

Retrieve detailed cost analytics data over time, including total costs and averages per request. Filter by AI provider, API keys, tokens, costs, metadata, and time period to analyze usage and expenses effectively.

Instructions

Retrieve detailed cost analytics data over time, including total costs and averages per request

Input Schema

NameRequiredDescriptionDefault
ai_org_modelNoFilter by AI provider and model (comma-separated, use __ as separator)
api_key_idsNoFilter by specific API key UUIDs (comma-separated)
completion_token_maxNoMaximum number of completion tokens
completion_token_minNoMinimum number of completion tokens
configsNoFilter by specific config slugs (comma-separated)
cost_maxNoMaximum cost in cents to filter by
cost_minNoMinimum cost in cents to filter by
metadataNoFilter by metadata (stringified JSON object)
prompt_token_maxNoMaximum number of prompt tokens
prompt_token_minNoMinimum number of prompt tokens
span_idNoFilter by span IDs (comma-separated)
status_codeNoFilter by specific HTTP status codes (comma-separated)
time_of_generation_maxYesEnd time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z')
time_of_generation_minYesStart time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z')
total_units_maxNoMaximum number of total tokens to filter by
total_units_minNoMinimum number of total tokens to filter by
trace_idNoFilter by trace IDs (comma-separated)
virtual_keysNoFilter by specific virtual key slugs (comma-separated)
weighted_feedback_maxNoMaximum weighted feedback score (-10 to 10)
weighted_feedback_minNoMinimum weighted feedback score (-10 to 10)
workspace_slugNoFilter by specific workspace

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "ai_org_model": { "description": "Filter by AI provider and model (comma-separated, use __ as separator)", "type": "string" }, "api_key_ids": { "description": "Filter by specific API key UUIDs (comma-separated)", "type": "string" }, "completion_token_max": { "description": "Maximum number of completion tokens", "exclusiveMinimum": 0, "type": "number" }, "completion_token_min": { "description": "Minimum number of completion tokens", "exclusiveMinimum": 0, "type": "number" }, "configs": { "description": "Filter by specific config slugs (comma-separated)", "type": "string" }, "cost_max": { "description": "Maximum cost in cents to filter by", "exclusiveMinimum": 0, "type": "number" }, "cost_min": { "description": "Minimum cost in cents to filter by", "exclusiveMinimum": 0, "type": "number" }, "metadata": { "description": "Filter by metadata (stringified JSON object)", "type": "string" }, "prompt_token_max": { "description": "Maximum number of prompt tokens", "exclusiveMinimum": 0, "type": "number" }, "prompt_token_min": { "description": "Minimum number of prompt tokens", "exclusiveMinimum": 0, "type": "number" }, "span_id": { "description": "Filter by span IDs (comma-separated)", "type": "string" }, "status_code": { "description": "Filter by specific HTTP status codes (comma-separated)", "type": "string" }, "time_of_generation_max": { "description": "End time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z')", "type": "string" }, "time_of_generation_min": { "description": "Start time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z')", "type": "string" }, "total_units_max": { "description": "Maximum number of total tokens to filter by", "exclusiveMinimum": 0, "type": "number" }, "total_units_min": { "description": "Minimum number of total tokens to filter by", "exclusiveMinimum": 0, "type": "number" }, "trace_id": { "description": "Filter by trace IDs (comma-separated)", "type": "string" }, "virtual_keys": { "description": "Filter by specific virtual key slugs (comma-separated)", "type": "string" }, "weighted_feedback_max": { "description": "Maximum weighted feedback score (-10 to 10)", "maximum": 10, "minimum": -10, "type": "number" }, "weighted_feedback_min": { "description": "Minimum weighted feedback score (-10 to 10)", "maximum": 10, "minimum": -10, "type": "number" }, "workspace_slug": { "description": "Filter by specific workspace", "type": "string" } }, "required": [ "time_of_generation_min", "time_of_generation_max" ], "type": "object" }

You must be authenticated.

Other Tools from Portkey MCP Server

Related Tools

ID: iftjfqrk0v