xAI API and Dome
Grok behind one Gateway, with every call governed. Some models belong with your own people, not in front of customers. Connect xAI to Dome, tag the Grok connections use: internal, and customer-facing agents are refused before a call leaves. Grok 4.6 stands in when 4.7 fails.
Dome provides model brokeringand routing for xAI.
Grok access without the key
Agents reach Grok through the Gateway with Dome keys. The xAI key stays with Dome, attached only as the call goes out.
An older Grok as fallback
Pool Grok 4.7 with Grok 4.6 behind it. When 4.7 fails, the call goes to 4.6.
Internal models stay internal
Tag Grok connections use: internal. A rule on each customer-facing agent refuses them.
Connect xAIin three steps.
Add Grok 4.7 and 4.6, put them in one pool, and switch agents to the Gateway.
Add the connections
The provider id is xai. Dome uses https://api.x.ai/v1 and xAI's own model ids.
shelldome models add grok-4-7-xai \ --provider xai \ --model grok-4.7 \ --api-key "$XAI_API_KEY" \ --attributes '{"use":"internal"}' \ --gateway prod-gateway dome models add grok-4-6-xai \ --provider xai \ --model grok-4.6 \ --api-key "$XAI_API_KEY" \ --attributes '{"use":"internal"}' \ --gateway prod-gatewayPool them
4.7 is tried first and 4.6 next, and agents name the pool, grok-4.7.
shelldome models pool create grok-4.7 \ --failover-max all --gateway prod-gateway dome models pool member add grok-4.7 grok-4-7-xai --priority 0dome models pool member add grok-4.7 grok-4-6-xai --priority 1Point your agent at the Gateway
Use any client that speaks Chat Completions. It sends the agent's Dome key where the xAI key used to go.
pythonfrom openai import OpenAI client = OpenAI(base_url=f"{GATEWAY_URL}/v1", api_key=DOME_AGENT_KEY)client.chat.completions.create( model="grok-4.7", messages=[{"role": "user", "content": "Summarize this incident report."}],)
Customer-facing agentsstay off internal models.
Applied to the support agent with --agent, this refuses any connection tagged use: internal. Other agents keep their Grok access.
cedar
forbid (principal, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel)when { resource has use && resource.use == "internal" };Bringing it alltogether.
Connecting xAI to registered agents, tools, and identity in Dome completes a governed agent application.
Acting for
Agent
Control point
GatewayEvery call decided and audited
RulesGuardsQuotas
Models
Common questionsabout xAI.
More of whatDome works with.
Model
Claude Fable
Fable 5.1 from Anthropic and Amazon Bedrock in one failover pool, open to one group and capped by quota.
MCP server
GitHub
The GitHub MCP server behind the Tool Gateway, with rules that decide each call on its owner and repository.
Identity
Okta
Okta tokens verified on every agent call, so rules and audit name the person each agent acted for.
Runtime
OpenAI Agents SDK
OpenAI Agents SDK agents with their models on the Model Broker and their MCP tools on the Tool Gateway.
Client
Claude Code
Claude Code on a Dome Gateway with per-developer sign-in, rules on every tool call, and audit by name.
Agent service
TinyFish
TinyFish's web agents behind the Tool Gateway, with rules that decide each run on the site it targets.
Talk with ourFDE team.
Or start free, and register your first agent in minutes. Connect it through a gateway, give it rules, and see every call it makes in one audit trail.
Talk with our FDE team
Our engineers design, build and run governed agents for the part of your business you want to change. You see what they deliver.
LLM providers for AI agents: one governed path to every model
Connect a provider once. Its key stays in Dome, and every agent call to it is authorized, metered and audited.