agentc
GitHubagentc-sh/agentc
agentc
GitHubagentc-sh/agentc
›Introduction
Get started›Concepts in 5 minutes›Build your first agent›Add your first tool›Serve and connect
Concepts›Architecture overview›The manifest›The compilation pipeline›Archetypes›The graph›Tools and capabilities›Runtime libraries›Skills›Agents and prompts›Serving and protocols›Observability
Guides›Author a manifest›Write a tool›Give your agent a filesystem›Control network egress›Connect external tools via MCP›Connect agents via A2A›Use the bash tool›Control tool access with capabilities›Write templated prompts›Manage prompts with Langfuse›Pass context from the client›Configure a model provider›Connect a CopilotKit frontend›Deploy a standalone binary›Deploy with Docker and PostgreSQL›Instrument with OpenTelemetry›Extend code generation with blocks
Reference
Manifest
›build›locals›runtime›filesystem›network
providers
›Anthropic›OpenAI›Ollama›OpenRouter›xAI›Gemini›Hugging Face
›agent›graph›tool›skill›http_server
Runtime
›Observability

xAI

Configuration for the xAI model provider.

The xai sub-block configures the xAI cloud provider, which serves the Grok family of models.

Fields

FieldTypeRequiredruntime()Description
modelslistnonoAllowlist of models for this provider. Each entry is a plain string or a config object with name and params. When omitted, no allowlist is enforced.
configblocknoConnection configuration.
config.api_keystringnoyesxAI API key. Wrap in secret(runtime(...)) to keep it out of build artifacts.
paramsblocknoProvider-level inference parameter defaults. Applied to every request unless overridden at the model level.

The config block is optional. When omitted, the client reads credentials from the XAI_API_KEY environment variable.

params

The params block sets inference parameter defaults for all models under this provider. All fields are optional and support runtime().

FieldTyperuntime()Description
max_tokensintegeryesMaximum number of tokens to generate.
temperaturefloatyesSampling temperature.
top_pfloatyesNucleus sampling probability.
stop_sequenceslist of stringsyesSequences that stop generation.
frequency_penaltyfloatyesPenalty for token frequency.
presence_penaltyfloatyesPenalty for token presence.
seedintegeryesSeed for deterministic sampling.
provider_paramsobjectyesProvider-specific parameters passed directly to the API.
note

top_k is not part of the OpenAI-compatible wire format that xAI uses. Setting it has no effect and it will be ignored.

Known model identifiers

ModelIdentifier
Grok 4grok-4
Grok 3grok-3
Grok 3 Fastgrok-3-fast
Grok 3 Minigrok-3-mini
Grok 3 Mini Fastgrok-3-mini-fast

Example

agent.acl
providers {
  xai {
    models = [
      "grok-3-mini",
      {
        name = "grok-4"
        params {
          max_tokens  = 16384
          temperature = 0.6
        }
      }
    ]

    config {
      api_key = secret(runtime("XAI_API_KEY"))
    }

    params {
      max_tokens  = 4096
      temperature = 0.5
    }
  }
}

agent "assistant" {
  graph {
    type = "react"
  }

  model {
    provider = "xai"
    name     = "grok-3-mini"
  }
}
tip

Always wrap API keys in secret(runtime(...)). This prevents the key from appearing in build artifacts and the output of agentc inspect.

← PreviousOpenRouterNext →Gemini

© 2026 pogue.dev. All rights reserved.

Creative CommonsCC BY 4.0
On this pageFieldsparamsKnown model identifiersExample

Search docs

Search the agentc documentation