# Portkey MCP for AI Agents AI Agent Connect

> Portkey MCP for AI agents. Monitor logs, track costs, and manage LLM configurations across multiple providers in one place. It gives your agent the ability to audit usage, enforce budget policies, and review gateway settings without manual dashboard navigation.

## Overview
- **Category:** ai-frontier
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_BpHtQMK896fkGyepmah9cM552NpibU6fUP5BakNG/ai-agent-connect
- **Tags:** llm-gateway, ai-observability, token-tracking, cost-management, model-routing, prompt-engineering

## Description

Managing multiple LLM providers usually means jumping between different dashboards to check spend, debug latency, and rotate keys. It's a mess for anyone trying to keep costs under control or maintain consistent performance across a fleet of agents. This Connector changes that by giving your agent direct access to the Portkey AI Gateway. Instead of you manually digging through logs to find out why a request failed or how much a specific project spent this morning, you can just ask your agent to do the heavy lifting. It can pull usage data, check your virtual keys, and even create new budget policies to stop runaway costs before they hit your bottom line. Because Vinkius hosts this Connector, you can connect it to your existing workflow and let your agent handle the ops side of AI. You get a unified view of every call made through your gateway, making it much easier to spot anomalies or optimize how you route requests to different models.

## Tools

### create_policy
Create a new budget or usage policy for AI gateway access. Use this to enforce cost controls on specific teams or projects.

### delete_policy
Remove a budget or usage policy from Portkey. Use this when a project ends or budget constraints are no longer needed.

### export_logs
Export logs for external analysis or compliance reporting. You can filter by date, model, or user to get a specific download URL.

### get_log_details
Get detailed information about a specific AI gateway log entry. Use this for deep debugging of specific interactions.

### get_virtual_keys
List all virtual API keys managed by Portkey. This lets you audit usage and identify keys approaching their limits.

### list_configs
List all gateway configurations stored in Portkey. Use this to review how requests are routed or to audit behavior.

### list_logs
List recent AI gateway logs and traces from Portkey. Use this to monitor usage, identify expensive calls, or debug latency.

### list_models
List all LLM models supported by the Portkey gateway. Use this to discover which models are routable via your gateway.

### list_policies
List all budget and usage policies defined in Portkey. Use this to review guardrails preventing runaway AI costs.

### submit_feedback
Submit user feedback for a specific AI response log. Use this to build RLHF datasets or monitor user satisfaction.

## Prompt Examples

**Prompt:** 
```
Show me the most expensive LLM calls from the last 24 hours
```

**Response:** 
```
I'll retrieve recent gateway logs and sort them by cost to identify the top spenders.

| **Model** | **Cost** | **Tokens** |
| :--- | :--- | :--- |
| OpenAI GPT-4 | $45.20 | 120k |
| Anthropic Claude | $12.10 | 45k |
```

**Prompt:** 
```
Create a budget policy limiting the Marketing team to $500/month on LLM usage
```

**Response:** 
```
I'll create a policy with a $500 monthly budget target for the Marketing virtual keys.

**Policy Created**
- **Name**: Marketing_Budget
- **Limit**: $500.00
- **Status**: Active
```

**Prompt:** 
```
Export all logs from last week for our compliance audit
```

**Response:** 
```
I'll trigger a log export for the last 7 days in JSON format for your records.

**Export Status**
- **ID**: exp_99283
- **Format**: JSON
- **Status**: Ready for download
```

## Capabilities

### Track token spend
Get real-time data on how much each project or team is spending on LLM calls.

### Audit API usage
List all virtual keys to see who is using what and check for approaching limits.

### Enforce budget limits
Create and manage policies that automatically cap spending for specific teams.

### Debug gateway logs
Pull detailed traces for specific interactions to find out exactly where a request stalled.

### Manage model routing
View all supported models and their capabilities to see what's available in your gateway.

### Collect user feedback
Submit likes and dislikes for specific responses to build better training data.

## Use Cases

### Spiking Costs
A FinOps analyst notices a spend spike and asks the agent to list_policies to see if a team exceeded their budget.

### Debugging Latency
An engineer asks the agent to list_logs and get_log_details to find out why a specific request took 10 seconds.

### Compliance Audit
A governance officer asks the agent to export_logs for the last 30 days to satisfy a quarterly security review.

### New Team Onboarding
A manager asks the agent to create_policy to set a $500 monthly limit for the new marketing team's AI tools.

## Benefits

- Stop runaway costs by using create_policy to set hard limits on team spending.
- Cut out manual log hunting by using list_logs to instantly see the most expensive calls.
- Simplify key management by using get_virtual_keys to track usage across multiple providers.
- Speed up debugging by using get_log_details to see exactly what happened during a failed request.
- Build better models by using submit_feedback to collect RLHF data directly from your logs.
- Audit your entire infrastructure by using export_logs to get compliance-ready data for offline review.

## How It Works

The bottom line is you move from manual dashboard clicking to natural language commands for your entire LLM infrastructure.

1. Grab your API key from the Portkey dashboard settings.
2. Connect the Connector to your AI client via Vinkius.
3. Ask your agent to check costs, list logs, or set budget policies in plain English.

## Frequently Asked Questions

**Can the Portkey MCP help me track my AI spending?**
Yes, it connects to your gateway to show real-time costs and token usage across all your models.

**How does Portkey MCP manage my API keys?**
It uses virtual keys to let you manage provider keys in one place while tracking usage limits.

**Can I use Portkey MCP to set spending limits?**
You can create and manage budget policies to cap how much specific teams or projects can spend.

**How do I debug failed AI requests with Portkey MCP?**
Your agent can pull detailed logs and traces for specific interactions to see exactly what went wrong.

**Can Portkey MCP export my data for audits?**
Yes, it can generate export IDs for your logs so you can perform offline compliance checks.

**Does Portkey MCP support multiple LLM providers?**
It provides a unified view for all your providers, including OpenAI, Anthropic, and Google.

**Which LLM providers does Portkey support?**
Portkey supports 1,600+ LLMs including OpenAI, Anthropic, Google, Mistral, Azure OpenAI, AWS Bedrock, Cohere, Hugging Face, and many more. Use the list_models tool to see the full catalog available via your gateway.

**How does Portkey help control AI costs?**
Portkey provides granular visibility into token usage, latency, and costs per model, team, or virtual key. You can create budget policies with hard limits to prevent runaway spending. The gateway also supports caching to reduce duplicate calls and fallbacks to cheaper models when appropriate.

**Can I track feedback on AI responses?**
Yes! Portkey allows you to submit Like/Dislike feedback for any logged LLM call. This data helps improve model selection, evaluate agent performance, and build RLHF datasets for fine-tuning.