# Keywords AI MCP MCP

> Keywords AI monitors your entire LLM API usage pipeline. It tracks costs, latency, and model performance across any provider using a unified gateway. You get visibility into credit consumption and request logs so you know exactly how much every call is costing you.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** llm-observability, api-gateway, cost-tracking, model-performance, latency-monitoring, usage-analytics

## Description

When running multiple large language models, tracking everything becomes a headache. Do you know which model is slow? Which one's chewing up your budget? This MCP connects to Keywords AI, giving your agent the necessary visibility into your LLM API stack. It acts as a central reporting hub for all your calls, letting you check usage statistics and view cost trends in one place. You can list models available or review historical request logs to pinpoint performance bottlenecks immediately. If you're working with an array of different AI tools, connecting this MCP via Vinkius gives you a single pane of glass to monitor credit balances and overall API health.

## Tools

### check_keywordsai_status
Verifies if your API connection to Keywords AI is active and working.

### get_analytics
Pulls the overall system dashboard, showing cost trends, success rates, and latency data.

### get_credits
Retrieves your remaining API credit balance for immediate spending awareness.

### get_request
Gathers specific details about a single, recorded API request.

### get_usage_stats
Provides current and historical usage statistics for your LLM services.

### get_user
Fetches details about the user account associated with this API key.

### list_alerts
Reviews predefined monitoring thresholds and active system alerts.

### list_models
Lists all LLM models that are currently available for connection and use.

### list_requests_by_model
Filters and lists all requests, showing logs specific to one chosen LLM model.

### list_requests
Retrieves a general log of recent API calls made through the gateway.

### list_users
Lists the team members who have access or are connected to this API account.

## Prompt Examples

**Prompt:** 
```
Show my current credit balance.
```

**Response:** 
```
Credit balance: .50 remaining. Usage this month: .80. Top model by cost: GPT-4 (.10).
```

**Prompt:** 
```
List all requests using GPT-4.
```

**Response:** 
```
234 requests using GPT-4 this month. Average latency: 1.2s, average tokens: 850, total cost: .10.
```

**Prompt:** 
```
Show analytics dashboard.
```

**Response:** 
```
Analytics summary: 1,234 total requests, .80 total cost, 98.2% success rate, p50 latency 890ms, p99 2.1s.
```

## Capabilities

### View Usage Statistics
Get detailed metrics on total requests and consumed resources across your LLM models.

### Track Credit Balance
Check your current credit balance to prevent unexpected service cutoffs.

### Analyze API Logs
List and filter all past LLM API calls to understand patterns in your usage.

### Get Performance Analytics
View cost trends, latency averages, and success rates for deep system analysis.

### List Available Models
See a catalog of all LLM models you can connect to and use.

## Use Cases

### The Budget Overrun Discovery
A platform architect notices unexpected bills. They ask the agent to run `get_usage_stats`, which immediately highlights that a specific, older model is responsible for 70% of token usage and needs deprecation.

### The Slow Feature Flag
A developer adds a new feature using an LLM. They ask the agent to run `list_requests` and find that every request is failing with a high error rate, pointing them straight to a needed credential update.

### Model Performance Comparison
The ML engineer needs to decide between two models. They instruct the agent to `list_requests_by_model` for both candidates and compare the average latency and cost side-by-side before committing to one.

### Security Audit
A manager needs to know who has access. Running `list_users` provides an immediate roster, ensuring only authorized personnel are using the API keys.

## Benefits

- Stop guessing about costs. Use `get_credits` to instantly check your remaining API balance before making a call, preventing service interruptions.
- Pinpoint performance issues by running `list_requests_by_model`. This lets you compare the latency of GPT-4 versus Claude on the same task.
- Avoid debugging manual dashboards. The `get_analytics` tool consolidates cost trends and success rates into one report, saving hours of spreadsheet work.
- Know who's using what. Run `list_users` to see exactly which team members are connected to this API key and reviewing activity logs.
- Scale confidently. By viewing the full model catalog with `list_models`, you can easily test new LLMs without knowing their pricing structure upfront.

## How It Works

The bottom line is that instead of jumping between provider dashboards, you get one place to monitor every dollar spent on LLM calls.

1. Connect your agent to this MCP using your Keywords AI account credentials.
2. Call tools like `get_usage_stats` or `list_requests_by_model` to pull the monitoring data.
3. The system aggregates and presents a clear report showing costs, latency metrics, and usage counts.

## Frequently Asked Questions

**How do I find out what models are available using `list_models`?**
`list_models` gives you a catalog of all LLMs supported by the gateway. This is useful before writing code because it confirms which providers and versions your agent can actually connect to.

**What's the difference between `get_usage_stats` and `get_analytics`?**
`get_usage_stats` gives you current, raw numbers—like total calls this month. `get_analytics`, however, provides deeper trends over time, showing cost growth curves and success rate averages.

**I need to check if my API key is active; what tool should I use?**
Use `check_keywordsai_status`. It's the fastest way to verify connectivity. If that call fails, you know your problem isn't in your code; it's an authentication issue.

**Can I see which users are connected to my account?**
Yes, run `list_users`. This provides a list of all team members associated with the API key and helps you manage access permissions across your organization.

**How do I check my remaining budget or credit balance using `get_credits`?**
Use get_credits. This tool immediately shows your current available credits, as well as the total usage tracked for the current billing cycle.

**I have a specific API call ID; how do I get full details using `get_request`?**
Use get_request. This pulls the entire context for any single request, including its input parameters and final execution outcome, which is great for debugging.

**How do I manage or review my configured performance thresholds using `list_alerts`?**
Use list_alerts. This displays all active monitoring rules. You can view the set thresholds for cost limits, latency spikes, and error rates, and then adjust them as needed.

**I need to review every API usage log; should I use `list_requests`?**
Use list_requests. This function provides a comprehensive history of all API calls made through the gateway, allowing you to filter logs by date range or other criteria.

**Can my AI track LLM costs?**
Yes. `get_credits` shows your balance, `get_usage_stats` breaks down costs by model and time period.

**Can I filter request logs by model?**
Yes. `list_requests_by_model` returns only requests made to a specific LLM.

**What analytics are available?**
`get_analytics` provides cost trends, latency percentiles, error rates, and token usage over time.