Skip to main content

Installation

Minimum version: Python 3.8+. The OpenAI SDK works with Mavera’s Responses API via base URL override.

Install Troubleshooting

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.
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.
Pin a known-good version: pip install openai>=1.0.0,<2. Check PyPI for the latest.
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:
  1. Base URLbase_url="https://app.mavera.io/api/v1"
  2. API key — Use your Mavera key (starts with mvra_live_)
  3. Model — Use mavera-1
  4. Persona — Add extra_body={"persona_id": "..."} to every responses.create() call
Your existing streaming, tools, and structured outputs work with minor adjustments. See Migrate OpenAI to Mavera for the full guide.

Configuration

Store your API key in an environment variable: MAVERA_API_KEY

Responses API

Basic Usage

Streaming

With Analysis Mode

REST API Endpoints

For non-Chat endpoints, use requests 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:
Run: 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