Skip to main content
Glama

Narev LLM Pricing

calculate_cost

Calculate the cost of an AI model inference given token usage

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model_id": "<model_id>",
      "provider_id": "<provider_id>",
      "prompt_tokens": "<prompt_tokens>",
      "completion_tokens": "<completion_tokens>"
    },
    "name": "calculate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
model_idYesModel ID, e.g. "gpt-4o"
provider_idYesProvider ID, e.g. "openai"
prompt_tokensYes
reasoning_tokensNo
web_search_countNo
cache_read_tokensNo
completion_tokensYes
cache_write_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources