Connect the Grok API to DSH
Connect the Grok API to DSH: distinguish Grok from Groq, match credentials and protocol, and check independent requests, text and tools.
On this page
To connect the Grok API, verify xAI credentials and one minimal request first. Then configure DSH with the matching address, protocol, and model. After an error, change one setting at a time. Changing the key, endpoint, and model together makes it hard to tell which change restored access.

This configuration reference uses official documentation checked on October 2, 2026, with DSH commit 639ed015 as its source baseline. This site has not completed a paid-API-to-DSH end-to-end test. It does not promise a particular installer includes a Grok card or every Grok tool feature.
Grok and Groq use different setup routes
Grok uses xAI's documentation, console, and API credentials. This site's Groq provider tutorial covers a different service. Keep the two providers' keys separate.
xAI's current Quickstart uses grok-4.7, the API base URL https://api.x.ai/v1, and a Responses example. Older tutorials may use 4.6. Configure a model available to your account and follow the current interface documentation. Official Quickstart
Confirm account and API access
In the xAI console, check your API credentials, the models your team can access, and your billing status. Store a new key safely. Do not publish it in chat logs, article comments, screenshots, or repositories.
Use an official minimal request to confirm that the account can call the target model. Keep the initial setup focused on a short text request. For later work with images, documents, and verification tools, refer to DataCamp's Grok 4.7 tutorial. Official model directory, standalone request in an online tutorial
Complete a short request without DSH
Follow the official Quickstart with a fixed model, address, and protocol. Ask a short question that requires no search, files, or execution tools. Once the request succeeds and returns text, proceed to DSH configuration.
If it fails, record the specific server error. Check whether the credential belongs to the current team, the model is accessible, the request path is correct, or the account has a rate or billing limit. The details in the error response are more useful for diagnosis than knowing that you bought a plan.
If the request works, record non-sensitive details about the model ID, protocol, and response, keeping credentials private. Reuse those established conditions in DSH. Do not change the model merely to make the configuration resemble someone else's screenshot.
Match both protocol and address in DSH
Check the provider directory in your installed version. If an appropriate built-in entry exists, check its protocol and models. Otherwise, inspect the custom model API settings.
The DSH source version used here supports OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages for custom routes. An official Grok Responses example does not belong unchanged in a route configured for a different protocol. DSH protocol implementation
Check each field:
| Item | What to verify |
|---|---|
| Provider | Whether the installed catalog offers an entry; use a distinct, recognizable ID for a custom route |
| Base URL | Match the verified service and distinguish the base URL from an individual request path |
| API protocol | Match the interface actually called; a /v1 URL alone is insufficient |
| Model ID | Use the exact name the account and service accept |
| Credentials | Use those for this service and team, not another provider's key |
Model discovery is a convenience, not a capability every service guarantees. If discovery fails but generation works independently, check the listing endpoint and response format. Manually adding a confirmed ID may be more useful than repeatedly replacing the key. Official configuration guide
Check an actual DSH task after saving
Select the target model in a new session and request ordinary text first. Then try a read-only tool in an isolated workspace, such as listing files. Check that DSH calls the tool, receives its output, and uses that output correctly in its reply.
Keep two kinds of tools distinct: xAI's server-side tools and DSH's workspace tools. A Python tutorial calling web search or code execution does not establish that those capabilities automatically exist in DSH through the model route.
The useful lesson from DataCamp's 4.7 example is to define acceptance checks before inspecting results. The author tested a Python circuit-review project. Its dependencies and tool calls need separate checks before being used in DSH; this site has not reproduced that integration. The tutorial's verification approach
Optimize costs and long requests afterwards
Once text requests work, consider context, caching, speed, and tool charges. xAI's price table separates models and request conditions. Long-context and other service charges need their own checks; copying a pair of headline rates can miss conditions relevant to your call. Official API pricing
A first connection does not need the longest context. Start with a task small enough to check quickly, then increase scope while retaining a clear request record.
Common questions
Does a missing Grok card mean DSH cannot connect?
That alone is insufficient. Built-in catalogs vary by installed version. A custom route still needs testing with the right protocol and model. This article has not verified your installation.
Why can an official Python example work while DSH fails?
They may use different protocols, models, request fields, or tool declarations. Keep conditions fixed and compare layers rather than changing every setting at once.
Does Grok web search automatically become a DSH tool?
Do not infer that from configuring a model route. Check server-side tools separately from DSH plugins, permissions, and adapter support.
Finish one small task
A saved configuration is only the starting point. Check that the target model completes a task and that you can verify its result. Use the custom provider guide for route settings, and the error center for startup or model failures.
Model setup, selection and cost guides
Connect Qwen 3.8 27B to DSH
Connect local Qwen 3.8 27B to DSH: check the server, model ID, protocol and credentials, then test text, tools and image input separately.
Read →Model setup and costsCodex Costs: API Billing vs Subscription Usage
Understand Codex API billing, subscription limits and credits, with GPT-5.6 Sol vs GPT-5.5 rates and a clearly scoped token-cost example.
Read →Model setup and costsChoose a Gemini Model by Task and Cost
Choose Gemini by task, inputs, interface and API cost. Check promotion dates and model status, then verify what your DSH adapter supports.
Read →Model setup and costsClaude Sonnet vs Opus: Which Should You Use?
Compare Claude Sonnet and Opus 5.5 by API rates, retries and review effort, then use the same coding task to decide whether an upgrade is worthwhile.
Read →