Buffaly Logo Buffaly

Use Buffaly with xAI

Connect a Grok account through managed xAI OAuth or use an xAI API key. Both completion paths select xai / provider_native; the credential owner decides which account is used.

Install completion and authentication components

Include Buffaly.Provider.Xai through the target release's package/provisioning workflow with matching shared contracts. Its enabled manifest entry supplies XaiProviderCatalogSource, XaiCompletionExecutor and XaiProviderAuthHandler. Verify the catalog/executor in the consuming host/worker processes and the auth handler in the login host. Follow the common installation and activation procedure. An installed DLL alone does not establish an authorized account.

Load and enable the database-backed XAI Feature through provider administration. Preserve its complete settings when changing the intended fields. Managed OAuth profiles use the host's separate profile store; token contents do not belong in feature examples or prompts.

Configure API-key access

  1. Obtain an xAI API key for the intended account and save it through the supported credential control as XAI Feature.ApiKey.
  2. Keep BaseUrl=https://api.x.ai and ApiVersion=v1 for the normal API.
  3. Configure exact Models entries and a DefaultModelName in that dictionary. Keep RequestTimeoutSeconds positive; the current absent-setting default is 900 seconds. Preserve existing cache/conversation-header settings unless intentionally changing that behavior.
  4. Check masked key status. A key saved here does not create an OAuth account profile.

Connect a managed Grok account

  1. Open Settings on the target installation and the Grok/xAI account controls. Start browser login with a readable account display name and open the authorization URL.
  2. Complete the xAI login in the browser while keeping the same pending login open in Settings. The host manages OAuth state and PKCE; the handler discovers authorization/token endpoints.
  3. For a remote host whose localhost redirect is unreachable in your browser, copy the full redirect URL into the callback control for that same pending login and complete it there. Do not paste the URL or tokens into ordinary chat.
  4. Confirm the saved account label. Choose Use account for the intended saved profile; use Reauthorize to renew that same profile rather than creating an unrelated login.
  5. Read the active credential-source status. The active account is provider-wide; old per-session profile IDs do not override that choice.

The host resolves and refreshes the selected OAuth credential before dispatch. A resolved bearer token takes priority. If no usable bearer token resolves, it considers the feature API key; a rejected request is not automatically retried with a different key. The handler's internal RecommendedTransport=responses describes its API recommendation, not a second catalog transport: keep session selection at provider_native.

The current auth handler's credential Probe performs a marker completion. Use saved status and catalog inspection for a non-inference check; run a credential probe only when you intend to execute against the account.

Select an exact Grok model and capability

Each Models entry has SupportedReasoningLevels and DefaultReasoningLevel. Use the model-specific advertised subset: normal reasoning entries accept low, medium and high; the current source additionally admits xhigh for exact IDs grok-4.6 and grok-4.7. Rows without reasoning use an empty list/default. Do not add max or extend a model's efforts by guessing its name.

Reload the complete provider catalog, inspect Providers and Error, and choose an enabled xai / provider_native model/effort in the session selector. Account-backed availability is combined by the host with the module's API-key status; a raw module-only row is not the final OAuth readiness result. See selection and readback.

Optional HostedTools, such as x_search, request provider-hosted functions, not arbitrary local tool access. The package also declares XaiTextToSpeechCatalogSource, XaiTextToSpeechExecutor and XaiRealtimeSpeechProvider; speech has separate model/voice settings and credentials must be verified for that path. The manifest declares no embedding component. A working OAuth chat does not prove API-key speech access.

Verify saved status before execution

  1. Read module/component errors, the enabled feature state, masked API-key status and the saved active account/credential-source label. Do not start login, refresh or a probe merely to read status.
  2. Read the full host catalog and current selection. Confirm the intended transport, exact model/default and supported effort without changing the selection. These checks do not make an inference request.
  3. For an intended execution test, select the xAI model in a test session and send Reply exactly: XAI_PROVIDER_OK. Confirm normal assistant text, selected tuple and non-secret credential-source metadata. The test consumes account/API quota and may be billed.

Common failures

  • Login controls unavailable: check XaiProviderAuthHandler loading as well as the completion components.
  • Callback does not complete: use the original pending login's full redirect and matching state; do not start a second transaction to complete the first.
  • OAuth expired: inspect active account/refresh status and reauthorize the intended saved profile. A separately configured API key can be used only according to the credential resolution described above.
  • Wrong account used: check the provider-wide active profile and credential-source status rather than a stale session pin.
  • Model or effort rejected: inspect the exact catalog row and account access; API inventory and account entitlement are different checks.
All providersModule installationManage models