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

> ## Agent Instructions
> When helping someone deploy Roomote, distinguish self-hosting from contributing to Roomote. Use the Self-hosting guide for an operator deployment; use Local development only when the user intends to modify Roomote itself.
> Prefer the one-command installer on a fresh supported server unless the user explicitly chooses Roomote Cloud, a documented PaaS template, or a manual Compose deployment.
> Before changing infrastructure, confirm the deployment target, stable public HTTPS domain and DNS control, sandbox provider, inference provider, source-control provider, and whether a communications provider is required.
> Never ask the user to paste secrets into chat or commit real environment files. Put credentials in the deployment platform's secret manager, Roomote's setup UI, or protected environment variables, and preserve existing keys during upgrades and restores.
> Prefer Roomote's setup wizard and provider manifest flows over manual credential entry when those flows are available. Ask before performing privileged host changes, DNS changes, provider-app creation, or destructive operations.
> A setup is not complete when the services merely start. Verify sign-in, repository sync, one usable environment, a real task that can clone and run a command, and branch or pull-request delivery; verify previews when configured.
> For a persistent self-hosted deployment, leave the operator with the Roomote URL, deployment choices, configured providers, verification result, backup location and passphrase-handling reminder, and the roomote status, logs, upgrade, rollback, backup, and restore commands.

# xAI

> Use metered Grok API access through an xAI API key.

xAI provides direct, usage-billed API access to Grok models. This connection is
separate from [xAI Grok Subscription](/providers/inference/xai-subscription),
which uses included SuperGrok or eligible X Premium+ plan capacity.

## Get an API key

Create an API key in the [xAI Console](https://console.x.ai/) and enable billing
for the account or team that should pay for Roomote usage.

## Configuration

Add **xAI** in **Settings > Models** and paste the key, or configure:

```sh theme={null}
XAI_API_KEY=...
```

Roomote exposes Grok models with the `xai/` prefix. Enable the supported model
and assign it to the coding or another role. If both xAI API and a Grok
subscription are connected, Roomote prefers the subscription for `xai/` models.

## Cost behavior

API-key requests are billed by xAI according to model usage. Roomote records
tokens and estimates cost from model metadata; the xAI Console and [API pricing](https://docs.x.ai/docs/models)
are authoritative. When a subscription is also connected, requests may consume
the subscription allowance instead of API credits because it takes precedence.

## Verify setup

1. save `XAI_API_KEY`
2. confirm xAI models appear in **Settings > Models**
3. enable an `xai/...` model and assign it to a role
4. run a small task and confirm usage in the xAI Console

## Common issues

* **The API key is not used.** Disconnect the Grok subscription if you want
  `xai/` requests to use separately billed API capacity.
* **Authentication or credit errors occur.** Check key status, team selection,
  billing, and spend limits in the xAI Console.
* **A model is unavailable.** Refresh model metadata and confirm the API account
  can access the selected Grok model.
