Installation
Install Troubleshooting
pip install fails or wrong package
pip install fails or wrong package
Ensure you install the official OpenAI package:
pip install openai. Avoid similarly named packages like openai-api or openai-python. Use pip show openai to verify.SSL / certificate errors
SSL / certificate errors
If you’re behind a corporate proxy, set
REQUESTS_CA_BUNDLE or SSL_CERT_FILE. For local development, you can use OPENAI_BASE_URL to point at a proxy.Version conflicts
Version conflicts
Pin a known-good version:
pip install openai>=1.0.0,<2. Check PyPI for the latest.Using a virtual environment
Using a virtual environment
Recommended:
python -m venv venv then source venv/bin/activate (or venv\Scripts\activate on Windows) before pip install openai.Migrating from OpenAI
If you’re switching from OpenAI to Mavera, change only these:- Base URL —
base_url="https://app.mavera.io/api/v1" - API key — Use your Mavera key (starts with
mvra_live_) - Model — Use
mavera-1 - Persona — Add
extra_body={"persona_id": "..."}to everyresponses.create()call
Configuration
Responses API
Basic Usage
Streaming
With Analysis Mode
REST API Endpoints
For non-Chat endpoints, userequests or httpx:
Async Support
Error Handling
Type Hints
The OpenAI SDK includes full type hints:Full Example Script
A complete script you can run from the command line — lists personas, picks one, sends a chat, and prints the response:MAVERA_API_KEY=mvra_live_xxx python mavera_chat.py "How do you feel about subscription pricing?"
Quickstart: Chat
First chat in 5 minutes
Migrate OpenAI → Mavera
Switching from OpenAI
Responses API
Full feature reference
API Reference
Responses API spec