Documentation Index
Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
Use this file to discover all available pages before exploring further.
When to Use This
You’re already using the OpenAI Python or JavaScript SDK and want to switch to Mavera with:- Minimal code changes (often 2–3 lines)
- Preserved behavior for input, streaming, tools, and structured outputs
- New capabilities (personas, analysis mode) injected via extra parameters
persona_id, and optionally use Mavera-specific fields like analysis_mode.
What Stays the Same
| Feature | OpenAI | Mavera | Notes |
|---|---|---|---|
| Input format | input: [{role, content}] | Same | No change |
| Streaming | client.responses.stream() | Same | SSE, same event types |
| Model parameter | model="gpt-4" | model="mavera-1" | Use mavera-1 |
| Tools / function calling | tools, tool_choice | Same | No change |
| Structured outputs | text.format | Same | json_object, json_schema |
| Temperature, max_tokens | Same | Same | No change |
| Instructions parameter | Same | Same | No change |
What Changes
| Item | Change |
|---|---|
| Base URL | https://app.mavera.io/api/v1 |
| API key | Mavera key (starts with mvra_live_) |
| Model | mavera-1 |
| Persona | Add persona_id (required for best results) |
| Optional fields | analysis_mode, reasoning_effort, etc. (see Responses API) |
Step-by-Step Migration
1. Get a Mavera API Key
Create an API key at app.mavera.io/settings/developer. Keys start withmvra_live_.
2. Get a Persona ID
Every Mavera request should include apersona_id for audience-aware responses. List personas and pick one:
3. Update Environment Variables
4. Change Client Configuration
5. Add persona_id to Requests
Mavera-Specific Fields Reference
| Field | Type | Description | Python | JavaScript |
|---|---|---|---|---|
persona_id | string | Required for best results. Persona to use | extra_body={"persona_id": "..."} | persona_id: "..." |
analysis_mode | boolean | Return structured analysis (confidence, biases, etc.) | extra_body={"analysis_mode": True} | analysis_mode: true |
reasoning_effort | string | "low", "medium", "high" | extra_body={"reasoning_effort": "high"} | reasoning_effort: "high" |
verbosity | string | Response length preference | extra_body={"verbosity": "medium"} | verbosity: "medium" |
Non-Chat Endpoints: Use REST
Mavera has non-OpenAI endpoints (Mave Agent, Focus Groups, Video Analysis, etc.) that don’t use the OpenAI SDK. Call them directly withfetch, requests, or httpx.
Migration Checklist
Pre-migration
Pre-migration
- Create Mavera account and API key
- List personas and pick a default
persona_id - Note your current model usage (e.g. gpt-4) — Mavera uses
mavera-1
Code changes
Code changes
- Set
base_url/baseURLtohttps://app.mavera.io/api/v1 - Set
api_key/apiKeyto Mavera key - Replace model name with
mavera-1 - Add
persona_idto all response calls (Python:extra_body, JS: direct)
Environment & config
Environment & config
- Add
MAVERA_API_KEYto env (or repointOPENAI_API_KEY) - Update any config files or secrets managers
Testing
Testing
- Run a simple response (no streaming)
- Run a streaming response
- Test tools/function calling if used
- Test structured outputs if used
- Verify
usage.credits_usedin responses
Production
Production
- Deploy behind feature flag or canary if possible
- Monitor Credits and Rate Limits
- Set up Error Handling for 401, 402, 429
Common Gotchas
Python: persona_id not applied
Python: persona_id not applied
You must pass
persona_id in extra_body, not as a top-level kwarg. client.responses.create(..., persona_id="x") will not work — use extra_body={"persona_id": "x"}.TypeScript: persona_id type errors
TypeScript: persona_id type errors
The OpenAI types don’t include
persona_id. Use as any or extend the types, or pass via a wrapper that adds Mavera fields before the SDK call.Credits vs tokens
Credits vs tokens
Mavera uses credits, not token-based pricing. Each response includes
usage.credits_used. See Credits.Different rate limits
Different rate limits
Mavera rate limits differ by tier. See Rate Limits. If you were batching heavily on OpenAI, you may need to throttle.
See Also
Quickstart: Chat
First Mavera request with persona
SDKs Overview
Python, JavaScript, Go, and REST usage
Responses API
Full feature set: streaming, tools, analysis mode
Persona Selection
How to choose the right persona