Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title: Create Virtual Key
openapi: post /virtual-keys
---

<Warning>
**Deprecated.** Use the [Integrations API](/api-reference/admin-api/control-plane/integrations/create-integration) to store provider credentials and the [Providers API](/api-reference/admin-api/control-plane/providers/create-provider) to create AI Providers in your workspace. Existing virtual keys continue to work — no code changes needed.
</Warning>

#### <Icon icon="microsoft" /> Azure OpenAI
Create virtual key to access your Azure OpenAI models or deployments, and manage all auth in one place.
<AccordionGroup>
Expand Down Expand Up @@ -247,6 +251,6 @@ main();
#### <Icon icon="google" /> Vertex AI
Create virtual key to access any models available or hosted on Vertex AI. [Docs →](/integrations/llms/vertex-ai)

<Card icon="gear" title="Learn More About Virtual Keys" href="/product/ai-gateway/virtual-keys">
Securely store your provider auth in Portkey vault and democratize and streamline access to Gen AI.
<Card icon="sparkles" title="Model Catalog" href="/product/model-catalog">
Manage AI providers and models centrally with budget limits, rate limits, and model provisioning.
</Card>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
title: Delete Virtual Key
openapi: delete /virtual-keys/{slug}
---

<Warning>
**Deprecated.** Use the [Providers API](/api-reference/admin-api/control-plane/providers/delete-provider) instead. Existing virtual keys continue to work — no code changes needed.
</Warning>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
title: List Virtual Key
openapi: get /virtual-keys
---

<Warning>
**Deprecated.** Use the [Providers API](/api-reference/admin-api/control-plane/providers/list-providers) instead. Existing virtual keys continue to work — no code changes needed.
</Warning>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
title: Retrieve Virtual Key
openapi: get /virtual-keys/{slug}
---

<Warning>
**Deprecated.** Use the [Providers API](/api-reference/admin-api/control-plane/providers/retrieve-provider) instead. Existing virtual keys continue to work — no code changes needed.
</Warning>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
title: Update Virtual Key
openapi: put /virtual-keys/{slug}
---

<Warning>
**Deprecated.** Use the [Providers API](/api-reference/admin-api/control-plane/providers/update-provider) instead. Existing virtual keys continue to work — no code changes needed.
</Warning>
6 changes: 3 additions & 3 deletions api-reference/admin-api/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ At the foundation of Portkey are the resources that define how your AI implement
<Card title="Configs" href="/api-reference/admin-api/control-plane/configs/create-config">
Create and manage configuration profiles that define routing rules, model settings, and more.
</Card>
<Card title="Virtual Keys" href="/api-reference/admin-api/control-plane/virtual-keys/create-virtual-key">
Manage virtual API keys that provide customized access to specific configurations.
<Card title="Providers & Integrations" href="/api-reference/admin-api/control-plane/providers/create-provider">
Manage AI providers and credentials across workspaces. Replaces Virtual Keys.
</Card>
<Card title="API Keys" href="/api-reference/admin-api/control-plane/api-keys/create-api-key">
Create and manage API keys for accessing Portkey services.
Expand Down Expand Up @@ -172,7 +172,7 @@ Both key types have different capabilities. This table clarifies which operation
| Create/manage workspaces | ✅ | ❌ |
| Manage users and permissions | ✅ | ❌ |
| Create/manage configs | ✅ (All workspaces) | ✅ (Single workspace) |
| Create/manage virtual keys | ✅ (All workspaces) | ✅ (Single workspace) |
| Create/manage providers | ✅ (All workspaces) | ✅ (Single workspace) |
| Access Analytics | ✅ (All workspaces) | ✅ (Single workspace) |
| Create/update feedback | ❌ | ✅ |

Expand Down
6 changes: 3 additions & 3 deletions api-reference/inference-api/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Portkey from 'portkey-ai'

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY", // Replace with your actual API key
virtualKey: "VIRTUAL_KEY" // Optional: Use for virtual key management
provider: "@openai-prod" // Optional: AI Provider slug from Model Catalog
})

const chatCompletion = await portkey.chat.completions.create({
Expand All @@ -48,7 +48,7 @@ from portkey_ai import Portkey

client = Portkey(
api_key="PORTKEY_API_KEY", # Replace with your actual API key
provider="@VIRTUAL_KEY" # Optional: Use if virtual keys are set up
provider="@openai-prod" # Optional: AI Provider slug from Model Catalog
)

chat_completion = client.chat.completions.create(
Expand All @@ -65,7 +65,7 @@ print(chat_completion.choices[0].message["content"])
curl https://api.portkey.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $VIRTUAL_KEY" \
-H "x-portkey-provider: @openai-prod" \
-d '{
"model": "gpt-4o",
"messages": [
Expand Down
32 changes: 16 additions & 16 deletions api-reference/inference-api/gateway-for-other-apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ Create or log in to your Portkey account. Grab your account's API key from the [
Choose one of these authentication methods:

<AccordionGroup>
<Accordion title="Option 1. Generate a Virtual Key (Recommended)">
Portkey integrates with 40+ LLM providers. Add your provider credentials (such as API key) to Portkey, and get a virtual key that you can use to authenticate and send your requests.
<Accordion title="Option 1. Add an AI Provider (Recommended)">
Add your provider credentials to [Model Catalog](https://app.portkey.ai/model-catalog) and use the AI Provider slug to authenticate your requests.

<CodeGroup>

```sh cURL
curl https://api.portkey.ai/v1/rerank \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER" \
-H "x-portkey-provider: @cohere-prod" \
```

```py Python
from portkey_ai import Portkey

portkey = Portkey(
api_key = "PORTKEY_API_KEY",
virtual_key = "PROVIDER"
provider = "@cohere-prod"
)
```

Expand All @@ -65,15 +65,15 @@ import Portkey from 'portkey-ai';

const portkey = new Portkey({
apiKey: 'PORTKEY_API_KEY',
virtualKey: 'PROVIDER'
provider: '@cohere-prod'
});
```
</CodeGroup>
<Note>
Creating virtual keys lets you:
- Manage all credentials in one place
Model Catalog lets you:
- Manage all provider credentials in one place
- Set budget limits & rate limits per provider
- Rotate between different provider keys
- Set custom budget limits & rate limits per key
</Note>
</Accordion>

Expand Down Expand Up @@ -165,7 +165,7 @@ curl --request POST \
--url https://api.portkey.ai/v1/rerank \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-virtual-key: $COHERE_VIRTUAL_KEY' \
--header 'x-portkey-provider: @cohere-prod' \
--data '{
"model": "rerank-english-v2.0",
"query": "What is machine learning?",
Expand All @@ -181,15 +181,15 @@ curl --request GET \
--url https://api.portkey.ai/v1/collections \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-virtual-key: $PROVIDER'
--header 'x-portkey-provider: @provider-prod'
```

```bash PUT
curl --request PUT \
--url https://api.portkey.ai/v1/collections/my-collection \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-virtual-key: $PROVIDER' \
--header 'x-portkey-provider: @provider-prod' \
--data '{
"metadata": {
"description": "Updated collection description"
Expand All @@ -202,7 +202,7 @@ curl --request DELETE \
--url https://api.portkey.ai/v1/collections/my-collection \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-virtual-key: $PROVIDER'
--header 'x-portkey-provider: @provider-prod'
```
</CodeGroup>
</Tab>
Expand Down Expand Up @@ -279,7 +279,7 @@ import Portkey from 'portkey-ai';

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
virtualKey: "PROVIDER"
provider: "@cohere-prod"
});

const response = await portkey.post('/rerank', {
Expand All @@ -297,7 +297,7 @@ import Portkey from 'portkey-ai';

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
virtualKey: "PROVIDER"
provider: "@cohere-prod"
});

const response = await portkey.get('/collections');
Expand All @@ -308,7 +308,7 @@ import Portkey from 'portkey-ai';

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
virtualKey: "PROVIDER"
provider: "@cohere-prod"
});

const response = await portkey.put('/collections/my-collection', {
Expand All @@ -323,7 +323,7 @@ import Portkey from 'portkey-ai';

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
virtualKey: "PROVIDER"
provider: "@cohere-prod"
});

const response = await portkey.delete('/collections/my-collection');
Expand Down
Loading