> ## 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.

# Strict OpenAI Compliance

By default, all the responses sent back from Portkey are compliant with the [OpenAI specification](https://platform.openai.com/docs/api-reference/chat/create).

In some cases, a response from a provider like Perplexity may contain useful fields which do not have a corresponding 1:1 mapping to OpenAI fields.
To get those fields in the response, you can do one of the following:

* Python SDK: Pass this parameter `strict_open_ai_compliance=false` when initializing the portkey client
* Node SDK: Pass this parameter `strictOpenAiCompliance: false` when initializing the portkey client
* HTTP requests: Pass this header `x-portkey-strict-open-ai-compliance: false` with your request

> [!NOTE]
>
> By default strict\_open\_ai\_compliance=false in Portkey Python and Node SDK

> [tab] Python SDK
>
> ```python theme={"system"}
> from portkey_ai import Portkey
>
> portkey = Portkey(
>     api_key="PORTKEY_API_KEY",
>     provider="@PROVIDER", 
>     strict_open_ai_compliance=False
> )
> ```

> [tab] Node SDK
>
> ```js theme={"system"}
> import Portkey from 'portkey-ai'
>
> const portkey = new Portkey({
>     apiKey: "PORTKEY_API_KEY",
>     provider:"@PROVIDER",
>     strictOpenAiCompliance: false
> })
> ```

> [tab] cURL
>
> Add the following header to your request
> `x-portkey-strict-open-ai-compliance: false`

> [tab] OpenAI python
>
> ```python theme={"system"}
> from openai import OpenAI
> from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders
>
> openai = OpenAI(
>     api_key='OPENAI_API_KEY',
>     base_url=PORTKEY_GATEWAY_URL,
>     default_headers=createHeaders(
>         provider="openai",
>         api_key="PORTKEY_API_KEY"
>         strict_open_ai_compliance=False
>     )
> )
> ```

> [tab] OpenAI Node SDK
>
> ```js theme={"system"}
> import OpenAI from 'openai'; // We're using the v4 SDK
> import { PORTKEY_GATEWAY_URL, createHeaders } from 'portkey-ai'
>
> const openai = new OpenAI({
>   apiKey: 'OPENAI_API_KEY', // defaults to process.env["OPENAI_API_KEY"],
>   baseURL: PORTKEY_GATEWAY_URL,
>   defaultHeaders: createHeaders({
>     provider: "openai",
>     apiKey: "PORTKEY_API_KEY", // defaults to process.env["PORTKEY_API_KEY"],
>     strictOpenAiCompliance: false
>   })
> });
> ```

***

> [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

- [Google Gemini](https://docs.portkey.ai/docs/integrations/llms/gemini.md)
- [Perplexity AI](https://docs.portkey.ai/docs/integrations/llms/perplexity-ai.md)
- [Handle streaming output guardrails for client-side decisions](https://docs.portkey.ai/docs/guides/use-cases/streaming-output-guardrails.md)
- [Enterprise Gateway](https://docs.portkey.ai/docs/changelog/enterprise.md)
- [December](https://docs.portkey.ai/docs/changelog/2024/dec.md)


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