Quick Start Guide
Get started with OpenResponses API in minutes
Quick Start Guide
This guide will help you get up and running with OpenResponses API quickly. We’ll cover several deployment options and provide example API calls to get you started.
Setup Options
Basic Setup
Run OpenResponses with default configuration
Tool-enabled Setup
Run with built-in tools like web search and GitHub integration
Custom Tool Configuration
Configure your own custom tools
OpenAI Agent SDK Integration
Run examples with OpenAI Agent SDK
Persistent Storage
Configure with MongoDB for persistent storage
Observability Stack
Run with monitoring and observability capabilities
RAG Setup
Configure Retrieval-Augmented Generation with vector search
Basic Setup
Prerequisites
- Ensure port 8080 is available
- Docker daemon must be running on your local machine
Run with Docker
The simplest way to get started is using Docker:
Clone the Repository
If you prefer using Docker Compose or want to explore the codebase, begin by cloning the repository:
Run with Docker Compose
Example API Calls
Once OpenResponses is running, you can start making API calls. Here are some examples:
Get your OpenAI key here
Get your OpenAI key here
Get your Anthropic key here
Open your Groq key page to create a key if you haven’t done so already.
Tool-enabled Setup
OpenResponses comes with built-in tools that enhance the capabilities of your AI applications. The pre-packaged mcp-servers-config.json
file includes configurations for Brave Web Search and GitHub tools.
Prerequisites
Before using built-in tools, you’ll need:
- GitHub Personal Access Token - Generate here
- Brave Search API key - Get from Brave API Dashboard
Configuration
Create a .env
file with your API keys:
Run with Built-in Tools
Stop previously running docker-compose (if any) before running this command.
Example Tool-enabled API Calls
Custom Tool Configuration
If you want to add your own custom tools, you’ll need to create or modify the mcp-servers-config.json
file with your own tool definitions.
Update the .env File
Add or update the following property in your .env
file:
Run the Service with Custom MCP Configuration
Stop previously running docker-compose (if any) before running this command.
OpenAI Agent SDK Integration
You can run examples provided by the openai-agent-python SDK using your locally deployed open-responses API.
Running Example Scripts with OpenAI Agent SDK
- Start the service using:
Stop previously running docker-compose (if any) before running this command.
- Clone the forked repository:
-
Configure the SDK in your Python script:
- Define the environment variable
OPENAI_API_KEY
with your OpenAI API key - Define the environment variable
OPEN_RESPONSES_URL
to specify the URL for your local open-responses API - If not set, it will default to “http://localhost:8080/v1”
- Define the environment variable
-
Run the examples:
- Follow Get started instructions to install the SDK
- All examples should work as expected except for the research_bot example which uses OpenAI’s proprietary WebSearchTool
Running Agent Examples with Built-In Tools
Before running any example, ensure you are in the openai-agents-python folder.
- Run the service with MCP tools:
If you require SDK traces, ensure that you set the environment variable OPENAI_API_KEY. Otherwise, you may see a warning “OPENAI_API_KEY is not set, skipping trace export”. To disable tracing explicitly, add the statement:
-
Set up your environment variables:
GROQ_API_KEY
OPEN_RESPONSES_URL
CLAUDE_API_KEY
(for specific examples)
-
Run the example scripts:
You can review the example scripts under the open_responses examples repository.
Setup with Persistent Storage
For production environments, you can enable persistent storage with MongoDB:
Prerequisites
- Ensure port 8080 is available for the Open Responses service
- Ensure port 27017 is available for MongoDB
- Docker daemon must be running on your local machine
Run with MongoDB
This will launch both the MongoDB database and the Open Responses service configured to use MongoDB as its storage backend.
Testing Persistent Storage
To test that responses are being stored, make an API call with the store
parameter set to true
:
Sample Response
When you make a request to store a conversation, you’ll receive a response that includes a unique ID which can be used for continuing the conversation:
The response will include an id
that you can use to reference this conversation in future requests.
Following Up on a Stored Conversation
To continue a stored conversation, use the previous_response_id
from your earlier response:
For more details on response storage options and configuration, refer to the Response Store Configuration documentation.
Setup with Observability
OpenResponses can be run with a comprehensive observability stack that includes OpenTelemetry, Jaeger, Prometheus, and Grafana. This setup provides detailed monitoring, tracing, and metrics visualization capabilities.
For detailed instructions on setting up and running OpenResponses with the observability stack, please refer to our Running with Observability Stack guide.
Setup with RAG
RAG (Retrieval-Augmented Generation) enables you to enhance AI responses with information retrieved from your documents. OpenResponses provides a complete RAG solution with vector search capabilities powered by Qdrant.
Prerequisites
- Ensure ports 8080 (Open Responses), 6333 (Qdrant REST API), and 6334 (Qdrant gRPC API) are available
- Docker daemon must be running on your local machine
- OpenAI API key for embedding generation and AI responses (or another supported provider)
Option 1: Basic RAG Setup with Qdrant
This setup includes just the vector database for document storage and retrieval:
Option 2: Complete RAG Setup with MongoDB Storage
For production environments, this setup combines vector search with persistent storage:
Using the RAG System
Upload a File
First, upload a file to be processed and stored:
You’ll receive a file_id in the response.
Create a Vector Store
Create a vector store to hold your document embeddings:
This returns a vector_store_id.
Add File to Vector Store
Add your uploaded file to the vector store:
Search the Vector Store
You can directly search for content in your vector store:
Ask Questions Using RAG
Use the file_search tool to answer questions based on your documents:
If no x-model-provider header is specified, GROQ is used as the default provider.
Using RAG with Different AI Models
Groq is the default provider if no x-model-provider header is specified.
Best Practices for RAG
- Break large documents into logical sections before uploading
- Use custom attributes to organize and filter your documents
- Set a reasonable chunk size (800-1200 tokens) with some overlap
- Provide clear and specific queries to get better results
- Use filters to narrow down search results when you have many documents
For more details on using the RAG system, refer to the RAG Documentation.
Next Steps
- Explore OpenAI Compatibility for detailed API compatibility information
- Learn about Tool Integrations for extending functionality
- Configure Observability for production monitoring