Overview
Integrate Valyu’s deep search capabilities directly into your OpenAI applications using our provider system with OpenAI’s Responses API. This enables your AI agents to access real-time information from academic papers, news, financial data, and authoritative sources.Installation
Install the Valyu and OpenAI packages:Free Credits
Get your API key with $10 credit from the Valyu Platform.
Basic Usage
The OpenAI provider handles the integration with the Responses API:How It Works
TheOpenAIProvider handles everything for you:
- Tool Registration: Automatically formats Valyu search for OpenAI Responses API
- Tool Execution: Manages search API calls behind the scenes
- Conversation Flow: Builds proper message sequences with tool results
responses.create()), not Chat Completions!
Research Agent Example
Create a simple research agent that can access current information:Financial Analysis Example
Configuration Options
Model Selection
You can use any OpenAI model with the Responses API:Search Parameters
The AI model can automatically use advanced search parameters based on your query context:- max_num_results: Limit results (1-20 for standard API keys, up to 100 with a special API key)
- included_sources: Search specific domains or datasets
- excluded_sources: Exclude certain sources
- category: Guide search to specific topics
- start_date/end_date: Time-bounded searches
- relevance_threshold: Filter by relevance (0-1)
Best Practices
1. Use Clear System Prompts
2. Handle Errors Gracefully
3. Multi-Turn Conversations
For chat applications, maintain conversation history:API Reference
OpenAIProvider
Additional Resources
OpenAI Responses API
Official OpenAI Responses API documentation
Valyu API Reference
Complete Valyu API documentation
Python SDK
Full Python SDK documentation
Get API Key
Sign up for free $10 credit

