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.
What You’ll Learn
In this quickstart you will:- Configure the Mavera Responses API using the same interface as the OpenAI SDK (base URL + API key).
- List personas to choose an audience perspective (e.g. Gen Z Consumer, B2B Decision Maker).
- Send a response request with a
persona_idandinput, and read the output and credit usage. - Optionally add
instructionsand try streaming for real-time output.
Time: About 5 minutes. Credits: A single response typically uses 1–5 credits depending on input length.
Prerequisites
Before you begin, ensure you have:A Mavera account with an active subscription. Sign up at app.mavera.io.
An API key from Developer Settings. Keys start with
mvra_live_.A way to run code or HTTP requests: Python 3.8+, Node.js 18+, or a terminal for cURL.
Step 1: Install the Client (Python or JavaScript)
The Mavera Responses API is compatible with the official OpenAI SDKs. You only need to point the client at Mavera’s base URL and use your Mavera API key.Python
JavaScript / Node.js
cURL
No installation beyond a terminal. Use the base URL and pass your API key in theAuthorization header.
Step 2: Create the Client and Set the Base URL
Configure the OpenAI client to use Mavera’s endpoint. The only Mavera-specific change is the base URL; the rest of the API matches OpenAI’s Responses API.Step 3: Get a Persona ID
Every response is improved by a persona: a predefined audience perspective (e.g. generational, professional, or industry) that shapes the tone and content of the output. You pass apersona_id in each request.
First, list available personas to find one that fits your use case:
id (e.g. clx1abc2d0001abcdef123456) to use in the next step. Listing personas does not consume credits.
Step 4: Send Your First Response
Send a user input with the chosenpersona_id. In Python you must pass Mavera-specific fields (like persona_id) via extra_body because they are not part of the standard OpenAI type definitions. In JavaScript, you can add persona_id directly to the request object.
usage.credits_used value (typically 1–5 for a short exchange).
Model: Use
mavera-1 for responses. Persona: If you omit persona_id, the API may reject the request or use a default depending on your account; always passing a valid persona_id is recommended.Step 5: Add Instructions (Optional)
You can use theinstructions parameter to set context or role instructions. The persona still drives the audience perspective; instructions drives role or task.
Step 6: Try Streaming (Optional)
For longer answers or a better UX, request a streaming response. Tokens are returned as they’re generated.Understanding the Response
A successful response includes:| Field | Description |
|---|---|
output[0].content[0].text | The assistant’s text reply. |
output[0].role | Always "assistant" for the reply. |
status | "completed" when the reply is complete. |
usage.input_tokens | Input tokens used. |
usage.output_tokens | Output tokens used. |
usage.credits_used | Mavera-specific. Credits consumed by this request (typically 1–5 for simple requests). |
Common Issues
401 Unauthorized or invalid_api_key
401 Unauthorized or invalid_api_key
Invalid or missing persona_id
Invalid or missing persona_id
Use an
id from GET /personas. Ensure the value is a string and that the persona exists in your account (e.g. not from another workspace).Python: persona_id or extra_body not working
Python: persona_id or extra_body not working
Use
extra_body={"persona_id": "..."} in responses.create(). The OpenAI Python SDK does not expose Mavera fields on the method signature, so they must go in extra_body.402 Payment Required / credits_exhausted
402 Payment Required / credits_exhausted
Your account has no credits left. Add credits or wait for the next billing cycle. See Credits and Error Handling.
Next Steps
Responses API
Streaming, analysis mode, structured outputs, tool calling, and images
Personas
Pre-built and custom personas, categories, and creation pipelines
Authentication
API key security, rotation, and environment variables
API Reference
Full request/response specification for the Responses API