Skip to main content
xAI builds the Grok family of models. xAI supports Chat Completions and Responses requests. Responses requests to xAI aren’t stored, so previous_response_id isn’t available. Send the full conversation in each request.
xAI is a built-in provider you can pay for with credits, so a provider key is optional. Add your own xAI key to bill usage to your xAI account instead of your ngrok.ai credits.

Setup

1

Create an access key and add credits

Follow the quickstart to create an access key and purchase credits in app.ngrok.ai.
2

Store your xAI API key (optional)

Skip this step to pay with credits. To bring your own key, create an API key in your xAI account. Then add a provider key and create an access key configuration with an xai routing rule that uses it.
3

Send requests

Send requests with your access key:

Available models

See the model catalog.

Next steps