{
 "kind": "api",
 "slug": "portkey",
 "path": "apis/portkey/",
 "name": "Prisma AIRS AI Gateway (formerly Portkey)",
 "logo": "https://agentgid.com/media/avatars/portkey-ai.png",
 "maker": "Portkey AI",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "LLM gateways and routers",
   "apis/llm-gateway/"
  ]
 ],
 "lead": "One gateway for many AI models, with backups.",
 "chips": [
  {
   "label": "LLM gateways and routers",
   "path": "apis/llm-gateway/"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Route my app's AI calls through Portkey: read PORTKEY_API_KEY from .env on the server, pin portkey-ai 2.3.4, use @provider/model names from the Model Catalog, add a fallback config to a second provider, and tag each request with user_id metadata."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://portkey.ai"
  },
  {
   "label": "Pricing",
   "href": "https://portkey.ai/pricing"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/Portkey-AI/gateway"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Open source",
   "status": "yes",
   "sub": "Run it yourself for free",
   "quote": null,
   "note": "Free tier: Developer: 10k recorded logs/month, 3-day log retention. As reported on the official pricing page, checked Nov 1, 2026.",
   "src": "https://portkey.ai/pricing"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "Allowed",
   "status": "yes",
   "sub": null,
   "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy",
   "note": "The self-hosted gateway is MIT; the hosted service is used on a paid plan for production (terms page needs a browser, see manual_check).",
   "src": "https://github.com/Portkey-AI/gateway/blob/main/LICENSE"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var PORTKEY_API_KEY",
   "quote": "To ensure secure access to Portkey's APIs, authentication is required for all requests.",
   "note": "Portkey API key in the x-portkey-api-key header (JWT also supported); the provider is picked with x-portkey-provider or an @provider/model name. Keep it on the server; it can reach every provider key stored in the account.",
   "src": "https://docs.portkey.ai/docs/api-reference/inference-api/authentication.md"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "info",
   "sub": "llms.txt · SDK",
   "quote": null,
   "note": " Our agent check: 4 of 6 (Nov 13, 2026).",
   "src": "https://portkey.ai/llms.txt"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Nov 1, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Prisma AIRS AI Gateway (formerly Portkey) does",
   "parts": [
    {
     "t": "prose",
     "text": "Portkey sits between your app and AI model providers such as OpenAI or Anthropic. Your app calls one address, and Portkey passes the request on, retries or switches to a backup model when one fails, and records every request and its cost. Its gateway core is open source, and the hosted service has a free plan."
    },
    {
     "t": "list",
     "items": [
      "Prisma AIRS AI Gateway (formerly Portkey) is one of 8 APIs in the LLM gateways and routers category on AgentGid.",
      "Its cheapest paid plan ($49 a month) is the 1st cheapest of the 3 here with a monthly plan.",
      "It is one of 7 that can be started for free.",
      "4 of them ship an official MCP server; Prisma AIRS AI Gateway (formerly Portkey) does not.",
      "Its official SDK is the 4th most downloaded in the category (1.5M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "One way to call many models",
       "text": "Switch between OpenAI, Anthropic, Google and others by changing one name in your code, instead of learning each company's own setup.",
       "idea": false
      },
      {
       "title": "Backup model when the main one is down",
       "text": "If your main AI provider fails or is busy, the same request goes to a second model, so your chatbot keeps answering.",
       "idea": false
      },
      {
       "title": "See every AI request and its cost",
       "text": "Look up any past request with its prompt, answer, tokens and cost, and tag requests by user or session to find problems.",
       "idea": false
      },
      {
       "title": "Block unwanted answers and retry",
       "text": "Check model answers for banned words or topics and retry failed calls automatically, before your users see a bad reply.",
       "idea": false
      },
      {
       "title": "One entry point for your team's tools",
       "text": "Put the tool servers your AI agents use behind one sign-in, with access rules and a log of every call.",
       "idea": false
      },
      {
       "title": "Cap AI spending per team",
       "text": "Give each team or project its own provider access with a spending limit, so one runaway script cannot use the whole budget.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Prisma AIRS AI Gateway (formerly Portkey) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "1.4M",
       "l": "SDK downloads a week",
       "d": "+22.7% on the 4-week average",
       "up": true
      },
      {
       "n": "17",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "13.4K",
       "l": "GitHub stars, Portkey-AI/gateway"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "Developer: 10k recorded logs/month, 3-day log retention"
      },
      {
       "l": "Cheapest plan",
       "v": "$49 a month"
      },
      {
       "l": "Usage price",
       "v": "Production $49/month for 100k recorded logs; +$9 per additional 100k requests (up to 3M)"
      },
      {
       "l": "Plans",
       "v": "Gateway is open source and self-hostable with no request limit. Exceeding the free log limit does not block requests, only logging. Portkey offers an MCP gateway for your servers rather than its own MCP server. Portkey is now PRISMA AIRS AI Gateway, as the portkey.ai homepage says (2026-11-10); the docs keep the Portkey name."
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "Production plan per month (100k logged requests)",
       "$49"
      ],
      [
       "Each extra 100k logged requests on Production (up to 3M)",
       "$9"
      ]
     ]
    },
    {
     "t": "more",
     "items": [
      {
       "title": "Price history",
       "items": [
        "A year of the pricing page in the Internet Archive (7 months): the lowest monthly figure went from $9 (2025-10) to $9 (2026-11).",
        "1 change in our catalog since Oct 9, 2026, last on Oct 9, 2026."
       ]
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Nov 1, 2026. Prices change: confirm before you buy.",
     "link": "portkey.ai/pricing",
     "href": "https://portkey.ai/pricing"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Developer (free)",
       "v": "10k logged requests a month, logs kept 3 days, metrics 30 days, 3 prompt templates",
       "src": "https://portkey.ai/pricing"
      },
      {
       "l": "Production",
       "v": "100k logged requests a month (+$9 per extra 100k up to 3M), logs kept 30 days",
       "src": "https://portkey.ai/pricing"
      },
      {
       "l": "Open source (self-hosted)",
       "v": "No request limit",
       "src": "https://portkey.ai/pricing"
      },
      {
       "l": "All",
       "v": "Up to 5 automatic retries with exponential backoff",
       "src": "https://docs.portkey.ai/docs/product/ai-gateway/automatic-retries.md"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "portkey.ai/pricing",
     "href": "https://portkey.ai/pricing"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "Portkey API key in the x-portkey-api-key header (JWT also supported); the provider is picked with x-portkey-provider or an @provider/model name."
      },
      {
       "l": "Environment variable",
       "v": "PORTKEY_API_KEY",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "Not stated on the pages we read"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign up for Portkey and copy the API key from Settings. Read PORTKEY_API_KEY from .env on the server (the person pastes it there, not into the chat).",
      "Add each AI provider (for example OpenAI) and its key in the Model Catalog. Use the provider slug, such as @openai-prod/gpt-4o, in model names.",
      "Upgrade to Production ($49/month) before going live, if logs beyond 10k a month or 3 days are needed. No code change."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "The gateway core is open source under the MIT license, so you can run it yourself, also in paid products. The hosted service is a paid product with a free Developer plan; its terms page needs a browser to read."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "Yes",
       "status": "yes",
       "sub": "The self-hosted gateway is MIT; the hosted service is used on a paid plan for production (terms page needs a browser, see manual_check).",
       "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy",
       "src": "https://github.com/Portkey-AI/gateway/blob/main/LICENSE"
      },
      {
       "l": "redistribute-files",
       "v": "With conditions",
       "status": "cond",
       "sub": "You may ship the MIT gateway code if you keep its copyright and license notice.",
       "quote": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
       "src": "https://github.com/Portkey-AI/gateway/blob/main/LICENSE"
      },
      {
       "l": "client-work",
       "v": "Yes",
       "status": "yes",
       "sub": "Self-host the MIT gateway per client, or use a hosted workspace; check the hosted terms in a browser.",
       "quote": "MIT License",
       "src": "https://github.com/Portkey-AI/gateway/blob/main/LICENSE"
      },
      {
       "l": "Keeps your data",
       "v": "Logs are kept 3 days on Developer and 30 days on Production; Enterprise sets its own periods.",
       "quote": "Retention 3 days for Logs, 30 days for metrics",
       "src": "https://portkey.ai/pricing"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "408",
       "v": "Request timed out (Portkey or provider)",
       "sub": "Retry with backoff, or set a longer request timeout."
      },
      {
       "l": "412",
       "v": "Budget exhausted (Portkey or provider)",
       "sub": "Raise the budget limit or top up the provider account."
      },
      {
       "l": "429",
       "v": "Request rate limited (Portkey or provider)",
       "sub": "Retry with backoff, or add a fallback target on status 429."
      },
      {
       "l": "446",
       "v": "Guardrail checks failed and the request was denied",
       "sub": "Change the input or the guardrail; do not blindly retry."
      },
      {
       "l": "246",
       "v": "Guardrail checks failed but the request succeeded",
       "sub": "Read the guardrail result before showing the answer."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "4 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page yes, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "None found",
       "sub": null
      },
      {
       "l": "npm",
       "v": "npm install portkey-ai",
       "code": true
      },
      {
       "l": "PyPI",
       "v": "pip install portkey-ai",
       "code": true
      }
     ]
    },
    {
     "t": "h3",
     "text": "Instructions in its docs to check first"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "The docs say",
       "v": "“npx add-skill portkey-ai/skills”",
       "sub": "Installs vendor skills into the person's coding assistant from an unpinned package; ask the person first, and never with --global without consent."
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Prisma AIRS AI Gateway (formerly Portkey)",
       "me": true,
       "facts": [
        "Free (open source)",
        "Free tier"
       ]
      },
      {
       "name": "LiteLLM",
       "why": "Pick LiteLLM for a fully open-source proxy and library you run yourself, with keys, budgets and logging.",
       "path": "apis/litellm/",
       "facts": [
        "Free (open source)",
        "Free tier"
       ]
      },
      {
       "name": "OpenRouter",
       "why": "Pick OpenRouter when you want one account and one bill for hundreds of models, without bringing your own provider keys.",
       "path": "apis/openrouter/",
       "facts": [
        "Free plan",
        "Free tier",
        "Official MCP"
       ]
      },
      {
       "name": "Vercel AI Gateway",
       "why": "Pick Vercel AI Gateway if your app runs on Vercel and you want models billed at provider list prices through Vercel.",
       "path": "apis/vercel-ai-gateway/",
       "facts": [
        "Free plan",
        "Free tier"
       ]
      }
     ],
     "more": "All llm gateways and routers APIs",
     "more_path": "apis/llm-gateway/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Route my app's AI calls through Portkey: read PORTKEY_API_KEY from .env on the server, pin portkey-ai 2.3.4, use @provider/model names from the Model Catalog, add a fallback config to a second provider, and tag each request with user_id metadata."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Sign up or log in, and copy your Portkey API key from Settings.",
       "code": null,
       "src": "https://docs.portkey.ai/docs/introduction/make-your-first-request.md"
      },
      {
       "text": "Add your AI provider in the Model Catalog, then install the SDK.",
       "code": "pip install portkey-ai",
       "src": "https://docs.portkey.ai/docs/product/ai-gateway/fallbacks.md"
      },
      {
       "text": "Call a model through Portkey (or point your existing OpenAI client at Portkey).",
       "code": "from portkey_ai import Portkey\n\nportkey = Portkey(\n    api_key=\"YOUR_PORTKEY_API_KEY\",\n    provider=\"@YOUR_PROVIDER\"\n)",
       "src": "https://docs.portkey.ai/docs/introduction/make-your-first-request.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "curl https://api.portkey.ai/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-portkey-api-key: YOUR_PORTKEY_API_KEY\" \\\n  -H \"x-portkey-provider: YOUR_PROVIDER\" \\\n  -d '{\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ]\n  }'",
       "intro": "Request from the \"What is Portkey\" page (system message left out to fit); the response is the chat completion body shown in Portkey's OpenAPI spec (from a batch example). Not run by us."
      },
      {
       "tab": "Response",
       "code": "{\"id\": \"chatcmpl-9758Iw\", \"object\": \"chat.completion\", \"created\": 1711475054, \"model\": \"gpt-3.5-turbo\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"2 + 2 equals 4.\"}, \"finish_reason\": \"stop\"}], \"usage\": {\"prompt_tokens\": 24, \"completion_tokens\": 15, \"total_tokens\": 39}, \"system_fingerprint\": null}"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Turning on semantic caching on the free or Production plan because an example shows \"mode\" \"semantic\"",
       "fix": "Use simple caching, or ask Portkey about an Enterprise plan for semantic caching",
       "why": "The cache docs say semantic caching needs a vector database and select Enterprise plans."
      },
      {
       "dont": "Treating every error from Portkey as a Portkey problem",
       "fix": "Check whether the message starts with \"Portkey Error\"; otherwise it came from the AI provider",
       "why": "Provider errors are passed through unchanged."
      },
      {
       "dont": "Using old Virtual Keys (x-portkey-virtual-key) in new code",
       "fix": "Use @provider-slug/model names from the Model Catalog",
       "why": "The docs mark Virtual Keys as deprecated."
      },
      {
       "dont": "Putting the Portkey API key in browser code",
       "fix": "Keep it on the server and call Portkey from there",
       "why": "The key unlocks the provider keys stored in your Portkey account."
      },
      {
       "dont": "Sending personal data in prompts with full logging on and no review",
       "fix": "Decide what may be logged; use a PII guardrail or Metrics Only mode (Enterprise), or self-host",
       "why": "Full logging stores complete request and response content."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is there a free plan?",
       "a": "Yes. The Developer plan is free with 10,000 logged requests a month and 3-day log retention, for prototypes and tests.",
       "evidence": {
        "url": "https://portkey.ai/pricing",
        "quote": "Retention 3 days for Logs, 30 days for metrics"
       }
      },
      {
       "q": "What does the paid plan cost?",
       "a": "Production is $49 a month for 100,000 logged requests, plus $9 for each extra 100,000, up to 3 million.",
       "evidence": {
        "url": "https://portkey.ai/pricing",
        "quote": "$9/Month for Every 100K Up to 3M Requests"
       }
      },
      {
       "q": "Can I run it myself?",
       "a": "Yes. The open-source gateway runs locally or on your servers; the hosted dashboard and long log storage are the paid part.",
       "evidence": {
        "url": "https://github.com/Portkey-AI/gateway/blob/main/README.md",
        "quote": "The Gateway is running on http://localhost:8787/v1"
       }
      },
      {
       "q": "Do I need to rewrite my OpenAI code?",
       "a": "No. You can keep the OpenAI SDK and point it at Portkey, or use Portkey's own SDK with the same call shape.",
       "evidence": {
        "url": "https://docs.portkey.ai/docs/introduction/make-your-first-request.md",
        "quote": "If you're using the OpenAI SDK, import the Portkey SDK and configure it within your OpenAI client object"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "Portkey AI"
  ],
  [
   "Category",
   "LLM gateways and routers"
  ],
  [
   "Price",
   "Free (open source)"
  ],
  [
   "Plans from",
   "$49/mo"
  ],
  [
   "Official SDK",
   "npm portkey-ai, PyPI portkey-ai"
  ],
  [
   "Latest SDK",
   "2.3.4 on npm"
  ],
  [
   "Agent check",
   "4 of 6"
  ],
  [
   "Pricing checked",
   "Nov 1, 2026"
  ]
 ],
 "good": [
  "The free Developer plan records 10,000 requests a month and keeps logs for 3 days; requests above that still work but are not logged.",
  "Portkey says its free plan is not suitable for live products.",
  "Full logging keeps the complete prompts and answers; storing only numbers (Metrics Only) is an Enterprise feature."
 ],
 "checked_line": "Read by AgentGid from 27 official pages, card checked Nov 10, 2026; usage numbers update daily."
}