Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
98faad2
docs(aigw): strip Portkey marketing surface and restructure Integrations
vrv-panw Sep 15, 2026
06206a0
docs(aigw): merge SCM Architecture into a single Architecture page
vrv-panw Sep 15, 2026
ab17933
docs(aigw): fold the provider slug into the model parameter
vrv-panw Sep 15, 2026
4a9c5e6
docs(aigw): rewrite Simple Request as a Setup Guide
vrv-panw Sep 15, 2026
d21ae6a
docs(aigw): convert helper-based OpenAI SDK examples to plain OpenAI SDK
vrv-panw Sep 15, 2026
a90c3d1
docs(aigw): remove Portkey SDK code examples
vrv-panw Sep 15, 2026
72f6c5b
docs(aigw): convert the remaining portkey-ai helper examples
vrv-panw Sep 15, 2026
31820d2
docs(aigw): drop portkey-ai from install commands
vrv-panw Sep 15, 2026
c42c8e5
docs(aigw): retire Portkey SDK headings, tabs, and SDK-reference cards
vrv-panw Sep 15, 2026
605d43c
docs(aigw): de-brand code comments and sample identifiers
vrv-panw Sep 15, 2026
31fe3dd
docs(aigw): sweep remaining Portkey brand mentions from prose
vrv-panw Sep 15, 2026
21c3f34
docs(aigw): put the REST example first in integration code tabs
vrv-panw Sep 15, 2026
29bb104
docs(aigw): fold provider slugs into the model param
vrv-panw Sep 15, 2026
56f59ae
docs(aigw): mirror the OpenAPI spec and wire group-level generation
vrv-panw Sep 15, 2026
e8e39a2
docs(aigw): read the OpenAPI spec from the public URL, drop the mirror
vrv-panw Sep 15, 2026
164bf1f
Merge pull request #1076 from Portkey-AI/docs/prisma-airs-phase-3
vrv-panw Sep 15, 2026
c8718d2
docs(aigw): repoint or unlink api-reference links that resolve to Latest
vrv-panw Sep 15, 2026
cc27c7c
docs(aigw): remove sales CTAs and support "reach out" trailers
vrv-panw Sep 15, 2026
f808ad6
docs(aigw): remove Pro/Enterprise plan-gating callouts
vrv-panw Sep 15, 2026
5090818
docs(aigw): remove the Agent Gateway webinar banner
vrv-panw Sep 15, 2026
0b5b2b5
docs(aigw): rename the API key to Gateway API Key in prose
vrv-panw Sep 15, 2026
cd88027
docs(aigw): cut the Setup Guide to its core steps and normalise filen…
vrv-panw Sep 15, 2026
c153a29
docs(aigw): split composite headings into heading and prose
vrv-panw Sep 15, 2026
bda2ae6
Merge main into the Prisma AIRS phase 3-5 stack
vrv-panw Sep 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 3 additions & 16 deletions aigw/api-reference/admin-api/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ Once your resources are configured, you'll want to measure performance and usage
</Card>
</CardGroup>

### User and Workspace Administration

Beyond resources and analytics, you'll need to manage who has access to your AI Gateway environment:

<CardGroup cols={2}>
<Card title="Users & Invites" href="/api-reference/admin-api/control-plane/users/retrieve-a-user">
Manage user accounts, permissions, and access. Send and manage user invitations.
</Card>
<Card title="Workspaces & Members" href="/api-reference/admin-api/control-plane/workspaces/create-workspace">
Create workspaces and manage team membership and permissions within workspaces.
</Card>
</CardGroup>

## Authentication Strategy

Now that you understand what the Admin API can do, let's explore how to authenticate your requests. The AI Gateway uses a sophisticated access control system with two types of API keys, each designed for different use cases:
Expand Down Expand Up @@ -185,7 +172,7 @@ Every administrative action is recorded with:

This audit trail helps maintain compliance and provides accountability for all administrative changes.

<Card title="Audit Logs Documentation" icon="shield-check" href="https://portkey.ai/docs/product/enterprise-offering/access-control-management#audit-logs">
<Card title="Audit Logs Documentation" icon="shield-check" href="/aigw/product/enterprise-offering/audit-logs">
Learn more about the AI Gateway's audit logging capabilities
</Card>

Expand All @@ -199,8 +186,8 @@ Now that you understand the Admin API ecosystem, authentication, and permissions

For developers looking to integrate with the Admin API, we provide a complete OpenAPI specification that you can use with your API development tools:

<Card title="OpenAPI Specification" icon="file-code" href="/api-reference/admin-api/open-api-specification">
Download the OpenAPI spec for the Admin API
<Card title="OpenAPI Specification" icon="file-code" href="/aigw/api-reference/inference-api/open-api-specification">
A single specification covers both the gateway and the Admin API
</Card>

## Need Support?
Expand Down
75 changes: 1 addition & 74 deletions aigw/api-reference/inference-api/agentic-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Once installed, your AI coding assistant will have knowledge of:
- **Caching** — Semantic and simple caching to reduce costs and latency
- **Fallbacks** — Automatic failover when a provider fails
- **Load Balancing** — Distribute traffic across multiple providers or API keys
- **Multi-Provider Routing** — Route requests to 250+ LLMs through a unified API
- **Multi-Provider Routing** — Route requests to 3,000+ LLMs through a unified API
- **Error Handling** — Proper retry logic and error handling patterns
- **Framework Integrations** — Working with LangChain, LlamaIndex, Strands, and Google ADK

Expand All @@ -66,56 +66,6 @@ After installing the skills, your AI assistant can help you with tasks like:

The assistant will know to use:

<Tabs>
<Tab title="Python">
```python
from portkey_ai import Portkey

client = Portkey(
api_key="YOUR_PORTKEY_API_KEY",
config={
"strategy": {"mode": "fallback"},
"targets": [
{
"override_params": {"model": "@openai/gpt-4o"}
},
{
"override_params": {"model": "@anthropic/claude-sonnet-4-20250514"}
}
]
}
)

response = client.chat.completions.create(
messages=[{"role": "user", "content": "Hello!"}]
)
```
</Tab>
<Tab title="TypeScript">
```typescript
import Portkey from 'portkey-ai';

const client = new Portkey({
apiKey: 'YOUR_PORTKEY_API_KEY',
config: {
strategy: { mode: 'fallback' },
targets: [
{
overrideParams: { model: '@openai/gpt-4o' }
},
{
overrideParams: { model: '@anthropic/claude-sonnet-4-20250514' }
}
]
}
});

const response = await client.chat.completions.create({
messages: [{ role: 'user', content: 'Hello!' }]
});
```
</Tab>
</Tabs>

**"Add request tracing to my AI Gateway calls"**

Expand Down Expand Up @@ -156,23 +106,6 @@ const response = await client.chat.completions.create({

**"Enable semantic caching for my LLM requests"**

```python
client = Portkey(
api_key="YOUR_PORTKEY_API_KEY",
config={
"cache": {
"mode": "semantic", # or "simple" for exact match
"max_age": 3600 # TTL in seconds
}
}
)

# Similar queries return cached responses
response = client.chat.completions.create(
model="@openai/gpt-4o",
messages=[{"role": "user", "content": "What is the capital of France?"}]
)
```

## Installation Options

Expand Down Expand Up @@ -245,12 +178,6 @@ The skill source is available at: [github.com/portkey-ai/skills](https://github.
Contributions and feedback are welcome.

<CardGroup cols={2}>
<Card title="Python SDK Docs" icon="python" href="/api-reference/sdk/python">
Full Python SDK documentation
</Card>
<Card title="TypeScript SDK Docs" icon="js" href="/api-reference/sdk/node">
Full TypeScript SDK documentation
</Card>
<Card title="Skills Repository" icon="github" href="https://github.com/portkey-ai/skills">
View the skills source on GitHub
</Card>
Expand Down
69 changes: 12 additions & 57 deletions aigw/api-reference/inference-api/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,18 @@ Based on your access level, you might see the relevant permissions on the API ke
You can also authenticate the AI Gateway using JWT Tokens. Learn more here
</Card>

## Authentication with SDKs
## Using Your API Key

### AI Gateway SDKs
### REST API

<Tabs>
<Tab title="NodeJS SDK">
```ts
import Portkey from 'portkey-ai'

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

const chatCompletion = await portkey.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'gpt-4o',
});

console.log(chatCompletion.choices);
```
</Tab>
<Tab title="Python SDK">
```python
from portkey_ai import Portkey

client = Portkey(
api_key="PORTKEY_API_KEY", # Replace with your actual API key
provider="@openai-prod" # Optional: AI Provider slug from Model Catalog
)

chat_completion = client.chat.completions.create(
messages=[{"role": "user", "content": "Say this is a test"}],
model='gpt-4o'
)

print(chat_completion.choices[0].message["content"])
```

</Tab>
<Tab title="cURL">
```sh
curl https://aigw.portkey.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PORTKEY_API_KEY" \
-H "x-portkey-provider: @openai-prod" \
-d '{
"model": "gpt-4o",
"model": "@openai-prod/gpt-4o",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
Expand All @@ -76,30 +40,25 @@ curl https://aigw.portkey.ai/v1/chat/completions \
When integrating the AI Gateway through the OpenAI SDK, modify the base URL and add the `Authorization` header for authentication. Here's an example of how to do it:

<Info>
We use the `createHeaders` helper function from the AI Gateway SDK here to easily create AI Gateway headers.

You can pass the raw headers (`x-portkey-api-key`, `x-portkey-provider`) directly in the `defaultHeaders` param as well.
Gateway headers go in the SDK's `defaultHeaders` / `default_headers` parameter. Most requests
need only `x-portkey-provider`, and even that is unnecessary when you prefix the model with the
provider slug — `"model": "@openai-prod/gpt-4o"`.
</Info>

<Tabs>
<Tab title="NodeJS">
```js
import OpenAI from 'openai';
import { PORTKEY_GATEWAY_URL, createHeaders } from 'portkey-ai'

const openai = new OpenAI({
apiKey: 'OPENAI_API_KEY',
baseURL: PORTKEY_GATEWAY_URL,
defaultHeaders: createHeaders({
provider: "openai",
apiKey: "PORTKEY_API_KEY"
})
apiKey: "PORTKEY_API_KEY",
baseURL: "https://aigw.portkey.ai/v1",
});

async function main() {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'gpt-4o',
model: '@openai/gpt-4o',
});

console.log(chatCompletion.choices);
Expand All @@ -112,18 +71,14 @@ main();
<Tab title="Python">
```python
from openai import OpenAI
from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders

openai_client = OpenAI(
base_url=PORTKEY_GATEWAY_URL,
default_headers=createHeaders(
api_key="PORTKEY-API-KEY",
provider="openai"
)
api_key="PORTKEY_API_KEY",
base_url="https://aigw.portkey.ai/v1",
)
response = openai_client.chat.completions.create(
messages=[{'role': 'user', 'content': 'Say this is a test'}],
model='gpt-4bo'
model='@openai/gpt-4o'
)
```
</Tab>
Expand Down
Loading