---
title: "Grok Imagine grok-imagine-text-to-image API — Pricing, code samples | RunAPI"
url: "https://runapi.ai/models/grok-imagine/text-to-image.md"
canonical: "https://runapi.ai/models/grok-imagine/text-to-image.md"
locale: "en"
model: "Grok Imagine"
provider: "xAI"
variant_id: "grok-imagine-text-to-image"
sdk_model_id: "grok-imagine-text-to-image"
modality: "image"
price_from_cents: 4
billing_unit: "call"
status: "active"
---

# Grok Imagine grok-imagine-text-to-image API

Same API, same SDK — switch variants by changing one parameter.

## Pricing

**$0.040** per call

Failed generations are not charged

## Spec sheet

| Field | Value |
|---|---|
| Model ID | `grok-imagine-text-to-image` |
| Provider | xAI |
| Modality | image |
| Task type | asynchronous |
| Billing unit | call |
| API endpoint | `/api/v1/grok_imagine/text_to_image` |
| Status | active |

## Install

```sh
npm install @runapi.ai/grok-imagine
```

## Quickstart

```sh
curl -X POST https://api.runapi.ai/api/v1/grok_imagine/text_to_image \
  -H "Authorization: Bearer $RUNAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "grok-imagine-text-to-image", "prompt": "..." }'
```

```js
import RunAPI from "@runapi.ai/grok-imagine";

const client = new RunAPI(process.env.RUNAPI_KEY);
const task = await client.create({
  model: "grok-imagine-text-to-image",
  prompt: "...",
});
```

## FAQ

### Is the model ID stable across versions?

RunAPI keeps the model ID stable and handles compatible version refreshes without changing your request shape.

### What&#39;s the rate limit on this variant?

Per-key rate limits scale with usage tier. See pricing page for current limits.

### Can I switch variants later?

Yes — variant is a flag. Switch by changing the model parameter.

### Does it stream?

Where streaming is available, RunAPI streams end-to-end.

### Where do I report quality issues?

Open an issue on the public GitHub repo or email support.


## Related

Other Grok Imagine variants:

- [grok-imagine-edit-image](https://runapi.ai/models/grok-imagine/edit-image.md) — `edit-image` · $0.040
- [grok-imagine-image-to-video](https://runapi.ai/models/grok-imagine/image-to-video.md) — `image-to-video` · $0.020
- [grok-imagine-text-to-video](https://runapi.ai/models/grok-imagine/text-to-video.md) — `text-to-video` · $0.020
