Skip to content

Commit d0469c6

Browse files
Merge branch 'main' into chore/update-crewai-docs
2 parents ae8903d + 6302577 commit d0469c6

25 files changed

+1734
-349
lines changed

api-reference/inference-api/authentication.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ To ensure secure access to Portkey's APIs, authentication is required for all re
1414

1515
Based on your access level, you might see the relevant permissions on the API key modal - tick the ones you'd like, name your API key, and save it.
1616

17+
<Card title="JWT-based Authentication" href="#jwt-based-authentication">
18+
You can also authenticate Portkey using JWT Tokens. Learn more here
19+
</Card>
20+
1721
## Authentication with SDKs
1822

1923
### Portkey SDKs
@@ -130,3 +134,25 @@ response = openai_client.chat.completions.create(
130134
</Tabs>
131135

132136
Read more [here](/integrations/llms/openai).
137+
138+
139+
## JWT-based Authentication
140+
141+
Portkey supports JWT-based authentication as a secure alternative to API Key authentication. With JWT authentication, clients can authenticate API requests using a JWT token that is validated against a configured JWKS (JSON Web Key Set).
142+
143+
This enterprise-grade authentication method is available as an add-on to any Portkey plan. JWT authentication provides enhanced security through:
144+
145+
- Temporary, expiring tokens
146+
- Fine-grained permission scopes
147+
- User identity tracking
148+
- Centralized authentication management
149+
150+
<Card title="JWT Token Authentication" href="/product/enterprise-offering/org-management/jwt">
151+
Learn how to implement JWT-based authentication with Portkey
152+
</Card>
153+
154+
<Note>
155+
<b>Interested in adding JWT authentication to your Portkey plan?</b>
156+
157+
[Contact our sales team](https://portkey.sh/jwt) to discuss pricing and implementation details.
158+
</Note>

api-reference/inference-api/gateway-for-other-apis.mdx

Lines changed: 130 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ Portkey API has first-class support for monitoring and routing your requests to
1111

1212
**However**, there are still many endpoints like Cohere's `/rerank` or Deepgram's `/listen` that are uncommon or have niche use cases.
1313

14-
With the **Gateway to Other APIs** feature, you can route to any custom provider endpoint using Portkey (including the ones hosted on your private setups) and get **complete logging & monitoring** for all your requests.
14+
With the **Gateway to Other APIs** feature, you can route to any custom provider endpoint using Portkey (including the ones hosted on your private setups) and get **complete logging & monitoring** for all your requests.
15+
16+
## Supported HTTP Methods
17+
18+
<CardGroup cols={4}>
19+
<Card title="POST" color="#4CAF50" />
20+
<Card title="GET" color="#2196F3" />
21+
<Card title="PUT" color="#FF9800" />
22+
<Card title="DELETE" color="#F44336" />
23+
</CardGroup>
24+
25+
Both the REST API and Portkey SDKs (Python, NodeJS) support all of these HTTP methods.
1526

1627
# How to Integrate
1728

@@ -21,7 +32,7 @@ With the **Gateway to Other APIs** feature, you can route to any custom provider
2132

2233

2334
## 1. Get Portkey API Key
24-
Create or log in to your Portkey account. Grab your accounts API key from the [API Keys page](https://app.portkey.ai/api-keys).
35+
Create or log in to your Portkey account. Grab your account's API key from the ["API Keys" page](https://app.portkey.ai/api-keys).
2536

2637
## 2. Add Provider Details
2738

@@ -148,7 +159,8 @@ Construct your request URL:
148159
1. Portkey Gateway base URL remains same: `https://api.portkey.ai/v1`
149160
2. Append your custom endpoint at the end of the URL: `https://api.portkey.ai/v1/{provider-endpoint}`
150161

151-
```bash
162+
<CodeGroup>
163+
```bash POST
152164
curl --request POST \
153165
--url https://api.portkey.ai/v1/rerank \
154166
--header 'Content-Type: application/json' \
@@ -163,14 +175,43 @@ curl --request POST \
163175
]
164176
}'
165177
```
178+
179+
```bash GET
180+
curl --request GET \
181+
--url https://api.portkey.ai/v1/collections \
182+
--header 'Content-Type: application/json' \
183+
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
184+
--header 'x-portkey-virtual-key: $PROVIDER_VIRTUAL_KEY'
185+
```
186+
187+
```bash PUT
188+
curl --request PUT \
189+
--url https://api.portkey.ai/v1/collections/my-collection \
190+
--header 'Content-Type: application/json' \
191+
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
192+
--header 'x-portkey-virtual-key: $PROVIDER_VIRTUAL_KEY' \
193+
--data '{
194+
"metadata": {
195+
"description": "Updated collection description"
196+
}
197+
}'
198+
```
199+
200+
```bash DELETE
201+
curl --request DELETE \
202+
--url https://api.portkey.ai/v1/collections/my-collection \
203+
--header 'Content-Type: application/json' \
204+
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
205+
--header 'x-portkey-virtual-key: $PROVIDER_VIRTUAL_KEY'
206+
```
207+
</CodeGroup>
166208
</Tab>
167209

168210
<Tab title="Python SDK">
169-
<Info>The SDK supports the `POST` method currently.</Info>
170-
1. Instantiate your Portkey client
171-
2. Use the `.post(url, requestParams)` method to make requests:
211+
The SDK fully supports all HTTP methods: `POST`, `GET`, `PUT`, and `DELETE`.
172212

173-
```python
213+
<CodeGroup>
214+
```python POST
174215
from portkey_ai import Portkey
175216

176217
portkey = Portkey(
@@ -188,14 +229,52 @@ response = portkey.post(
188229
]
189230
)
190231
```
232+
233+
```python GET
234+
from portkey_ai import Portkey
235+
236+
portkey = Portkey(
237+
api_key="PORTKEY_API_KEY",
238+
virtual_key="PROVIDER_VIRTUAL_KEY"
239+
)
240+
241+
response = portkey.get('/collections')
242+
```
243+
244+
```python PUT
245+
from portkey_ai import Portkey
246+
247+
portkey = Portkey(
248+
api_key="PORTKEY_API_KEY",
249+
virtual_key="PROVIDER_VIRTUAL_KEY"
250+
)
251+
252+
response = portkey.put(
253+
'/collections/my-collection',
254+
metadata={
255+
"description": "Updated collection description"
256+
}
257+
)
258+
```
259+
260+
```python DELETE
261+
from portkey_ai import Portkey
262+
263+
portkey = Portkey(
264+
api_key="PORTKEY_API_KEY",
265+
virtual_key="PROVIDER_VIRTUAL_KEY"
266+
)
267+
268+
response = portkey.delete('/collections/my-collection')
269+
```
270+
</CodeGroup>
191271
</Tab>
192272

193273
<Tab title="NodeJS SDK">
194-
<Info>The SDK supports the `POST` method currently.</Info>
195-
1. Instantiate your Portkey client
196-
2. Use the `.post(url, requestParams)` method to make requests:
274+
The SDK fully supports all HTTP methods: `POST`, `GET`, `PUT`, and `DELETE`.
197275

198-
```javascript
276+
<CodeGroup>
277+
```javascript POST
199278
import Portkey from 'portkey-ai';
200279

201280
const portkey = new Portkey({
@@ -212,6 +291,44 @@ const response = await portkey.post('/rerank', {
212291
]
213292
});
214293
```
294+
295+
```javascript GET
296+
import Portkey from 'portkey-ai';
297+
298+
const portkey = new Portkey({
299+
apiKey: "PORTKEY_API_KEY",
300+
virtualKey: "PROVIDER_VIRTUAL_KEY"
301+
});
302+
303+
const response = await portkey.get('/collections');
304+
```
305+
306+
```javascript PUT
307+
import Portkey from 'portkey-ai';
308+
309+
const portkey = new Portkey({
310+
apiKey: "PORTKEY_API_KEY",
311+
virtualKey: "PROVIDER_VIRTUAL_KEY"
312+
});
313+
314+
const response = await portkey.put('/collections/my-collection', {
315+
metadata: {
316+
description: "Updated collection description"
317+
}
318+
});
319+
```
320+
321+
```javascript DELETE
322+
import Portkey from 'portkey-ai';
323+
324+
const portkey = new Portkey({
325+
apiKey: "PORTKEY_API_KEY",
326+
virtualKey: "PROVIDER_VIRTUAL_KEY"
327+
});
328+
329+
const response = await portkey.delete('/collections/my-collection');
330+
```
331+
</CodeGroup>
215332
</Tab>
216333
</Tabs>
217334

@@ -247,8 +364,8 @@ response = portkey.post(
247364
# Caveats & Considerations
248365

249366
- Response objects are returned exactly as received from the provider, without Portkey transformations
250-
- REST API supports all HTTP methods
251-
- SDK currently supports `POST` only (more methods coming soon)
367+
- REST API supports all HTTP methods: `POST`, `GET`, `PUT`, and `DELETE`
368+
- SDK supports all HTTP methods: `POST`, `GET`, `PUT`, and `DELETE`
252369
- There are no limitations on which provider endpoints can be proxied
253370
- All requests are logged and monitored through your Portkey dashboard
254371

docs.json

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,9 @@
101101
"pages": [
102102
"product/guardrails",
103103
"product/guardrails/list-of-guardrail-checks",
104-
"product/guardrails/azure-guardrails",
105-
"product/guardrails/pii-redaction",
106-
"product/guardrails/patronus-ai",
107-
"product/guardrails/bedrock-guardrails",
108-
"product/guardrails/lasso",
109-
"product/guardrails/aporia",
110-
"product/guardrails/pillar",
111-
"product/guardrails/prompt-security",
112-
"product/guardrails/pangea",
113-
"product/guardrails/acuvity",
114-
"product/guardrails/mistral",
115104
"product/guardrails/embedding-guardrails",
116-
"product/guardrails/bring-your-own-guardrails",
117-
"product/guardrails/creating-raw-guardrails-in-json"
105+
"product/guardrails/creating-raw-guardrails-in-json",
106+
"product/guardrails/pii-redaction"
118107
]
119108
},
120109
"product/mcp",
@@ -333,6 +322,22 @@
333322
"group": "Cloud Platforms",
334323
"pages": ["integrations/cloud/azure"]
335324
},
325+
{
326+
"group": "Guardrails",
327+
"pages": [
328+
"integrations/guardrails/aporia",
329+
"integrations/guardrails/acuvity",
330+
"integrations/guardrails/azure-guardrails",
331+
"integrations/guardrails/bedrock-guardrails",
332+
"integrations/guardrails/lasso",
333+
"integrations/guardrails/mistral",
334+
"integrations/guardrails/pangea",
335+
"integrations/guardrails/patronus-ai",
336+
"integrations/guardrails/pillar",
337+
"integrations/guardrails/prompt-security",
338+
"integrations/guardrails/bring-your-own-guardrails"
339+
]
340+
},
336341
{
337342
"group": "Plugins",
338343
"pages": ["integrations/plugins/exa"]
@@ -869,7 +874,10 @@
869874
},
870875
{
871876
"group": "SDK Releases",
872-
"pages": ["changelog/node-sdk-changelog", "changelog/python-sdk-changelog"]
877+
"pages": [
878+
"changelog/node-sdk-changelog",
879+
"changelog/python-sdk-changelog"
880+
]
873881
}
874882
]
875883
}
@@ -2241,6 +2249,50 @@
22412249
{
22422250
"source": "/api-reference/inference-api/sdks/c-sharp",
22432251
"destination": "/api-reference/sdk/c-sharp"
2252+
},
2253+
{
2254+
"source": "/product/guardrails/aporia",
2255+
"destination": "/integrations/guardrails/aporia"
2256+
},
2257+
{
2258+
"source": "/product/guardrails/acuvity",
2259+
"destination": "/integrations/guardrails/acuvity"
2260+
},
2261+
{
2262+
"source": "/product/guardrails/azure-guardrails",
2263+
"destination": "/integrations/guardrails/azure-guardrails"
2264+
},
2265+
{
2266+
"source": "/product/guardrails/bedrock-guardrails",
2267+
"destination": "/integrations/guardrails/bedrock-guardrails"
2268+
},
2269+
{
2270+
"source": "/product/guardrails/lasso",
2271+
"destination": "/integrations/guardrails/lasso"
2272+
},
2273+
{
2274+
"source": "/product/guardrails/mistral",
2275+
"destination": "/integrations/guardrails/mistral"
2276+
},
2277+
{
2278+
"source": "/product/guardrails/pangea",
2279+
"destination": "/integrations/guardrails/pangea"
2280+
},
2281+
{
2282+
"source": "/product/guardrails/patronus-ai",
2283+
"destination": "/integrations/guardrails/patronus-ai"
2284+
},
2285+
{
2286+
"source": "/product/guardrails/pillar",
2287+
"destination": "/integrations/guardrails/pillar"
2288+
},
2289+
{
2290+
"source": "/product/guardrails/prompt-security",
2291+
"destination": "/integrations/guardrails/prompt-security"
2292+
},
2293+
{
2294+
"source": "/product/guardrails/bring-your-own-guardrails",
2295+
"destination": "/integrations/guardrails/bring-your-own-guardrails"
22442296
}
22452297
],
22462298
"seo": {

0 commit comments

Comments
 (0)