> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-add-third-party-integration-issues-fixes.mintlify.site/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`
</Note>

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

<Tabs>
  <Tab title="NodeJS">
    ```sh theme={null}
    npm install --save portkey-ai
    ```
  </Tab>

  <Tab title="Python">
    ```sh theme={null}
    pip install portkey-ai
    ```
  </Tab>
</Tabs>

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

<Tabs>
  <Tab title="NodeJS SDK">
    ```js theme={null}
    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>

  <Tab title="Python SDK">
    ```py theme={null}
    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
    )
    ```
  </Tab>
</Tabs>

### 3. Invoke Chat Completions

<Tabs>
  <Tab title="NodeJS SDK">
    ```js theme={null}
    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>

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

    print(completion)
    ```
  </Tab>

  <Tab title="cURL">
    ```sh theme={null}
    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" }
        ]
      }'
    ```
  </Tab>
</Tabs>

***

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

***

## Next Steps

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

<Card title="SDK" href="/api-reference/sdk" />

You'll find more information in the relevant sections:

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