Provider slug:
openaiUsing the Obiguard Gateway
To integrate the Obiguard gateway with OpenAI,- Set the
baseURLto the Obiguard Gateway URL - Include Obiguard-specific headers such as
provider,obiguardApiKey, and others.
- Python SDK
- cURL
- OpenAI Python SDK
Install the Obiguard SDK with pip
Obiguard supports OpenAI’s new “developer” role in chat completions.
Starting with o1 models, the
developer role replaces the previous system role.Using the Responses API
OpenAI has introduced a new Responses API that merges the capabilities of Chat Completions and Assistants APIs. Obiguard provides full support for this API, allowing its use with both the Obiguard SDK and the OpenAI SDK.- Python SDK
- OpenAI Python SDK
The Responses API offers a more adaptable framework for creating agentic applications with integrated tools that
run automatically.
Remote MCP Support in Responses API
Learn how Obiguard enables Remote MCP support for OpenAI’s Responses API.
- The same integration approach applies to APIs for completions, embeddings, vision, moderation, transcription, translation, speech and files.
Realtime API
Obiguard seamlessly integrates with OpenAI’s Realtime API, enabling features like logging, cost tracking, and guardrails.Realtime API
Streaming Responses
Obiguard supports streaming responses through Server-Sent Events (SSE).- OpenAI Python SDK
Streaming with the Responses API
You can also stream responses from the Responses API:- Python SDK
- OpenAI Python SDK
Vision Models Support
Obiguard’s multimodal Gateway provides full compatibility with OpenAI vision models. Refer to this guide for additional details:Using Vision Models with the Responses API
The Responses API also enables processing images alongside text:- Python SDK
- OpenAI Python SDK
Function Calling
Function calls within your OpenAI or Obiguard SDK operations remain standard. These logs will appear in Obiguard, highlighting the utilized functions and their outputs. Additionally, you can define functions within your prompts and invoke theobiguard.prompts.completions.create method as above.
Function Calling with the Responses API
The Responses API also supports function calling with the same powerful capabilities:- Python SDK
- OpenAI Python SDK
Image Generation
Obiguard supports multiple modalities for OpenAI and you can make image generation requests through Obiguard’s AI Gateway the same way as making completion calls.- OpenAI Python SDK
Audio - Transcription, Translation, and Text-to-Speech
Obiguard’s multimodal Gateway also supports theaudio methods on OpenAI API. Check out the below guides for more info:
Check out the below guides for more info:
Integrated Tools with Responses API
Web Search Tool
Web search delivers accurate and clearly-cited answers from the web, using the same tool as search in ChatGPT:- Python SDK
Options for
search_context_size:high: Most comprehensive context, higher cost, slower responsemedium: Balanced context, cost, and latency (default)low: Minimal context, lowest cost, fastest response
File Search Tool
File search enables quick retrieval from your knowledge base across multiple file types:- Python SDK
This tool requires you to first create a vector store and upload files to it. Supports various file formats including
PDFs, DOCXs, TXT, and more. Results include file citations in the response.
Enhanced Reasoning
Control the depth of model reasoning for more comprehensive analysis:- Python SDK
Computer Use Assistant
Obiguard also supports the Computer Use Assistant (CUA) tool, which helps agents control computers or virtual machines through screenshots and actions. This feature is available for select developers as a research preview on premium tiers.Learn More about Computer use tool here
Managing OpenAI Projects & Organizations in Obiguard
When integrating OpenAI with Obiguard, you can specify your OpenAI organization and project IDs along with your API key. This is particularly useful if you belong to multiple organizations or are accessing projects through a legacy user API key. Specifying the organization and project IDs helps you maintain better control over your access rules, usage, and costs. In Obiguard, you can add your Org & Project details by,- Defining a guardrail policy
- Generating your virtual key for the guardrail policy
- Passing details in a request
Using Virtual Keys
When selecting OpenAI from the dropdown menu while creating a virtual key, Obiguard automatically displays optional fields for the organization ID and project ID alongside the API key field. Get your OpenAI API key from here, then add it to Obiguard to create the virtual key that can be used throughout Obiguard.While Making a Request
You can also pass your organization and project details directly when making a request using curl, the OpenAI SDK, or the Obiguard SDK.- OpenAI Python SDK
- cURL
- Obiguard Python SDK

