> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getporter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# xAI Grok

> Guide on generating xAI API keys and using them in Porter AI.

***

## Access xAI

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok01.png" />
</Frame>

> Go to [https://x.ai](https://x.ai) and sign up or log in.

## Generate API Keys

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok02.png" />
</Frame>

> Go to [https://docs.x.ai](https://docs.x.ai), click `Create an API key`, and add credits (minimum \$5) to generate an API key.

<Note>
  xAI API is a paid service that charges based on token usage, deducting costs from your prepaid credits. The minimum credit purchase is \$5. For detailed pricing by model, see the [Pricing page](https://x.ai/api#pricing).
</Note>

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok03.png" />
</Frame>

> After adding credits, click the key icon in the left sidebar of the dashboard to access the `Create API key` button and view your generated key.

<Tip>
  API keys can only be viewed immediately after generation, so be sure to store it securely. If you lose your API key, you can delete the existing key from the dashboard and generate a new one.
</Tip>

## Register API Key in Porter AI

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok04.png" />
</Frame>

> In `Settings > Models`, click the <Icon icon="gear" iconType="solid" size={15} color="9fa3a5" /> icon for xAI and enter your API key.

<Tip>
  Once you add your API key, Grok model usage will be charged to your xAI credits.
</Tip>

## Add Models

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok05.png" />
</Frame>

> Once you've registered an API key, you can add additional xAI models beyond the default ones. Simply provide a display name (shown in chats) and the official xAI model name.

<Tip>
  You can find the list of model names available via API on the [Models and pricing page](https://x.ai/api#pricing). The highlighted section in the screenshot below shows the model name format.

  <Frame>
    <img className="block rounded-md" src="https://files.cloudtype.io/promm/images/ko/grok06.png" />
  </Frame>
</Tip>
