> ## 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.

# SDKs Overview

> Use any OpenAI-compatible SDK with Mavera

## OpenAI SDK Compatibility

Mavera's Responses API is fully compatible with OpenAI SDKs. This means you can use the official OpenAI libraries in any language — just change the base URL and use `client.responses.create()`.

<CardGroup cols={2}>
  <Card title="Python" icon="python" href="/sdks/python">
    Official OpenAI Python SDK
  </Card>

  <Card title="JavaScript/TypeScript" icon="js" href="/sdks/javascript">
    Official OpenAI Node.js SDK
  </Card>

  <Card title="Go" icon="code" href="/sdks/go">
    go-openai or REST
  </Card>
</CardGroup>

## Quick Setup

<CodeGroup>
  ```python Python theme={"dark"}
  from openai import OpenAI

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

  ```javascript JavaScript theme={"dark"}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "mvra_live_your_key_here",
    baseURL: "https://app.mavera.io/api/v1",
  });
  ```

  ```go Go theme={"dark"}
  import "github.com/sashabaranov/go-openai"

  config := openai.DefaultConfig("mvra_live_your_key_here")
  config.BaseURL = "https://app.mavera.io/api/v1"
  client := openai.NewClientWithConfig(config)
  ```

  ```bash cURL theme={"dark"}
  curl -X POST https://app.mavera.io/api/v1/responses \
    -H "Authorization: Bearer mvra_live_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"model": "mavera-1", "persona_id": "YOUR_PERSONA_ID", "input": "..."}'
  ```
</CodeGroup>

## Mavera-Specific Fields

While the base API is OpenAI-compatible, Mavera adds specific fields:

| Field              | Description                | How to Pass                                                    |
| ------------------ | -------------------------- | -------------------------------------------------------------- |
| `persona_id`       | ID of persona to use       | Python: `extra_body` in `responses.create()`, JS: direct field |
| `analysis_mode`    | Enable structured analysis | Python: `extra_body` in `responses.create()`, JS: direct field |
| `reasoning_effort` | Control reasoning depth    | Python: `extra_body` in `responses.create()`, JS: direct field |

## Example with Mavera Fields

<CodeGroup>
  ```python Python theme={"dark"}
  response = client.responses.create(
      model="mavera-1",
      input="Hello",
      extra_body={
          "persona_id": "YOUR_PERSONA_ID",
          "analysis_mode": True,
      },
  )
  ```

  ```javascript JavaScript theme={"dark"}
  const response = await client.responses.create({
    model: "mavera-1",
    input: "Hello",
    // @ts-ignore - Mavera custom field
    persona_id: "YOUR_PERSONA_ID",
    analysis_mode: true,
  });
  ```
</CodeGroup>

## REST API

For non-Chat endpoints (Mave, Focus Groups, etc.), use REST directly:

```python theme={"dark"}
import requests

headers = {"Authorization": "Bearer mvra_live_your_key_here"}

# Mave Agent
response = requests.post(
    "https://app.mavera.io/api/v1/mave/chat",
    headers=headers,
    json={"message": "Analyze market trends"}
)

# Focus Groups
response = requests.post(
    "https://app.mavera.io/api/v1/focus-groups",
    headers=headers,
    json={...}
)
```

## Language Support

| Language   | SDK           | Notes                         |
| ---------- | ------------- | ----------------------------- |
| Python     | `openai`      | Full support via `extra_body` |
| JavaScript | `openai`      | Full support                  |
| TypeScript | `openai`      | Full support with types       |
| Go         | `go-openai`   | Requires custom fields        |
| Ruby       | `ruby-openai` | Requires custom fields        |
| PHP        | `openai-php`  | Requires custom fields        |
| Any        | REST          | Full control                  |

<Info>
  For languages without first-class Mavera support, you can always use the REST API directly.
</Info>
