SpyBara
Go Premium

Documentation 2026-06-22 20:59 UTC to 2026-06-24 22:02 UTC

4 files changed +19 −15. View all changes and history on the product overview
2026
Sat 27 00:02 Wed 24 22:02 Mon 22 20:59 Fri 19 05:59 Thu 18 00:57 Wed 17 15:58 Mon 15 23:02 Sun 14 22:02 Thu 11 10:57
Details

189 189 

190print("\n\n--------- Reasoning ---------", flush=True)190print("\n\n--------- Reasoning ---------", flush=True)

191for event in stream:191for event in stream:

192 if event.type == "response.reasoning_summary_text.delta":192 if event.type in ("response.reasoning_text.delta", "response.reasoning_summary_text.delta"):

193 print(event.delta, end="", flush=True)193 print(event.delta, end="", flush=True)

194```194```

195 195 

Details

219 219 

220| Resolution | Description |220| Resolution | Description |

221|------------|-------------|221|------------|-------------|

222| `1080p` | Full HD quality |

222| `720p` | HD quality |223| `720p` | HD quality |

223| `480p` | Standard definition, faster processing (default) |224| `480p` | Standard definition, faster processing (default) |

224 225 

226> **Note:** `1080p` is only supported on `grok-imagine-video-1.5` for image-to-video generation.

227 

225Video editing does not support custom `resolution`. The output resolution matches the input video's resolution, capped at 720p (e.g., a 1080p input will be downsized to 720p).228Video editing does not support custom `resolution`. The output resolution matches the input video's resolution, capped at 720p (e.g., a 1080p input will be downsized to 720p).

226 229 

227### Example230### Example

rate-limits.md +13 −13

Details

2 2 

3# Rate Limits3# Rate Limits

4 4 

5Every xAI API team has per-model rate limits on two dimensions: **requests per minute (RPM)** and **tokens per minute (TPM)**. These limits scale with your team's **tier**, which is determined by cumulative spend on the API.5Every xAI API team has per-model rate limits on two dimensions: **requests per second (RPS)** and **tokens per minute (TPM)**. Your per-second limit is derived from your per-minute request budget (RPM / 60): you cannot spend a full minute's requests in a single second, which protects the API from sudden bursts. These limits scale with your team's **tier**, which is determined by cumulative spend on the API.

6 6 

7You can view your team's current tier and per-model limits on the [Rate Limits](https://console.x.ai/team/default/rate-limits) page in the xAI Console.7You can view your team's current tier and per-model limits on the [Rate Limits](https://console.x.ai/team/default/rate-limits) page in the xAI Console.

8 8 


27 27 

28## Per-model limits28## Per-model limits

29 29 

30Each tier sets hard RPM and TPM caps per model. Limits scale exponentially with tier. Exceeding either limit returns a `429 Too Many Requests` error.30Each tier sets hard RPS and TPM caps per model. Limits scale exponentially with tier. Exceeding any limit returns a `429 Too Many Requests` error.

31 31 

32The table below shows limits at each tier for every model. You can also view your team's personalized limits on the [Rate Limits](https://console.x.ai/team/default/rate-limits) page in the xAI Console.32The table below lists RPS and TPM limits at each tier for every model. You can also view your team's personalized limits on the [Rate Limits](https://console.x.ai/team/default/rate-limits) page in the xAI Console.

33 33 

34| Model | RPM | TPM |34| Model | RPS | TPM |

35| --- | --- | --- |35| --- | --- | --- |

36| grok-4.3 | T0: 1.8K, T1: 2.4K, T2: 3.6K, T3: 6K, T4: 10K | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |36| grok-4.3 | T0: 30, T1: 40, T2: 60, T3: 100, T4: 166 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

37| grok-4.20-0309-reasoning | T0: 1.8K, T1: 2.4K, T2: 3.6K, T3: 6K, T4: 10K | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |37| grok-4.20-0309-reasoning | T0: 30, T1: 40, T2: 60, T3: 100, T4: 166 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

38| grok-4.20-0309-non-reasoning | T0: 1.8K, T1: 2.4K, T2: 3.6K, T3: 6K, T4: 10K | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |38| grok-4.20-0309-non-reasoning | T0: 30, T1: 40, T2: 60, T3: 100, T4: 166 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

39| grok-build-0.1 | T0: 1.8K, T1: 2.4K, T2: 3.6K, T3: 6K, T4: 10K | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |39| grok-build-0.1 | T0: 30, T1: 40, T2: 60, T3: 100, T4: 166 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

40| grok-4.20-multi-agent-0309 | T0: 450, T1: 600, T2: 900, T3: 1.5K, T4: 2.7K | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |40| grok-4.20-multi-agent-0309 | T0: 7, T1: 10, T2: 15, T3: 25, T4: 45 | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |

41| grok-imagine-image-quality | 300 | 0 |41| grok-imagine-image-quality | 5 | |

42| grok-imagine-image | 300 | 0 |42| grok-imagine-image | 5 | |

43| grok-imagine-video | 70 | 0 |43| grok-imagine-video-1.5 | 1 | |

44| grok-imagine-video-1.5 | 60 | 0 |44| grok-imagine-video | 1 | |

45 45 

46### What counts toward TPM46### What counts toward TPM

47 47 

Details

141 141 

142```javascriptAISDK142```javascriptAISDK

143import { xai } from '@ai-sdk/xai';143import { xai } from '@ai-sdk/xai';

144import { streamText, tool } from 'ai';144import { streamText, tool, stepCountIs } from 'ai';

145import { z } from 'zod';145import { z } from 'zod';

146 146 

147const result = streamText({147const result = streamText({


160 }),160 }),

161 }),161 }),

162 },162 },

163 stopWhen: stepCountIs(5),

163 prompt: 'What is the temperature in San Francisco?',164 prompt: 'What is the temperature in San Francisco?',

164});165});

165 166