# LLM Config

### LLM provider configuration, key management, and x402 micropayment routing via ClawRouter.

## LLM & Payments

Molt.id Multiclaw Service supports multiple LLM providers with a priority-based key resolution system. Users can bring their own API keys, use platform-provided global keys, or pay per request via x402 micropayments through ClawRouter.

{% hint style="info" %}
Platform-provided global LLM keys are **rate-limited** and shared across all users. Please expect occasional downtime or slow responses during high usage. We will introduce a daily credits system soon. For the best experience, **Bring Your Own Key (BYOK)** is strongly recommended as your primary option
{% endhint %}

***

### Supported Providers

| Provider       | Models                            |
| -------------- | --------------------------------- |
| **Anthropic**  | Claude Sonnet, Haiku, Opus        |
| **OpenAI**     | GPT-4o, GPT-4o-mini               |
| **OpenRouter** | 100+ models via OpenRouter proxy  |
| **ClawRouter** | 30+ models via x402 micropayments |

***

### Key Priority

Keys are resolved in this order for each user:

```
User's own key
  → Platform global key
  → Not available
```

This means:

* **Global keys** set by the platform work for all users by default
* **Per-user keys** override global keys when set
* Users who bring their own API keys get billed directly by the provider

***

### Default Model Selection

When a container starts, the default model is automatically selected based on which providers have keys available:

```
ClawRouter available? → blockrun/auto (cheapest, smart routing)
  → OpenRouter available? → openrouter/anthropic/claude-sonnet-4-5
  → Anthropic available? → anthropic/claude-sonnet-4-5
  → OpenAI available? → openai/gpt-4o
```

***

### Key Security

* Keys are **never exposed** to users through any endpoint
* API responses show only the first 8 characters (redacted)
* Inside containers, keys are stored in isolated files with restricted permissions
* Sensitive files are **excluded from snapshots** — always written fresh on startup

***

### ClawRouter (x402 Micropayments)

ClawRouter is an x402 micropayment-based LLM proxy that runs inside each container. It lets users access 30+ LLM models without needing individual API keys — costs are paid from a Solana wallet via HTTP 402 micropayments.

#### How It Works

```
OpenClaw → ClawRouter (local proxy) → x402 payment → LLM Provider
```

1. OpenClaw sends a standard OpenAI-compatible request to ClawRouter
2. ClawRouter routes the request to the cheapest available provider
3. The provider responds with HTTP 402 (Payment Required) + an x402 invoice
4. ClawRouter pays the invoice from the configured Solana wallet
5. Provider returns the LLM response
6. ClawRouter forwards it back to OpenClaw

#### Available Models

The `blockrun/auto` model uses smart routing to pick the cheapest model. Individual models are also available:

* `blockrun/anthropic/claude-sonnet-4`
* `blockrun/anthropic/claude-haiku-4.5`
* `blockrun/openai/gpt-4o`
* `blockrun/openai/gpt-4o-mini`
* `blockrun/google/gemini-2.5-flash`
* `blockrun/deepseek/deepseek-chat`
* And 20+ more

#### Wallet Key Priority

The wallet key used for x402 payments follows the same priority as LLM keys:

```
Per-user wallet key → Platform global wallet key → Not available
```

The wallet key is written securely inside the container on startup and is **never** exposed to users or included in snapshots.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.molt.id/getting-started/openclaw-service/llm-config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
