Skip to main content

Prerequisites

Before you begin, you’ll need:
A Mavera account with an active subscription
An API key from your Developer Settings

Step 1: Get Your API Key

1

Go to Developer Settings

2

Create API Key

Click Create API Key and give it a descriptive name
3

Copy Your Key

Copy the key immediately — it won’t be shown again. Keys start with mvra_live_
Keep your API key secure. Never commit it to version control or expose it in client-side code.

Step 2: Get a Persona ID

Every chat request benefits from a persona. List available personas to find one that fits your use case:
curl https://app.mavera.io/api/v1/personas \
  -H "Authorization: Bearer mvra_live_your_key_here"
Example response:
{
  "data": [
    {
      "id": "clx1abc2d0001abcdef123456",
      "name": "Gen Z Consumer",
      "category": "Generational",
      "description": "Digital native, values authenticity and social responsibility..."
    },
    {
      "id": "clx2def3e0002ghijkl789012",
      "name": "B2B Decision Maker",
      "category": "Professional",
      "description": "Senior executive focused on ROI and strategic value..."
    }
  ]
}
Copy the id of a persona you want to use.

Step 3: Make Your First Request

Now use the persona in a chat completion:
from openai import OpenAI

client = OpenAI(
    api_key="mvra_live_your_key_here",
    base_url="https://app.mavera.io/api/v1",
)

response = client.chat.completions.create(
    model="mavera-1",
    messages=[
        {"role": "user", "content": "What matters most when choosing a laptop?"}
    ],
    extra_body={"persona_id": "clx1abc2d0001abcdef123456"},
)

print(response.choices[0].message.content)
print(f"Credits used: {response.usage.credits_used}")
The response includes usage.credits_used so you can track your consumption in real-time.

Step 4: Try Mave Agent (Optional)

For comprehensive research with multiple sources, use the Mave agent:
import requests

response = requests.post(
    "https://app.mavera.io/api/v1/mave/chat",
    headers={"Authorization": "Bearer mvra_live_your_key_here"},
    json={
        "message": "Analyze the competitive landscape for electric vehicles in Europe"
    }
)

result = response.json()
print(f"Thread ID: {result['thread_id']}")
print(f"Response: {result['content'][:500]}...")
print(f"Sources: {len(result['sources'])} references")
print(f"Credits used: {result['usage']['credits_used']}")
Mave conducts multi-phase research and returns comprehensive analysis with sources, thread ID for follow-up questions, and personas used.

Next Steps

SDK Compatibility

Mavera’s Chat API is compatible with OpenAI SDKs. Just change the base URL:
LanguageSDKBase URL Override
Pythonopenaibase_url="https://app.mavera.io/api/v1"
JavaScriptopenaibaseURL: "https://app.mavera.io/api/v1"
Gogo-openaiSet BaseURL in config
AnyRESTUse https://app.mavera.io/api/v1 directly
The persona_id field is Mavera-specific. In Python, pass it via extra_body. In JavaScript/TypeScript, add it directly to the request object.