> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# What is Portkey?

> Portkey AI is a comprehensive platform designed to streamline and enhance AI integration for developers and organizations. It serves as a unified interface for interacting with over 250 AI models, offering advanced tools for control, visibility, and security in your Generative AI apps.

It takes 2 mins to integrate and with that, it starts monitoring all of your LLM requests and makes your app resilient, secure, performant, and more accurate at the same time.

Here's a product walkthrough (3 mins):

[YouTube video player](https://www.youtube.com/embed/DBGeYByV5zc)

### Integrate in 3 Lines of Code

```Python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(
    api_key="YOUR_PORTKEY_API_KEY",
    provider="@YOUR_PROVIDER"
)

chat_complete = portkey.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ]
)
print(chat_complete.choices[0].message.content)
```

```js NodeJS theme={"system"}
import Portkey from 'portkey-ai';

const portkey = new Portkey({
  apiKey: "YOUR_PORTKEY_API_KEY",
  provider:"@YOUR_PROVIDER"
});

async function createChatCompletion() {
  const chat_complete = await portkey.chat.completions.create({
    model: "gpt-3.5-turbo",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Hello!" }
    ]
  });
  console.log(chat_complete.choices[0].message.content);
}

createChatCompletion();
```

```sh REST API theme={"system"}
curl https://api.portkey.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: YOUR_PORTKEY_API_KEY" \
  -H "x-portkey-provider: YOUR_PROVIDER" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
```

```py OpenAI Python SDK theme={"system"}
from openai import OpenAI
from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders

client = OpenAI(
    api_key="YOUR_OPENAI_API_KEY",
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        provider="openai",
        api_key="YOUR_PORTKEY_API_KEY"
    )
)

chat_complete = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ]
)
print(chat_complete.choices[0].message.content)
```

```js OpenAI NodeJS SDK theme={"system"}
import OpenAI from 'openai';
import { PORTKEY_GATEWAY_URL, createHeaders } from 'portkey-ai';

const openai = new OpenAI({
  apiKey: 'YOUR_OPENAI_API_KEY',
  baseURL: PORTKEY_GATEWAY_URL,
  defaultHeaders: createHeaders({
    provider: "openai",
    apiKey: "YOUR_PORTKEY_API_KEY"
  })
});

async function createChatCompletion() {
  const chat_complete = await openai.chat.completions.create({
    model: "gpt-3.5-turbo",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Hello!" }
    ]
  });
  console.log(chat_complete.choices[0].message.content);
}

createChatCompletion();
```

> [!TIP]
>
> While you're here, why not [give us a star](https://git.new/ai-gateway-docs)? It helps us a lot!

### FAQs

> [accordion] Will Portkey increase the latency of my API requests?
>
> Portkey is hosted on edge workers throughout the world, ensuring minimal latency. Our benchmarks estimate a total latency addition between 20-40ms compared to direct API calls. This slight increase is often offset by the benefits of our caching and routing optimizations.
>
> Our edge worker locations:
>
> ![](https://mintcdn.com/portkey-docs/TEsf28na2t53tvAY/images/welcome/welcome-4.avif?fit=max\&auto=format\&n=TEsf28na2t53tvAY\&q=85\&s=d1dd3bab6129060dbfd83880816ddf26)

> [accordion] Is my data secure?
>
> Portkey AI is ISO:27001 and SOC 2 certified, and GDPR & HIPAA compliant. We maintain best practices for service security, data storage, and retrieval. All data is encrypted in transit and at rest using industry-standard AES-256 encryption. For enhanced security, we offer:
>
> 1. On request, we can enable a feature that does NOT store any of your request and response body objects in Portkey datastores or our logs.
> 2. For enterprises, we offer managed hosting to deploy Portkey inside private clouds.
>
> For more information on these options, contact [Portkey support](https://support.portkey.ai/forms/customer-portal-ticket-form).

> [accordion] Will Portkey scale if my app explodes?
>
> Portkey is built on scalable infrastructure and can handle millions of requests per minute with very high concurrency. We currently serve over 25M requests daily with a 99.99% uptime. Our edge architecture & scaling capabilities ensure we can accommodate sudden spikes in traffic without performance degradation.
>
> [View our Status Page](https://status.portkey.ai)

> [accordion] Does Portkey impose timeouts on requests?
>
> We *DO NOT* impose any explicit timeout for our free OR paid plans currently. While we don't time out requests on our end, we recommend implementing client-side timeouts appropriate for your use case to handle potential network issues or upstream API delays.

> [accordion] Do you support SSO?
>
> Yes! We support SSO with any custom OIDC provider.

> [accordion] What are the pricing options? Is there a free trial?
>
> Portkey's Gateway is open source and free to use.
> On managed version, Portkey offers a free plan with 10k requests per month. We also offer paid plans with more requests and additional features.

> [accordion] Where can I reach you?
>
> We're available via our [support portal](https://support.portkey.ai/forms/customer-portal-ticket-form)

***

> [card] [Portkey is now PRISMA AIRS AI Gateway. See it in action.](https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\&utm_medium=referral\&utm_campaign=prisma_airs\&utm_content=docs_nav#contact)
>
> Contact Us


## Related topics

- [How to use Portkey Guardrails for PII Protection](https://docs.portkey.ai/docs/guides/use-cases/guardrail-pii-use-case.md)
- [Unified Batch Inference](https://docs.portkey.ai/docs/product/ai-gateway/batches.md)
- [Claude Desktop for Platform Admins](https://docs.portkey.ai/docs/integrations/libraries/claude-desktop-platform-admins.md)
- [Claude Desktop for Developers](https://docs.portkey.ai/docs/integrations/libraries/claude-desktop-developers.md)
- [Feature Comparison](https://docs.portkey.ai/docs/product/product-feature-comparison.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.