Skip to main content

Adding Models

This section explains the steps to add xAI models and configure the required access controls.
1

Select xAI as the provider

From the TrueFoundry dashboard, go to AI Gateway > Models, click Add Model and choose To New Provider Account. Select xAI from the provider list.
Add Provider Account page listing the supported model providers

Choose a provider in Add Provider Account

2

Add xAI Account Details

Give a unique name to your xAI account and complete the form with your xAI authentication details (API Key).
xAI Configure Account form in the provider account setup drawer

Configure Account for xAI

3

Add Models

If you see the model you want to add in the list of checkboxes, we support public model cost for these models.
If the model you need is not listed, click Add Model Manually in the banner below the list and enter its display name, model ID and model types.
TrueFoundry AI Gateway supports xAI chat completion and image generation models. For image models (for example grok-imagine-image-2.0), set Model Types to Image. The complete list of models supported by xAI can be found here.
Image models are called through the OpenAI-compatible Image Generation API (POST /images/generations).
4

Save and grant access

Click Test Credentials to check the account against the selected models, or click Save without Testing. To keep the account in Git instead, click Apply using YAML and apply the generated spec with tfy apply.To let other users, teams or virtual accounts use or manage these models, open Manage Accounts, click ⋮ on the account and choose Access Control > Grant Access. See Access control.

Inference

After adding the models, you can perform inference using an OpenAI-compatible API via the Playground or by integrating with your own application. Code Snippet and Try in Playground Buttons for each xAI model