> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moda.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get up and running with Moda in under 5 minutes

## Prerequisites

Before you start, you need:

* **A Moda API key**, get one from the [Moda dashboard](https://app.moda.dev)
* **An API key from your LLM provider**, [OpenAI](https://platform.openai.com/api-keys) or [Anthropic](https://console.anthropic.com/settings/keys)
* **Python 3.9+** or **Node.js 18+**

## Step 1: Install the SDK

Install the Moda SDK along with your LLM provider's client library:

<CodeGroup>
  ```bash Python (OpenAI) theme={"dark"}
  pip install moda-ai openai
  ```

  ```bash Python (Anthropic) theme={"dark"}
  pip install moda-ai anthropic
  ```

  ```bash Node.js (OpenAI) theme={"dark"}
  npm install moda-ai openai
  ```

  ```bash Node.js (Anthropic) theme={"dark"}
  npm install moda-ai @anthropic-ai/sdk
  ```
</CodeGroup>

## Step 2: Make your first request

Replace `YOUR_MODA_API_KEY` and your provider API key with your actual keys.

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

  # Initialize Moda once at startup
  moda.init("YOUR_MODA_API_KEY")

  # Use OpenAI as normal. Moda captures the call automatically
  client = OpenAI(api_key="YOUR_OPENAI_KEY")
  response = client.chat.completions.create(
      model="gpt-4o",
      messages=[{"role": "user", "content": "Hello, how are you?"}]
  )

  print(response.choices[0].message.content)

  # Flush before your process exits to ensure all data is sent
  moda.flush()
  ```

  ```javascript Node.js theme={"dark"}
  import { Moda } from 'moda-ai';
  import OpenAI from 'openai';

  // Initialize Moda once at startup
  Moda.init('YOUR_MODA_API_KEY');

  // Use OpenAI as normal. Moda captures the call automatically
  const client = new OpenAI({ apiKey: 'YOUR_OPENAI_KEY' });
  const response = await client.chat.completions.create({
    model: 'gpt-4o',
    messages: [{ role: 'user', content: 'Hello, how are you?' }],
  });

  console.log(response.choices[0].message.content);

  // Flush before your process exits to ensure all data is sent
  await Moda.flush();
  ```
</CodeGroup>

You should see the model's response printed in your terminal. Behind the scenes, Moda has captured the full request and response.

## Step 3: Sync your first prompt

Prompt management is code-first. Keep prompts in files, sync versions with the CLI, and render them through the SDK so runtime calls are attributed to the exact prompt version.

```bash theme={"dark"}
moda init
moda prompts status
moda prompts sync
```

Node.js:

```typescript theme={"dark"}
const rendered = Moda.prompt("support.triage").render({
  ticket: { text: userMessage },
});

await client.chat.completions.create({
  model: "gpt-4o",
  messages: rendered.messages,
});
```

Python:

```python theme={"dark"}
rendered = moda.prompt("support.triage").render({
    "ticket": {"text": user_message},
})

client.chat.completions.create(
    model="gpt-4o",
    messages=rendered["messages"],
)
```

See [Prompt Management](/prompt-management/overview) for the full workflow.

## Step 4: Try a different provider

Moda works the same way with Anthropic. Initialize Moda, use the provider client as normal, and Moda captures everything automatically.

<CodeGroup>
  ```python Python theme={"dark"}
  import moda
  from anthropic import Anthropic

  moda.init("YOUR_MODA_API_KEY")

  client = Anthropic(api_key="YOUR_ANTHROPIC_KEY")
  response = client.messages.create(
      model="claude-sonnet-4-20250514",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello, how are you?"}]
  )

  print(response.content[0].text)

  moda.flush()
  ```

  ```javascript Node.js theme={"dark"}
  import { Moda } from 'moda-ai';
  import Anthropic from '@anthropic-ai/sdk';

  Moda.init('YOUR_MODA_API_KEY');

  const client = new Anthropic({ apiKey: 'YOUR_ANTHROPIC_KEY' });
  const response = await client.messages.create({
    model: 'claude-sonnet-4-20250514',
    maxTokens: 1024,
    messages: [{ role: 'user', content: 'Hello, how are you?' }],
  });

  console.log(response.content[0].text);

  await Moda.flush();
  ```
</CodeGroup>

<Tip>
  For provider-specific features like streaming, tool use, and extended thinking, see the [Anthropic](/ingestion/providers/anthropic) and [OpenAI](/ingestion/providers/openai) guides.
</Tip>

## Step 5: View your conversations

After running the code above, open the [Moda dashboard](https://app.moda.dev) to see your conversations. Each LLM call is automatically logged with the full request, response, model, and token usage.

## Troubleshooting

| Problem                                       | Solution                                                                                                                 |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Data not appearing in the dashboard           | Make sure `moda.init()` is called **before** creating the LLM client, and call `moda.flush()` before your process exits. |
| `ModuleNotFoundError: No module named 'moda'` | Run `pip install moda-ai` (the package name is `moda-ai`, not `moda`).                                                   |
| `Cannot find module 'moda-ai'`                | Run `npm install moda-ai` in your project directory.                                                                     |

## What is next?

<Columns cols={2}>
  <Card title="Ingestion overview" icon="upload" href="/ingestion/overview">
    See all the ways to send data to Moda, including the Direct API.
  </Card>

  <Card title="Provider guides" icon="server" href="/ingestion/providers/openai">
    Detailed setup for OpenAI, Anthropic, Azure, Bedrock, and more.
  </Card>
</Columns>
