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.
Installation and Examples
Install the OCI OpenAI Python package with the following command:
pip install oci-openaiFor instructions and examples, see the following resources:
Supported OpenAI SDKs
The OCI OpenAI package supports the OpenAI Python SDKs for the following APIs:
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
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.