OCI OpenAI Integration

The OCI OpenAI package is a Python library developed and maintained by the OCI Generative AI team. This package streamlines integration between the OpenAI Python SDK and the OCI Generative AI service. With built-in authentication and authorization, you can securely connect to the Generative AI service using OCI credentials.

Key Benefits

  • This package simplifies integration between OpenAI Python SDK and the OCI Generative AI service by creating an OCI authentication layer on top of the OpenAI SDK, so you can use OCI authentication with OpenAI SDKs.
  • Works with a subset of OpenAI SDKs, so developers who are familiar with the OpenAI API can connect to OCI Generative AI models faster and with less on-boarding tasks.

Supported OpenAI SDKs

The OCI OpenAI package supports the OpenAI Python SDKs for the following APIs:

Important

The OCI OpenAI package adds its own authentication layer on top of the OpenAI SDK. Only the preceding listed SDKs are compatible with this package. Using other OpenAI SDKs results in errors (for example, a 404). Be sure to review OCI OpenAI on GitHub for working examples.

Supported Models

The OCI OpenAI package supports only the following models hosted on OCI Generative AI. For each model, check whether it’s offered in on-demand or dedicated mode. For supported regions for each model, see Supported Regions.

Models for Chat Completions API
Model for Responses API
Important

External Calls

The xAI Grok models are hosted in an OCI data center, in a tenancy provisioned for xAI. The xAI Grok models, which can be accessed through the OCI Generative AI service, are managed by xAI.

Supported Regions

OCI OpenAI Regions

Supported OCI regions for the OCI OpenAI package are limited to:

  • Germany Central (Frankfurt)
  • India South (Hyderabad)
  • Japan Central (Osaka)
  • US East (Ashburn)
  • US Midwest (Chicago)
  • US West (Phoenix)

To confirm a model’s usable regions for the OCI OpenAI package perform the following tasks.

  1. Open the model’s card in the Generative AI documentation:
  2. Note the regions listed for that model.
  3. Select a region for the model that appears in both the model’s available regions AND the preceding six OCI OpenAI regions.
  4. Verify whether the model is available in the mode that you need (on-demand or dedicated).

    For access to models in the dedicated mode, both public and private endpoints are supported.