Portkey integration
Portkey AI gateway API. Route chat completions and embeddings to any model provider through one OpenAI compatible surface with retries, fallbacks and caching driven by a config, manage the configs and the providers that hold the upstream credentials, store and render versioned prompts and run them, attach user feedback to a trace, read a single request log, and pull cost, request and per model analytics. The control plane and the gateway share one host and one key header, and the key is always sent as x-portkey-api-key.
Say what should happen.
The workflow builds itself.
Common Portkey use cases
- charting daily model spend
- watching traffic after a release
- finding the prompt id to render or run
- correcting a rating after a human review
- finding the provider slug to route a call to
- adding a fallback target to an existing config
- checking which providers a config falls back to
- finding the config slug to route a call through
- checking whether a provider hit its credit limit
- cleaning up configs left behind by an experiment
What you can do with Portkey
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Each badge shows the default agent permission of an endpoint (allowed: an agent calls it without asking; ask first: you are asked before an agent calls it, when the agent or chat asks permission for sensitive actions; never: no agent may call it), which every user can change endpoint by endpoint in their credential settings.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Config, 5 operations
create_configCreate configPOSTAgents: ask firstCreates a routing config that gateway calls can then reference by slug.delete_configDelete configDELETEAgents: ask firstDeletes a routing config.get_configGet configGETAgents: ask firstReturns the routing rules stored in one config.list_configsList configsGETAgents: ask firstLists the routing configs of the organization with their slugs and status.update_configUpdate configPUTAgents: ask firstReplaces the routing rules or the status of a config.
Provider, 4 operations
create_providerCreate providerPOSTAgents: ask firstCreates a provider that holds an upstream credential and its spend limits.delete_providerDelete providerDELETEAgents: ask firstDeletes a provider and the routing it enabled.get_providerGet providerGETAgents: ask firstReturns a provider with its limits and expiry.list_providersList providersGETAgents: ask firstLists the providers that hold upstream credentials, with their usage and rate limits.
Analytics, 3 operations
get_analytics_by_userGet analytics by userGETAgents: ask firstReturns request counts and cost grouped by the end user recorded on each call.get_cost_analyticsGet cost analyticsGETAgents: ask firstReturns cost over time in cents, bucketed, with a total and an average.get_request_analyticsGet request analyticsGETAgents: ask firstReturns request counts over time, bucketed, with a summary.
Feedback, 2 operations
create_feedbackCreate feedbackPOSTAgents: ask firstAttaches a scored feedback entry to a trace identifier.update_feedbackUpdate feedbackPUTAgents: ask firstChanges the value, weight or metadata of an existing feedback entry.
Prompt, 2 operations
list_promptsList promptsGETAgents: ask firstLists the prompt templates of a workspace with their collection and model.render_promptRender promptPOSTAgents: ask firstSubstitutes variables into a stored prompt and returns the request that would be sent.
Chat completion, 1 operation
create_chat_completionCreate chat completionPOSTAgents: ask firstSends a chat completion to any provider through Portkey and returns the OpenAI shaped answer.
Embedding, 1 operation
create_embeddingCreate embeddingPOSTAgents: ask firstTurns text into embedding vectors through any provider Portkey routes to.
Log, 1 operation
get_logGet logGETAgents: ask firstReturns the stored request and response of one gateway call.
Model, 1 operation
list_modelsList modelsGETAgents: ask firstLists the models Portkey can route to, filtered by provider or service.
Prompt completion, 1 operation
run_promptRun promptPOSTAgents: ask firstFills a stored prompt with variables and sends it to the model in one call.
Use Portkey from Claude Code, Cursor or Codex
Connect Portkey in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its Portkey operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect Portkey
- Create your workspace
Sign up free. Nothing to install.
- Connect Portkey once
Add your Portkey connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
Portkey integration FAQ
What can you do with the Portkey integration?
LiveContext exposes 21 operations on Portkey, covering config, provider, analytics and feedback. Common uses include charting daily model spend, watching traffic after a release and finding the prompt id to render or run.
