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

# Quickstart

> Use open models in your coding agent or app, behind the OpenAI and Anthropic APIs.

Muna serves open models like Qwen 3.8 27B and Gemma 4 26B behind OpenAI- and Anthropic-compatible
APIs. If a tool lets you set a base URL and an API key, it works with Muna.

| API | Base URL |
| :- | :- |
| OpenAI | `https://inference.muna.ai/v1` |
| Anthropic | `https://inference.muna.ai` |

## Get an API Key

[Sign in](https://muna.ai/login) and create an API key, then set it in your terminal:

<CodeGroup>
  ```bash macOS / Linux theme={null}
  export MUNA_API_KEY="<your Muna API key>"
  ```

  ```powershell Windows theme={null}
  $env:MUNA_API_KEY = "<your Muna API key>"
  ```
</CodeGroup>

<Warning>
  Keep your API key on your machine or your server. Do not ship it in browser or mobile app code.
</Warning>

## Use a Coding Agent

Point your agent at Muna, then start it in your project directory:

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    export ANTHROPIC_BASE_URL="https://inference.muna.ai"
    export ANTHROPIC_AUTH_TOKEN="$MUNA_API_KEY"
    export ANTHROPIC_MODEL="@qwen/qwen-3.8-27b"
    export ANTHROPIC_DEFAULT_HAIKU_MODEL="@qwen/qwen-3.8-27b"

    claude
    ```

    See [Claude Code](/inference/integrations/claude-code) for details.
  </Tab>

  <Tab title="OpenCode">
    Add Muna as a provider in `opencode.json`:

    ```json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "muna": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Muna",
          "options": {
            "baseURL": "https://inference.muna.ai/v1",
            "apiKey": "{env:MUNA_API_KEY}"
          },
          "models": {
            "@qwen/qwen-3.8-27b": { "name": "Qwen 3.8 27B" }
          }
        }
      }
    }
    ```

    See [OpenCode](/inference/integrations/opencode) for details.
  </Tab>

  <Tab title="Pi">
    Add Muna to `~/.pi/agent/models.json`:

    ```json theme={null}
    {
      "providers": {
        "muna": {
          "baseUrl": "https://inference.muna.ai/v1",
          "api": "openai-completions",
          "apiKey": "$MUNA_API_KEY",
          "models": [{ "id": "@qwen/qwen-3.8-27b" }]
        }
      }
    }
    ```

    See [Pi](/inference/integrations/pi) for details.
  </Tab>

  <Tab title="Hermes">
    Set Muna as a custom endpoint in `~/.hermes/config.yaml`:

    ```yaml theme={null}
    model:
      default: "@qwen/qwen-3.8-27b"
      provider: custom
      base_url: https://inference.muna.ai/v1
      key_env: MUNA_API_KEY
    ```

    See [Hermes](/inference/integrations/hermes) for details.
  </Tab>
</Tabs>

Then try:

```text theme={null}
Explain how this repository is organized.
```

## Build an Application

Use the official OpenAI or Anthropic SDK. Only the base URL and the API key change:

<CodeGroup>
  ```py OpenAI (Python) theme={null}
  from openai import OpenAI
  import os

  client = OpenAI(
      base_url="https://inference.muna.ai/v1",
      api_key=os.environ["MUNA_API_KEY"]
  )

  completion = client.chat.completions.create(
      model="@qwen/qwen-3.8-27b",
      messages=[{ "role": "user", "content": "Say hello in one sentence." }]
  )
  print(completion.choices[0].message.content)
  ```

  ```ts OpenAI (TypeScript) theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://inference.muna.ai/v1",
    apiKey: process.env.MUNA_API_KEY
  });

  const completion = await client.chat.completions.create({
    model: "@qwen/qwen-3.8-27b",
    messages: [{ role: "user", content: "Say hello in one sentence." }]
  });
  console.log(completion.choices[0].message.content);
  ```

  ```py Anthropic (Python) theme={null}
  from anthropic import Anthropic
  import os

  client = Anthropic(
      base_url="https://inference.muna.ai",
      api_key=os.environ["MUNA_API_KEY"]
  )

  message = client.messages.create(
      model="@qwen/qwen-3.8-27b",
      max_tokens=1024,
      messages=[{ "role": "user", "content": "Say hello in one sentence." }]
  )
  print(message.content[0].text)
  ```

  ```bash curl theme={null}
  curl https://inference.muna.ai/v1/chat/completions \
    -H "Authorization: Bearer $MUNA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "@qwen/qwen-3.8-27b",
      "messages": [{ "role": "user", "content": "Say hello in one sentence." }]
    }'
  ```
</CodeGroup>

## Next Steps

<Columns cols={3}>
  <Card title="Models" icon="tags" href="/inference/models">
    Every live model, with input, cached input, and output prices.
  </Card>

  <Card title="OpenAI API" icon="code" href="/ref/openai/create-chat-completion">
    Chat completions, streaming, embeddings, and what is supported.
  </Card>

  <Card title="Anthropic API" icon="message" href="/ref/anthropic/create-message">
    The Messages API for Claude-compatible tools and SDKs.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.