# xAI's Grok models are now available in AI Gateway

> Call five xAI Grok models, including grok-4.3 with a 1M token context window, through AI Gateway with your ngrok access key and credits.

- Date: 2026-09-25
- Author: Jarod Clark
- Products: AI Gateway
- URL: https://ngrok.com/changelog/ai-gateway-xai-grok-models

AI Gateway now supports five new built-in models from **xAI**:

- **grok-4.3**, with a 1M token context window
- **grok-4.5**, with a 500K token context window
- **grok-4.6**, with a 500K token context window
- **grok-4.7**, with a 500K token context window
- **grok-build-0.1**, with a 256K token context window

Use your ngrok access key and credits for built-in inference. Point an OpenAI SDK client at AI Gateway to try these models in your application and inspect their requests in one place.

Check [**Models**](https://app.ngrok.ai/models) for each model’s input and output token prices, context window, and supported request formats. Costs depend on the model you choose and the tokens your application sends and receives.

![AI Gateway Models page with the search filtered to xAI, showing five built-in rows for xai/grok-4.3, xai/grok-4.5, xai/grok-4.6, xai/grok-4.7, and xai/grok-build-0.1, each with its context window and input and output token prices.](https://ngrok.com/blog-assets/images/2026-09-25-ai-gateway-xai-grok-models/xai-grok-models.png)

## Get started

[Create an ngrok account or sign in](https://app.ngrok.ai/). Create an [**access key**](https://app.ngrok.ai/keys) that allows your chosen provider and model, and confirm your account has credits.

Optionally, try one of the new Grok models in the [playground](https://app.ngrok.ai/playground).

Follow the [**setup guide**](https://app.ngrok.ai/getting-started) and select **OpenAI** and **TypeScript**.

Install the OpenAI SDK and TypeScript runner:

```bash
npm install openai && npm install --save-dev tsx
```

Save your ngrok access key in `.env.local`. Keep this file out of version control:

```dotenv
AI_GATEWAY_API_KEY=your_access_key_here
```

Use an ES module project (`"type": "module"` in `package.json`) for top-level `await`. Save this example as `index.ts`:

```typescript
import OpenAI from "openai";

const client = new OpenAI({
	baseURL: "https://gateway.ngrok.ai/v1",
	apiKey: process.env.AI_GATEWAY_API_KEY,
});

const response = await client.chat.completions.create({
	model: "xai/grok-4.3",
	messages: [{ role: "user", content: "Explain HTTP retries in two sentences." }],
});

console.log(response.choices[0]?.message.content);
```

Run the example from your project directory to print the response:

```bash
node --env-file=.env.local --import tsx index.ts
```

To try another model, change `model` to `"xai/grok-4.5"`, `"xai/grok-4.6"`, `"xai/grok-4.7"`, or `"xai/grok-build-0.1"`.

Open [**Logs**](https://app.ngrok.ai/activity), find the request you just sent, and inspect its model, provider, status, token usage, and cost.
