---
title: "Configure Grok Build"
description: "Define a model profile, choose credentials and an API backend, then switch Grok Build onto a new connection."
version: "en"
---

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

# Configure Grok Build

Grok Build operates with one current model profile: its live configuration
points to one active connection. Its default directory is `~/.grok`, and OcHub
can also manage its MCP servers. Start from the official xAI preset, fill the
form manually, or choose a configured model provider.

1. **Define the profile.** It is the client configuration name used by
   `[models].default`.

2. **Enter the upstream model.** This is the model ID sent to the provider; the
   display name is only for readability.

3. **Enter the Base URL.** Use the base address for the selected protocol.

4. **Choose credentials.** API Key writes the secret to configuration.
   Environment variable stores only a name such as `XAI_API_KEY`, which must
   exist in Grok Build's runtime environment.

5. **Choose an API backend.** Select OpenAI Responses, OpenAI Chat Completions,
   or Anthropic Messages to match the upstream.

6. **Set the context window.** Use the actual token limit supported by the
   upstream model.

7. **Review `config.toml` and switch.** Restart Grok Build and make a real
   request.

If environment-variable mode works in an OcHub check but not in Grok Build, the
two processes probably inherited different environments. Launch from the same
terminal or define the variable in the environment Grok Build actually reads.

## One-click model provider

At the top of the connection editor, change the source from **Direct connection**
to **Model provider**. After you pick a configured model provider, OcHub fills in
the local gateway address, issues a key, and pins the API backend to OpenAI
Responses. You only set the profile name, upstream model, and display name.
Dialect conversion happens in the gateway, so a Chat Completions-only upstream
does not need to be written as a Grok Build direct connection.

You can also apply the same model provider to Grok Build from the **Model
providers** page after saving it.

After saving, follow the [verification checklist](/guides/providers#verify-a-new-connection)
to confirm the switch. For effective configuration, custom backends,
permissions, sandboxing, and compatibility imports, see
[Advanced Grok Build pitfalls](/grok-build/advanced).

Source: https://docs.ochub.org/grok-build/configure/index.mdx
