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

# Oracle Cloud Infrastructure

Portkey provides a robust and secure gateway to facilitate the integration of various Large Language Models (LLMs) into your applications, including [Oracle Cloud Infrastructure (OCI) Generative AI](https://www.oracle.com/artificial-intelligence/generative-ai/generative-ai-service/).

> [!NOTE]
>
> Provider Slug: `oracle`

## Portkey SDK Integration with Oracle OCI

Portkey provides a consistent API to interact with models from various providers. To integrate Oracle OCI Generative AI with Portkey:

### 1. Install the Portkey SDK

> [tab] NodeJS
>
> ```sh theme={"system"}
> npm install --save portkey-ai
> ```

> [tab] Python
>
> ```sh theme={"system"}
> pip install portkey-ai
> ```

### 2. Initialize Portkey with Oracle OCI

Oracle OCI uses API key-based authentication with request signing. You'll need the following credentials from your OCI console:

| Parameter | Description |
| - | - |
| `oracleRegion` | OCI region (e.g., `us-chicago-1`, `eu-frankfurt-1`) |
| `oracleTenancy` | Your OCI tenancy OCID |
| `oracleCompartmentId` | Your OCI compartment OCID |
| `oracleUser` | Your OCI user OCID |
| `oracleFingerprint` | API key fingerprint |
| `oraclePrivateKey` | Private key content (PEM format) |
| `oracleKeyPassphrase` | (Optional) Passphrase for encrypted private key |

Add these credentials to [Model Catalog](https://app.portkey.ai/model-catalog) to create an Oracle AI Provider.

> [tab] NodeJS SDK
>
> ```js theme={"system"}
> import Portkey from 'portkey-ai'
>
> const portkey = new Portkey({
>     apiKey: "PORTKEY_API_KEY", // defaults to process.env["PORTKEY_API_KEY"]
>     provider: "@oracle-prod" // Your AI Provider slug from Model Catalog
> })
> ```

> [tab] Python SDK
>
> ```py theme={"system"}
> from portkey_ai import Portkey
>
> portkey = Portkey(
>     api_key="PORTKEY_API_KEY",  # Replace with your Portkey API key
>     provider="@oracle-prod"  # Your AI Provider slug from Model Catalog
> )
> ```

### 3. Invoke Chat Completions

> [tab] NodeJS SDK
>
> ```js theme={"system"}
> const chatCompletion = await portkey.chat.completions.create({
>     messages: [{ role: 'user', content: 'Say this is a test' }],
>     model: 'cohere.command-r-plus',
> });
>
> console.log(chatCompletion.choices);
> ```

> [tab] Python SDK
>
> ```python theme={"system"}
> completion = portkey.chat.completions.create(
>     messages=[{ "role": "user", "content": "Say this is a test" }],
>     model="cohere.command-r-plus"
> )
>
> print(completion)
> ```

> [tab] cURL
>
> ```sh theme={"system"}
> curl https://api.portkey.ai/v1/chat/completions \
>   -H "Content-Type: application/json" \
>   -H "x-portkey-api-key: $PORTKEY_API_KEY" \
>   -H "x-portkey-provider: @ORACLE_PROVIDER" \
>   -d '{
>     "model": "cohere.command-r-plus",
>     "messages": [
>       { "role": "user", "content": "Say this is a test" }
>     ]
>   }'
> ```

***

## Supported Models

Oracle OCI Generative AI supports various foundation models including:

* **Cohere Models**: `cohere.command-r-plus`, `cohere.command-r`, `cohere.command`
* **Meta Llama Models**: `meta.llama-3.1-405b-instruct`, `meta.llama-3.1-70b-instruct`

For the complete list of available models, refer to the [Oracle OCI Generative AI documentation](https://docs.oracle.com/en-us/iaas/Content/generative-ai/pretrained-models.htm).

## Configuration Options

You can specify the API version using the `oracleApiVersion` parameter (defaults to `20231130`). If the value isn't a valid 8-digit version date, the default version is used.

***

## Next Steps

The complete list of features supported in the SDK are available on the link below.

> [card] [SDK](https://docs.portkey.ai/docs/api-reference/sdk)

You'll find more information in the relevant sections:

1. [Add metadata to your requests](https://docs.portkey.ai/docs/product/observability/metadata.md)
2. [Add gateway configs to your Oracle requests](https://docs.portkey.ai/docs/product/ai-gateway/configs.md)
3. [Tracing Oracle requests](https://docs.portkey.ai/docs/product/observability/traces.md)
4. [Setup a fallback from OpenAI to Oracle](https://docs.portkey.ai/docs/product/ai-gateway/fallbacks.md)

***

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

- [Enterprise Gateway](https://docs.portkey.ai/docs/changelog/enterprise.md)
- [Backend](https://docs.portkey.ai/docs/changelog/backend.md)
- [Custom hosts](https://docs.portkey.ai/docs/product/ai-gateway/custom-hosts.md)
- [Feature Comparison](https://docs.portkey.ai/docs/product/product-feature-comparison.md)
- [ECS](https://docs.portkey.ai/docs/self-hosting/hybrid-deployments/aws/ecs.md)


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