OCI Responses API
OCI Responses API is the OCI-native API for agentic workflows.
Installation
Python
Install the OCI GenAI Auth Python package:
pip install oci-genai-authSee OCI GenAI Auth package on GitHub.
Java
About the OCI Responses API
The OCI Responses API lets you compose modular primitives to support agentic workloads. You can configure these capabilities at the request level:
- Orchestration to perform single-step inference or multi-step agentic workflows
- Reasoning to enable or disable reasoning
- Tools to use platform-managed tools, client-side function tools, or both
- Conversation state to manage state on the service side or in your client application
This approach provides:
- Flexibility to build simple assistants or more complex multi-step agents by using the same API
- Precision to control cost, latency, and behavior
- Simplicity because you do not need to create and manage tools as separate cloud resources
Base URL
Use the OCI Responses API at the following base URL:
https://inference.generativeai.<available-region>.oci.oraclecloud.com/openai/v1Replace <available-region> with a region identifier such as generativeai.us-chicago-1.
For available regions, see Agentic API Available Regions.
Supported SDKs and frameworks
You can use the OCI Responses API with the OpenAI SDK. You can also use it with compatible client-side agent frameworks.
The OpenAI SDK supports these languages:
- Python
- Java
- TypeScript
- Go
- .NET
More language support is available through community libraries.
Compatible agent frameworks include:
- OpenAI Agents SDK (recommended)
- OpenAI Codex SDK
- Microsoft Agent Framework
- LangChain
- LangGraph
- CrewAI
- AutoGen
- LlamaIndex
- Pydantic
Compare the OCI Responses API and Chat Completions
| Dimension | OCI Responses API | OCI Chat API using Chat Completions API |
|---|---|---|
| Primary use | Unified API for model interaction and agentic capabilities | API for model interaction |
| Best fit | Interactive chat, agentic workloads, and long-running tasks | Interactive chatbots and text completion |
| Orchestration | Built-in multi-step reasoning and multiple tool calls | Single-step inference or generation; multi-step flows require external orchestration |
| Context management | Stateful by default, with optional stateless usage | Stateless only; the client manages conversation history |
| Tool support | Built-in tools such as File Search, Code Interpreter, and remote MCP | Limited to client-side tools through function calling |
| Multimodal support | Native support for text, images, files, and structured content blocks | Primarily text, with limited multimodal support depending on the model version |
| Streaming | Event-based streaming with fine-grained events | Token-based streaming |
| Structured output | Native structured outputs and JSON schema enforcement | JSON mode is supported, but is less composable |
| File and vector integration | Direct integration with Files API and Vector Stores API | Requires separate orchestration |
| Extensibility | Designed for hosted agents, MCP tools, memory, and containers | Designed primarily for chat applications |
Compare the OCI Responses API and OpenAI Responses API
| Capability | OCI Responses API | OpenAI Responses API |
|---|---|---|
| Model choice | Supports OCI-hosted models and non-OpenAI models | OpenAI models only |
| Model serving infrastructure | OCI shared infrastructure or dedicated AI clusters | OpenAI shared infrastructure |
| Authentication | OCI IAM or API keys | API keys |
| Data retention | Your data remains in OCI | Your data is stored in OpenAI |
| Private networking | Supports OCI VCN integration and private endpoints | Not available |
| Endpoint model | Regional endpoints | Global endpoint |
Recommendations
Use the OpenAI SDK when:
- You do not need a client-side framework to orchestrate function tools
- Your tools run on the server side, including remote MCP tools
- You use the Conversations API to manage session memory
- Your application is a simpler interface, such as a mobile app or static site, without a complex backend
Use an agent framework with the OpenAI SDK when:
- You need to orchestrate client-side function tools
- You need client-side execution capabilities such as local shell or file system access
- You need to coordinate multiple agents on the client side
- You manage session memory by using your own solution or a third-party system