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

```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>"
```

> [!WARNING]
>
> Keep your API key on your machine or your server. Do not ship it in browser or mobile app code.

## Use a Coding Agent

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

> [tab] 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](https://docs.muna.ai/inference/integrations/claude-code.md) for details.

> [tab] 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](https://docs.muna.ai/inference/integrations/opencode.md) for details.

> [tab] 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](https://docs.muna.ai/inference/integrations/pi.md) for details.

> [tab] 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](https://docs.muna.ai/inference/integrations/hermes.md) for details.

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:

```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." }]
  }'
```

## Next Steps

> [card] [Models](https://docs.muna.ai/inference/models.md)
>
> Every live model, with input, cached input, and output prices.

> [card] [OpenAI API](https://docs.muna.ai/ref/openai/create-chat-completion.md)
>
> Chat completions, streaming, embeddings, and what is supported.

> [card] [Anthropic API](https://docs.muna.ai/ref/anthropic/create-message.md)
>
> The Messages API for Claude-compatible tools and SDKs.


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