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

# OpenClaw Setup

> Use OpenClaw with Kyma API — active open models, auto-failover, 2-minute setup.

## Quick Setup

<Steps>
  <Step title="Get your API key">
    Sign up at [kymaapi.com/signup](https://kymaapi.com/signup). You'll get your API key instantly + \$0.50 free credits.
  </Step>

  <Step title="Configure OpenClaw">
    Edit `~/.openclaw/openclaw.json`:

    ```json theme={null}
    {
      "models": {
        "providers": {
          "kyma": {
            "baseUrl": "https://kymaapi.com/v1",
            "apiKey": "ky-YOUR_API_KEY_HERE",
            "api": "openai-completions",
            "models": [
              { "id": "gemma-4-31b", "name": "Gemma 4 31B" },
              { "id": "deepseek-v3", "name": "DeepSeek V3" },
              { "id": "qwen-3.6-plus", "name": "Qwen 3.6 Plus" },
              { "id": "kimi-k2.6", "name": "Kimi K2.5" },
              { "id": "qwen-3-32b", "name": "Qwen 3 32B" }
            ]
          }
        }
      },
      "agents": {
        "defaults": {
          "model": {
            "primary": "kyma/gemma-4-31b"
          }
        }
      }
    }
    ```

    Replace `ky-YOUR_API_KEY_HERE` with your actual key.

    <Note>
      Use `127.0.0.1` instead of `localhost` if you experience IPv6 connection issues.
    </Note>
  </Step>

  <Step title="Start coding">
    ```bash theme={null}
    openclaw
    ```

    That's it. OpenClaw will use Gemma 4 31B by default. Switch models anytime by changing the `primary` field.
  </Step>
</Steps>

## Recommended Models for OpenClaw

| Model                | Alias   | Best For                                               | Context |
| -------------------- | ------- | ------------------------------------------------------ | ------- |
| **Kimi K2.5**        | `agent` | **Recommended** — best tool calling, agentic workflows | 262K    |
| **Qwen 3.6 Plus**    | `best`  | Highest quality overall                                | 131K    |
| **MiniMax M2.5**     | —       | SWE-bench 80.2%, top coding                            | 196K    |
| **Qwen 3 Coder**     | `code`  | Purpose-built for code                                 | 131K    |
| **Gemini 2.5 Flash** | `cheap` | Lowest-cost active alias, 1M context                   | 1M      |

<Tip>
  Use [model aliases](/guides/model-aliases) like `code` or `best` — they auto-update when better models become available.
</Tip>

```bash theme={null}
# Get personalized recommendation
curl "https://kymaapi.com/v1/models/recommend?agent=openclaw"
```

### Choosing a model

* **Agentic coding**: Use `agent` (Kimi K2.5) for autonomous tool use
* **Code generation**: Use `code` (Qwen 3 Coder) for code-focused tasks
* **Quality**: Use `best` (Qwen 3.6 Plus) for complex reasoning
* **Budget / long context**: Use `cheap` (Gemini 2.5 Flash)

## Switch Models

Change the default model in your config:

```json theme={null}
"primary": "kyma/code"
```

Or add multiple models and switch between them in OpenClaw.

## Auto-Failover

Kyma automatically handles provider failures:

* If the primary infrastructure for your model is down, Kyma retries on backup infrastructure
* Most failures are invisible — you get a response without noticing
* Check `X-Kyma-Fallback` response header to know if a fallback was used

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection refused / ECONNREFUSED">
    Make sure you're using `https://kymaapi.com/v1` (not localhost). Kyma is a cloud API — no local setup needed.
  </Accordion>

  <Accordion title="Model not found">
    Check the model ID is correct. Use `GET https://kymaapi.com/v1/models` to see all available models.
  </Accordion>

  <Accordion title="Insufficient credits">
    Your free $0.50 credits may have been used up. Add more credits at [kymaapi.com/dashboard/credits](https://kymaapi.com/dashboard/credits). Packages start at $5.
  </Accordion>

  <Accordion title="Slow responses">
    Try a faster model like `qwen-3-32b`. Larger models (DeepSeek V3, Qwen 3.6 Plus) take longer but produce higher quality output.
  </Accordion>
</AccordionGroup>

## Audio Models (optional)

OpenClaw runs as your primary agent, but if you build voice-enabled tooling on the side (call summaries, transcript pipelines, voice notes), Kyma's audio aliases drop in like any chat model:

* `transcribe` → `whisper-v3-turbo` — 228× realtime speech-to-text
* `audio-understand` → `gemini-3-flash-audio` — scene/tone/music recognition

Use them via `POST /v1/audio/transcriptions` and `POST /v1/audio/understand`. The full audio surface (TTS, music, SFX, voice clone/design) is documented in the [Audio API reference](/api-reference/audio-speech) and [Model Aliases](/guides/model-aliases#audio-aliases).

## Prompt Caching

Prompt caching is automatic. Your system prompt and tool definitions are cached for 5 minutes, reducing costs by up to 90% on subsequent requests. No code changes needed. See [Prompt Caching](/guides/prompt-caching) for details.
