Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
787 commits
Select commit Hold shift + click to select a range
f018877
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Oct 26, 2025
dd11a0c
remove embeddings in matterai
code-crusher Oct 27, 2025
914769d
Add performance monitoring (prometheus for metrics and winston for lo…
narengogi Oct 27, 2025
cc36895
fix import
narengogi Oct 27, 2025
2733675
fix import
narengogi Oct 27, 2025
c8b018f
change variable name
narengogi Oct 27, 2025
1ece8e8
change variable name
narengogi Oct 27, 2025
1eebcf2
improvement: added reasoning_effort for grok
marsianin Oct 28, 2025
ad37797
improvement: added reasoning_effort for grok
marsianin Oct 28, 2025
2684a1e
Merge pull request #1311 from qualifire-dev/feature/add-qualifire-int…
VisargD Oct 28, 2025
a2c0ad4
Merge pull request #1396 from marsianin/marsianin/reasoning_effort-grok
VisargD Oct 28, 2025
128280c
Merge pull request #1316 from indranil786/main
VisargD Oct 28, 2025
421897e
Merge remote-tracking branch 'upstream/main' into feature/ratelimits-…
narengogi Oct 28, 2025
7a21955
fix: add role 'assistant' to chat completion stream chunk
siddharthsambharia-portkey Oct 30, 2025
6c7050d
computer use for google
narengogi Oct 30, 2025
e8e2eb4
rename the log Handler that is used to push logs to the portkey opens…
narengogi Oct 30, 2025
2a73170
Merge remote-tracking branch 'upstream/main' into feature/apm
narengogi Oct 30, 2025
95b82f2
remove error handling from chatComplete
code-crusher Oct 31, 2025
604fa7b
Merge branch 'main' into add_matterai_provider
code-crusher Oct 31, 2025
8851aee
Remove timeout parameter from PANW Prisma AIRS plugin
jroberts2600 Oct 29, 2025
82fd4cb
add newer parameters to respones
narengogi Nov 1, 2025
ccdaf19
add newer parameters to respones
narengogi Nov 1, 2025
a716a13
option 1: send in headers
narengogi Nov 3, 2025
ec4663b
option 1: send in stream chunk
narengogi Nov 3, 2025
cc21802
remove header based apporach
narengogi Nov 3, 2025
dfd5b2a
remove redundant change
narengogi Nov 3, 2025
0e2aa41
feat: use Portkey trace ID as AIRS AI Session ID for multi-turn conve…
jroberts2600 Nov 3, 2025
081d373
Merge pull request #1403 from narengogi/fix/add-newer-parameters-resp…
VisargD Nov 4, 2025
be7c604
Merge branch 'main' into snyk-fix-d95c1b1fe5fd3f5bfe7cc4f6853ee742
VisargD Nov 4, 2025
3fe230b
Merge pull request #1380 from Portkey-AI/snyk-fix-d95c1b1fe5fd3f5bfe7…
VisargD Nov 4, 2025
49f99f8
chore: fixes
sk-portkey Nov 4, 2025
eda1163
Merge branch 'main' into fix/ssrf_custom_host_validator
sk-portkey Nov 4, 2025
c26e722
chore: use env for conditional env fetch
sk-portkey Nov 4, 2025
cc0f76d
chore: semantic name update
sk-portkey Nov 4, 2025
c54cc34
fix: restore role 'assistant' in chat completion stream chunk
siddharthsambharia-portkey Nov 4, 2025
caee0ef
chore: code optimisations
sk-portkey Nov 4, 2025
6bf69a2
fix
siddharthsambharia-portkey Nov 4, 2025
303e20d
Merge branch 'main' into feat/claude-code-gateway
siddharthsambharia-portkey Nov 4, 2025
6e0b90c
handle sending hook results when streaming responses
narengogi Nov 4, 2025
3cec579
Refactor headers function in AnthropicAPIConfig for improved readability
siddharthsambharia-portkey Nov 4, 2025
749794c
Merge pull request #1400 from siddharthsambharia-portkey/fix/anthropi…
VisargD Nov 4, 2025
9912a7c
chore: handle error correctly
b4s36t4 Nov 4, 2025
32ba2e4
Merge branch 'main' of github.com:Portkey-AI/gateway into fix/batches…
b4s36t4 Nov 4, 2025
8c9bd77
Merge pull request #1369 from b4s36t4/fix/batches-error-handling
VisargD Nov 4, 2025
fd36c39
Add seed parameter to generationConfig
narengogi Nov 5, 2025
ac6fb10
Merge branch 'main' into feature/ratelimits-and-budgets
narengogi Nov 6, 2025
e347ef8
Merge pull request #1366 from Portkey-AI/feature/ratelimits-and-budgets
VisargD Nov 6, 2025
594185d
Merge pull request #1384 from narengogi/fix/cohere-v2-responses
VisargD Nov 6, 2025
80c2593
Merge pull request #1401 from narengogi/google-computer-use
VisargD Nov 6, 2025
781ca24
Merge branch 'main' into feature/apm
narengogi Nov 6, 2025
7921321
Merge pull request #1393 from GravityCloudAI/add_matterai_provider
VisargD Nov 6, 2025
235dfd4
Merge pull request #1398 from jroberts2600/feature/panw-prisma-airs-e…
VisargD Nov 6, 2025
63f6b09
Merge pull request #1394 from narengogi/feature/apm
VisargD Nov 6, 2025
65ff2fe
Merge pull request #1279 from arturfromtabnine/ar/vertex-ai-tool-cont…
VisargD Nov 6, 2025
992e069
Merge branch 'main' of github.com:Portkey-AI/gateway into feat/azure-…
b4s36t4 Nov 6, 2025
2486d35
fix: apply workload identity to azure-ai, cleanup and merge with late…
b4s36t4 Nov 6, 2025
47f7152
Merge pull request #1408 from b4s36t4/feat/azure-workload-identity
VisargD Nov 7, 2025
c085626
Merge branch 'main' into feature/add-support-vertex-ai-caching
narengogi Nov 7, 2025
d4dbabb
Merge pull request #1373 from miuosz/feature/add-support-vertex-ai-ca…
VisargD Nov 7, 2025
093cf32
Merge pull request #1381 from siddharthsambharia-portkey/feat/claude-…
VisargD Nov 7, 2025
5688b5b
chore: validate custom at multiple places
sk-portkey Nov 7, 2025
82e13fd
Merge branch 'main' into fix/ssrf_custom_host_validator
sk-portkey Nov 7, 2025
c3e1171
chore: remove redundant validation from request context
sk-portkey Nov 7, 2025
b5a7825
Merge pull request #1372 from Portkey-AI/fix/ssrf_custom_host_validator
VisargD Nov 7, 2025
fb287d9
fix: return Response instead of object, typescript
b4s36t4 Nov 7, 2025
59622b7
Merge pull request #1409 from b4s36t4/fix/bedrock-types
VisargD Nov 7, 2025
c9fe94d
fix: build errors
VisargD Nov 7, 2025
5aac66c
fix: add types and checks for builds
b4s36t4 Nov 7, 2025
0e66619
Merge pull request #1411 from b4s36t4/fix/types
VisargD Nov 7, 2025
b77ae1f
Merge pull request #1410 from Portkey-AI/fix/build-errors-07-nov
VisargD Nov 7, 2025
0b63c05
revert apm changes to avoid warninglogs
narengogi Nov 7, 2025
672a33c
update package lock
narengogi Nov 7, 2025
91f9958
Merge pull request #1412 from narengogi/fix/revert-apm-changes-to-avo…
VisargD Nov 7, 2025
e1f29d4
1.14.0
VisargD Nov 7, 2025
da1a1d0
Merge pull request #1413 from Portkey-AI/feat/release-1.14.0
VisargD Nov 7, 2025
6b20688
feat: add thinking parameter to OllamaChatCompleteConfig with transfo…
siddharthsambharia-portkey Nov 10, 2025
1080b58
feat: add Z_AI provider and include in VALID_PROVIDERS
siddharthsambharia-portkey Nov 11, 2025
542f1e1
Merge branch 'main' into feat/z-ai-provider-support
siddharthsambharia-portkey Nov 11, 2025
f0504d1
Feat/fix-z-ai
siddharthsambharia-portkey Nov 12, 2025
88bd40f
Feat/fix-z-ai-2
siddharthsambharia-portkey Nov 12, 2025
cd2d70c
feat: expand audio format support in OPENAI_AUDIO_FORMAT_TO_VERTEX_MI…
roh26it Nov 11, 2025
bb44fe6
Merge pull request #642 from Portkey-AI/feat/provider-modal-labs
VisargD Nov 6, 2025
da34876
simplify openai base transform for chat complete
narengogi Nov 13, 2025
1ef3003
Feat/fix-z-ai-3
siddharthsambharia-portkey Nov 13, 2025
a627e55
Merge remote-tracking branch 'upstream/main' into chore/send-hook-res…
narengogi Nov 13, 2025
dcd1a6a
handle falsy check in vertex parameter mapping
narengogi Nov 13, 2025
ffd73e6
send empty usage object in message start chunk
narengogi Nov 13, 2025
ff72d07
Merge pull request #1416 from siddharthsambharia-portkey/feat/z-ai-pr…
VisargD Nov 13, 2025
65c088a
Merge branch 'main' into feat/provider-modal-labs
VisargD Nov 14, 2025
8e74fe3
Merge pull request #1419 from Portkey-AI/feat/provider-modal-labs
VisargD Nov 14, 2025
b4af798
Merge pull request #1424 from narengogi/fix/send-empty-usage-object-i…
VisargD Nov 14, 2025
af44869
Merge pull request #1422 from narengogi/fix/falsy-check-vertex
VisargD Nov 14, 2025
a740033
Merge pull request #1418 from Portkey-AI/chore/more-audio-types-vertex
VisargD Nov 14, 2025
1c9fdd2
fix: return null for empty tools in transformToolsConfig
siddharthsambharia-portkey Nov 14, 2025
69e18a9
update check to send hook results in streaming
narengogi Nov 14, 2025
6a76ee6
Merge pull request #1407 from narengogi/chore/send-hook-results-in-st…
VisargD Nov 14, 2025
6bb44a1
Merge pull request #1429 from siddharthsambharia-portkey/fix/hanle-em…
VisargD Nov 17, 2025
ac6ec22
Merge pull request #1420 from narengogi/fix/openai-chat-complete-base…
VisargD Nov 17, 2025
7a128da
simplify pr template
narengogi Nov 17, 2025
b6a75b1
update check to send hook results in streaming
narengogi Nov 17, 2025
2901085
add type of change to template
narengogi Nov 17, 2025
aa49b75
Merge pull request #1431 from Portkey-AI/simplify-pr-template
VisargD Nov 17, 2025
5d5369d
Auto add anthropic headers
ayush-portkey Nov 17, 2025
480553e
add hallucination eval
joshweimer-patronusai Nov 17, 2025
a5d1590
Add anthropicApiKey to request headers and update API configuration i…
narengogi Nov 18, 2025
9eda341
Apply suggestion from @Copilot
narengogi Nov 18, 2025
4c6e086
add anthropic-beta header without x-portkey prefix to provider option…
narengogi Nov 18, 2025
a738edd
Merge pull request #1435 from narengogi/fix/autoForwardAnthropicHeade…
narengogi Nov 18, 2025
d4b374b
Merge pull request #1433 from Portkey-AI/fix/autoForwardAnthropicHeaders
VisargD Nov 18, 2025
dfd145a
remove region identifier prefix when making request to count tokens e…
narengogi Nov 18, 2025
9435fe7
remove unused parameter
narengogi Nov 18, 2025
b6eedd3
Merge pull request #1436 from narengogi/fix/bedrock-count-tokens-igno…
VisargD Nov 18, 2025
95a9c49
feat: add f5-guardrail plugin
b4s36t4 Nov 19, 2025
9263085
chore: add user agent header for sass fetch
b4s36t4 Nov 19, 2025
8266e4d
Merge pull request #1440 from b4s36t4/feat/f5-guardrails
VisargD Nov 19, 2025
f79723b
fix support for custom judges
joshweimer-patronusai Nov 19, 2025
fa63fd6
thought messages support for gemini 3 pro
narengogi Nov 20, 2025
c178cba
Merge pull request #1443 from Portkey-AI/feature/gemini-thought-message
VisargD Nov 21, 2025
700ada2
1.14.1
VisargD Nov 21, 2025
a822631
Merge pull request #1446 from Portkey-AI/feat/release-1.14.1
VisargD Nov 21, 2025
f6ca29e
fix headers in streaming response for cached results
narengogi Nov 21, 2025
99a288d
Merge pull request #1447 from Portkey-AI/fix/streaming-response-headers
VisargD Nov 21, 2025
3785b96
1.14.2
VisargD Nov 21, 2025
6562c3e
Merge pull request #1448 from Portkey-AI/feat/release-1.14.2
VisargD Nov 21, 2025
601838b
Thinking level support for Gemini 3 Pro
maciej-nexos Nov 21, 2025
6442eca
oracle provider
narengogi Nov 23, 2025
aaf8290
fix google throught signature
narengogi Nov 23, 2025
ed4cb9f
move thoughtSignature outside functionCall definition
narengogi Nov 23, 2025
99b2649
Add IO Intelligence provider support
eminaruk Nov 24, 2025
050db7d
Merge pull request #1450 from narengogi/fix/thought-signature-google
VisargD Nov 24, 2025
2660d6b
feat: Add support for Anthropic advanced tool use beta features
roh26it Nov 25, 2025
92c9877
Merge branch 'main' into maciekskin/fix/add_thinking_level
narengogi Nov 25, 2025
420d20f
Revert "Thinking level support for Gemini 3 Pro"
narengogi Nov 25, 2025
318da22
map openai reasoning_effort to gemini thinking level
narengogi Nov 25, 2025
a89bda3
add mapping for reasoning_effort to thinkingLevel in gemini
narengogi Nov 25, 2025
445c93f
fix: Address PR review comments
roh26it Nov 26, 2025
0c5d576
feat: gemini 3 in openrouter
stefan-jiroveanu Nov 26, 2025
68f494e
Merge branch 'main' into feat/gemini-3-openrouter
stefan-jiroveanu Nov 26, 2025
4b9ee83
anthropic models on azure
narengogi Nov 26, 2025
7a80fb9
1.14.3
VisargD Nov 26, 2025
9d9a37a
Merge pull request #1457 from Portkey-AI/feat/release-1.14.3
VisargD Nov 26, 2025
fede93a
reverted formatting changes
eminaruk Nov 26, 2025
007b915
Merge branch 'main' into feat/advanced-tool-use-beta
roh26it Nov 29, 2025
a96a830
create request signer for oracle oci requests
narengogi Dec 2, 2025
3374f86
stream chat completions for oracle
narengogi Dec 2, 2025
50bd491
fix type errors
narengogi Dec 2, 2025
b2e2922
fix type errors
narengogi Dec 3, 2025
1389220
Merge pull request #1444 from maciej-nexos/maciekskin/fix/add_thinkin…
VisargD Dec 8, 2025
c0cf7d5
Merge pull request #1456 from narengogi/models/anthropic-on-azure
VisargD Dec 8, 2025
94ae007
Merge pull request #1451 from eminaruk/add-iointelligence
VisargD Dec 8, 2025
ad3d98f
chore: format
stefan-jiroveanu Dec 8, 2025
3630280
Merge branch 'main' into feat/gemini-3-openrouter
stefan-jiroveanu Dec 8, 2025
cc4ab11
Merge pull request #1454 from turintech/feat/gemini-3-openrouter
VisargD Dec 8, 2025
fd516b6
fix: Address PR review - type consistency and Bedrock documentation
roh26it Dec 9, 2025
d1c024c
allow anthropic beta header for all routes on anthropic provider
narengogi Dec 9, 2025
07055a4
feat: add openai compatible response support for anthropic on azure
arturfromtabnine Dec 10, 2025
a9878ee
concatenate multple text parts for gemini models
narengogi Dec 10, 2025
345a7eb
update pull request to attribute provider correctly to the base trans…
narengogi Dec 11, 2025
22164e6
update pull request to attribute provider correctly to the base trans…
narengogi Dec 11, 2025
67afbf1
remove unused import
narengogi Dec 11, 2025
e68ef9b
feat: support azure v1 api & send deployment-name for responses
b4s36t4 Dec 11, 2025
7dbac76
remove unsued import
narengogi Dec 11, 2025
3d29875
Merge branch 'main' into feat/add-thinking-support-for-ollama
siddharthsambharia-portkey Dec 11, 2025
004300b
docs: fix broken link
juzhiyuan Dec 11, 2025
13ab47c
Initial plan
Copilot Dec 14, 2025
ccb670a
Add AI Badgr provider integration
Copilot Dec 14, 2025
5d6f836
Address code review feedback - improve error logging and documentation
Copilot Dec 14, 2025
5c8e246
Merge pull request #1 from miguelmanlyx/copilot/add-ai-badgr-provider
miguelmanlyx Dec 14, 2025
106fa32
Merge pull request #1470 from juzhiyuan/patch-1
VisargD Dec 15, 2025
a4b5d56
Merge pull request #1472 from miguelmanlyx/main
VisargD Dec 15, 2025
af1e6c7
Merge pull request #1466 from narengogi/fix/concatenate-multiple-text…
VisargD Dec 15, 2025
0bdbc09
Merge pull request #1452 from Portkey-AI/feat/advanced-tool-use-beta
VisargD Dec 15, 2025
62cb208
Merge pull request #1467 from b4s36t4/feat/azure-preview-v1
VisargD Dec 15, 2025
f69d995
Merge pull request #1463 from narengogi/fix/anthropic-beta-messages-r…
VisargD Dec 15, 2025
38ab869
Merge branch 'main' into feature/oracle-inference
narengogi Dec 15, 2025
b8b674c
Merge pull request #1461 from Portkey-AI/feature/oracle-inference
VisargD Dec 15, 2025
dc43dca
Merge branch 'main' into add-patronus-evals-to-plugin
joshweimer-patronusai Dec 15, 2025
6ec76d2
run prettier formatting
joshweimer-patronusai Dec 15, 2025
9c36c6e
execute guardrails sequentially
narengogi Dec 17, 2025
d42a079
Merge pull request #1434 from joshweimer-patronusai/add-patronus-eval…
VisargD Dec 17, 2025
1e4891d
Merge pull request #1465 from arturfromtabnine/ar/fix-azure-ai-anthro…
VisargD Dec 17, 2025
51bb82d
delete reserved key
narengogi Dec 17, 2025
3bf0f7b
improvements for nano banana
narengogi Dec 17, 2025
9ccb1bb
refactoring
narengogi Dec 17, 2025
dfbc75a
refactoring
narengogi Dec 17, 2025
fa5131c
Merge pull request #1476 from narengogi/chore/nano-banana-improvements
VisargD Dec 18, 2025
9316bc5
fix(anthropic): add support for tool_choice=none
ShivamB25 Dec 19, 2025
39cd275
Merge pull request #1477 from ShivamB25/fix/anthropic-tool-choice-none
VisargD Dec 22, 2025
eddc66e
refactor: rename 'think' parameter to 'thinking' in OllamaChatComplet…
siddharthsambharia-portkey Dec 11, 2025
dcf4520
Merge pull request #1415 from siddharthsambharia-portkey/feat/add-thi…
VisargD Dec 22, 2025
4074cd7
feat: add support for google maps grounding
b4s36t4 Dec 22, 2025
4ae8a90
fix: use config directly
b4s36t4 Dec 22, 2025
092669d
chore: add maps support for google provider
b4s36t4 Dec 22, 2025
f298f0b
chore: return null if not passed
b4s36t4 Dec 22, 2025
cda06cd
fix: type issues with transform type update
b4s36t4 Dec 22, 2025
a682340
chore: update casing
b4s36t4 Dec 22, 2025
ddd532f
chore: update types
b4s36t4 Dec 22, 2025
55454ed
feat: azure checks for protected material and sheild prompt
b4s36t4 Dec 22, 2025
74a95ca
feat: add Not Null plugin to check for null or empty response content
Dec 23, 2025
254b733
add plugin to list
narengogi Dec 23, 2025
f134693
Add OVHcloud AI Endpoints provider
eliasto Dec 10, 2025
53abf2a
Merge pull request #1479 from b4s36t4/fix/transform-types
VisargD Dec 23, 2025
0ca6c16
fix ovhcloud response transformers
eliasto Dec 23, 2025
1b88f9b
Merge pull request #1481 from Samveg12/Samveg/Add-Null-Guardrail
VisargD Dec 23, 2025
f605bc0
Merge pull request #1478 from b4s36t4/fix/vertex-maps-grounding
VisargD Dec 23, 2025
401ea0f
Merge pull request #1471 from eliasto/add-ovhcloud-provider
VisargD Dec 23, 2025
7b04671
Merge pull request #1475 from Portkey-AI/feat/execute-guardrails-sequ…
VisargD Dec 23, 2025
8ee7e53
1.15.0
VisargD Dec 23, 2025
92e895f
Merge pull request #1482 from Portkey-AI/feat/release-1.15.0
VisargD Dec 23, 2025
4798fe0
fix: feat tests
b4s36t4 Dec 23, 2025
dfedf05
Update qualifire guardrails and schema
yuval-qf Dec 23, 2025
1810648
Update tests
yuval-qf Dec 23, 2025
a1f40cd
Merge branch 'main' into feature/qualifire-update-apis
yuval-qf Dec 23, 2025
47ab937
fix verdict
yuval-qf Dec 23, 2025
442c8f4
fix: gemini minimal reasoning effort
narengogi Dec 24, 2025
f809e5c
refactor
narengogi Dec 24, 2025
02f5828
refactor
narengogi Dec 24, 2025
36eb0b4
Merge pull request #1486 from narengogi/fix/gemini-minimal-reasoning
VisargD Dec 24, 2025
309818c
Merge pull request #1480 from b4s36t4/feat/azure-shield-protected-checks
VisargD Dec 24, 2025
89756d5
fix: use correct url for batches
b4s36t4 Dec 24, 2025
27f7edb
Merge pull request #1488 from b4s36t4/fix/batches-url
VisargD Dec 24, 2025
00dcdf9
1.15.1
VisargD Dec 24, 2025
580c242
Merge pull request #1489 from Portkey-AI/feat/release-1.15.1
VisargD Dec 24, 2025
8a59162
make anthropic beta header usage consistent
narengogi Dec 29, 2025
e0a2c35
only execute enabled checks
narengogi Dec 30, 2025
1190afe
feat: update readme by removing 2024 report and AI engineering hours
siddharthsambharia-portkey Jan 2, 2026
0705c10
Merge branch 'main' into feat/update-readme
siddharthsambharia-portkey Jan 6, 2026
a5db35e
Merge pull request #1483 from qualifire-dev/feature/qualifire-update-…
VisargD Jan 7, 2026
b06134b
Merge pull request #1493 from siddharthsambharia-portkey/feat/update-…
VisargD Jan 7, 2026
31304bf
fix: support azure blob for batches
b4s36t4 Jan 7, 2026
9e6c0b6
fix: allow custom scope work with azure agents
b4s36t4 Jan 7, 2026
be98d65
Bump versions to fix critical vulnerabilities
beast-nev Jan 7, 2026
e527852
Bump `ai` package's patch version
beast-nev Jan 7, 2026
9d52f67
Merge pull request #1496 from b4s36t4/fix/azure-batch-new-params
VisargD Jan 12, 2026
66f7f09
Merge pull request #1495 from b4s36t4/chore/azure-scope
VisargD Jan 12, 2026
5316fa7
Merge pull request #1491 from narengogi/fix/anthropic-beta
VisargD Jan 12, 2026
85239d4
fix logic
narengogi Jan 12, 2026
940b2b0
Merge pull request #1492 from narengogi/fix/sequqntial-guardrails
VisargD Jan 12, 2026
8bcf2f9
Merge pull request #1497 from beast-nev/feat/bump-cookbook-versions
VisargD Jan 12, 2026
819ae01
1.15.2
VisargD Jan 12, 2026
ca77129
Merge pull request #1499 from Portkey-AI/feat/release-1.15.2
VisargD Jan 12, 2026
48d6dc1
docs: update README to include Portkey Models section with links to G…
siddharthsambharia-portkey Jan 12, 2026
90b29fe
revert changes to anthropic version behaviour
narengogi Jan 12, 2026
497b5c0
Merge pull request #1501 from Portkey-AI/fix/anthropic-version-bedrock
VisargD Jan 12, 2026
45e8156
fix anthropic beta claude code on bedrock
narengogi Jan 12, 2026
08c38af
Merge pull request #1502 from narengogi/fix/anthropic-beta-claude-cod…
VisargD Jan 12, 2026
f228281
Initial Crowdstrike AIDR Guardrail Plugin
Jan 15, 2026
6d8c395
add mcp gw docs
vrushankportkey Jan 22, 2026
5e0c438
Merge pull request #1506 from Portkey-AI/mcp-gateway-readme-update
VisargD Jan 23, 2026
7799507
Merge pull request #1504 from ryanmeans/add-cs-aidr-plugin
VisargD Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
## Description
<!-- Provide a brief description of the changes in this PR -->
**Description:** (required)
- Detailed change 1
- Detailed change 2

## Motivation
<!-- Provide a brief motivation of why the changes in this PR are needed -->
**Tests Run/Test cases added:** (required)
- [ ] Description of test case

## Type of Change
**Type of Change:**
<!-- Put an 'x' in the boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)

## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [ ] Unit Tests
- [ ] Integration Tests
- [ ] Manual Testing

## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->

## Checklist
<!-- Put an 'x' in the boxes that apply -->
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

## Related Issues
<!-- Link related issues below. Insert the issue link or reference -->
- [ ] Refactoring (no functional changes)
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Local configuration file
conf.json

# Logs
logs
*.log
Expand Down Expand Up @@ -142,3 +145,5 @@ build
plugins/**/.creds.json
plugins/**/creds.json
plugins/**/.parameters.json
src/handlers/tests/.creds.json
.cursor/
92 changes: 92 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is the **Portkey AI Gateway** - a fast, reliable AI gateway that routes requests to 250+ LLMs with sub-1ms latency. It's built with Hono framework for TypeScript/JavaScript and can be deployed to multiple environments including Cloudflare Workers, Node.js servers, and Docker containers.

## Development Commands

### Core Development
- `npm run dev` - Start development server using Wrangler (Cloudflare Workers)
- `npm run dev:node` - Start development server using Node.js
- `npm run build` - Build the project for production
- `npm run build-plugins` - Build the plugin system

### Testing
- `npm run test:gateway` - Run tests for the main gateway code (src/)
- `npm run test:plugins` - Run tests for plugins
- `jest src/` - Run specific gateway tests
- `jest plugins/` - Run specific plugin tests

### Code Quality
- `npm run format` - Format code with Prettier
- `npm run format:check` - Check code formatting
- `npm run pretty` - Alternative format command

### Deployment
- `npm run deploy` - Deploy to Cloudflare Workers
- `npm run start:node` - Start production Node.js server

## Architecture

### Core Components

**Main Application (`src/index.ts`)**
- Hono-based HTTP server with middleware pipeline
- Handles multiple AI provider integrations
- Routes: `/v1/chat/completions`, `/v1/completions`, `/v1/embeddings`, etc.

**Provider System (`src/providers/`)**
- Modular provider implementations (OpenAI, Anthropic, Azure, etc.)
- Each provider has standardized interface: `api.ts`, `chatComplete.ts`, `embed.ts`
- Provider configs define supported features and transformations

**Middleware Pipeline**
- `requestValidator` - Validates incoming requests
- `hooks` - Pre/post request hooks
- `memoryCache` - Response caching
- `logger` - Request/response logging
- `portkey` - Core Portkey-specific middleware for routing, guardrails, etc.

**Plugin System (`plugins/`)**
- Guardrail plugins for content filtering, PII detection, etc.
- Each plugin has `manifest.json` defining capabilities
- Plugins are built separately with `npm run build-plugins`

### Key Concepts

**Configs** - JSON configurations that define:
- Provider routing and fallbacks
- Load balancing strategies
- Guardrails and content filtering
- Caching and retry policies

**Handlers** - Route-specific request processors in `src/handlers/`
- Each AI API endpoint has dedicated handler
- Stream handling for real-time responses
- WebSocket support for realtime APIs

## File Structure

- `src/providers/` - AI provider integrations
- `src/handlers/` - API endpoint handlers
- `src/middlewares/` - Request/response middleware
- `plugins/` - Guardrail and validation plugins
- `cookbook/` - Example integrations and use cases
- `conf.json` - Runtime configuration

## Testing Strategy

Tests are organized by component:
- `src/tests/` - Core gateway functionality tests
- `src/handlers/__tests__/` - Handler-specific tests
- `plugins/*/**.test.ts` - Plugin tests
- Test timeout: 30 seconds (configured in jest.config.js)

## Configuration

The gateway uses `conf.json` for runtime configuration. Sample config available in `conf_sample.json`.

Key environment variables and configuration handled through Hono's adapter system for multi-environment deployment.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY package*.json ./
COPY patches ./

# Upgrade system packages
RUN apk update && apk upgrade --no-cache
RUN apk upgrade --no-cache

# Upgrade npm to version 10.9.2
RUN npm install -g npm@10.9.2
Expand All @@ -29,7 +29,7 @@ RUN npm run build \
FROM node:20-alpine

# Upgrade system packages
RUN apk update && apk upgrade --no-cache
RUN apk upgrade --no-cache

# Upgrade npm to version 10.9.2
RUN npm install -g npm@10.9.2
Expand Down
47 changes: 21 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

<div align="center">

<a href="https://portkey.sh/report-github"><img src="https://raw.githubusercontent.com/siddharthsambharia-portkey/Portkey-Product-Images/refs/heads/main/LLM%20Report%20Campaign%20Frame.png"></img></a>
<br>
🆕 **[Portkey Models](https://github.com/Portkey-AI/models)** - Open-source LLM pricing for 2,300+ models across 40+ providers. [Explore →](https://portkey.ai/models)


# AI Gateway
#### Route to 250+ LLMs with 1 fast & friendly API
Expand Down Expand Up @@ -41,7 +41,8 @@ The [**AI Gateway**](https://portkey.wiki/gh-10) is designed for fast, reliable
- Scale AI apps with **[load balancing](https://portkey.wiki/gh-13)** and **[conditional routing](https://portkey.wiki/gh-14)**
- Protect your AI deployments with **[guardrails](https://portkey.wiki/gh-15)**
- Go beyond text with **[multi-modal capabilities](https://portkey.wiki/gh-16)**
- Finally, explore **[agentic workflow](https://portkey.wiki/gh-17)** integrations
- Explore **[agentic workflow](https://portkey.wiki/gh-17)** integrations
- Manage MCP servers with enterprise auth & observability using **[MCP Gateway](https://portkey.ai/docs/product/mcp-gateway)**

<br><br>

Expand Down Expand Up @@ -163,38 +164,24 @@ You can do a lot more stuff with configs in your AI gateway. [Jump to examples

The LLM Gateway's [enterprise version](https://portkey.wiki/gh-86) offers advanced capabilities for **org management**, **governance**, **security** and [more](https://portkey.wiki/gh-87) out of the box. [View Feature Comparison →](https://portkey.wiki/gh-32)

The enterprise deployment architecture for supported platforms is available here - [**Enterprise Private Cloud Deployments**](https://portkey.wiki/gh-33)
The enterprise deployment architecture for supported platforms is available here - [**Enterprise Private Cloud Deployments**](https://portkey.ai/docs/self-hosting/hybrid-deployments/architecture)

<a href="https://portkey.sh/demo-13"><img src="https://portkey.ai/blog/content/images/2024/08/Get-API-Key--5-.png" height=50 alt="Book an enterprise AI gateway demo" /></a><br/>


<br>

<hr>

### AI Engineering Hours

Join weekly community calls every Friday (8 AM PT) to kickstart your AI Gateway implementation! [Happening every Friday](https://portkey.wiki/gh-35)

<a href="https://portkey.wiki/gh-35"><img width="500" src="https://github.com/user-attachments/assets/c2885699-f197-4289-b819-21eb839fbae1" /></a>

Minutes of Meetings [published here](https://portkey.wiki/gh-36).

## MCP Gateway

<hr>
[MCP Gateway](https://portkey.ai/docs/product/mcp-gateway) provides a centralized control plane for managing MCP (Model Context Protocol) servers across your organization.

### LLMs in Prod'25
- **Authentication** — Single auth layer at the gateway. Users authenticate once; your MCP servers receive verified requests
- **Access Control** — Control which teams and users can access which servers and tools. Revoke access instantly
- **Observability** — Every tool call logged with full context: who called what, parameters, response, latency
- **Identity Forwarding** — Forward user identity (email, team, roles) to MCP servers automatically

Insights from analyzing 2 trillion+ tokens, across 90+ regions and 650+ teams in production. What to expect from this report:
- Trends shaping AI adoption and LLM provider growth.
- Benchmarks to optimize speed, cost and reliability.
- Strategies to scale production-grade AI systems.

<a href="https://portkey.sh/report-github"><img width="500" src="https://raw.githubusercontent.com/siddharthsambharia-portkey/Portkey-Product-Images/refs/heads/main/LLM%20Report%20Campaign%20Image.png" /></a>

<a href="https://portkey.sh/report-github">**Get the Report**</a>
<hr>
Works with Claude Desktop, Cursor, VS Code, and any MCP-compatible client. [Get started →](https://portkey.ai/docs/product/mcp-gateway/quickstart)

<br>

## Core Features
### Reliable Routing
Expand Down Expand Up @@ -227,6 +214,13 @@ Insights from analyzing 2 trillion+ tokens, across 90+ regions and 650+ teams in

<br>

## Portkey Models
Open-source LLM pricing database for 40+ providers - used by the Gateway for cost tracking.

[GitHub](https://github.com/Portkey-AI/models) | [Model Explorer](https://portkey.ai/models)

<br>

## Cookbooks

### ☄️ Trending
Expand Down Expand Up @@ -283,6 +277,7 @@ Gateway seamlessly integrates with popular agent frameworks. [Read the documenta
| [Llama Index](https://portkey.wiki/gh-97) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Control Flow](https://portkey.wiki/gh-98) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Build Your Own Agents](https://portkey.wiki/gh-99) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| <img src="https://io.net/favicon.ico" width=35> | [IO Intelligence](https://io.net/intelligence) | ✅ | ✅ |

<br>

Expand Down
48 changes: 48 additions & 0 deletions conf.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"plugins_enabled": [
"default",
"portkey",
"aporia",
"sydelabs",
"pillar",
"patronus",
"pangea",
"promptsecurity",
"panw-prisma-airs",
"walledai"
],
"credentials": {
"portkey": {
"apiKey": "..."
}
},
"cache": false,
"integrations": [
{
"provider": "anthropic",
"slug": "dev_team_anthropic",
"credentials": {
"apiKey": "sk-ant-"
},
"rate_limits": [
{
"type": "requests",
"unit": "rph",
"value": 3
},
{
"type": "tokens",
"unit": "rph",
"value": 3000
}
],
"models": [
{
"slug": "claude-3-7-sonnet-20250219",
"status": "active",
"pricing_config": null
}
]
}
]
}
4 changes: 3 additions & 1 deletion conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"plugins_enabled": [
"default",
"portkey",
"qualifire",
"aporia",
"sydelabs",
"pillar",
"patronus",
"pangea",
"promptsecurity",
"panw-prisma-airs"
"panw-prisma-airs",
"walledai"
],
"credentials": {
"portkey": {
Expand Down
Empty file removed conf_sample.json
Empty file.
Loading