SpyBara
Go Premium

Documentation 2026-09-08 21:00 UTC to 2026-09-11 21:00 UTC

11 files changed +16 −16. View all changes and history on the product overview
2026
Wed 30 23:57 Tue 29 23:59 Mon 28 23:57 Sun 27 22:59 Sat 26 23:59 Fri 25 23:01 Thu 24 23:59 Wed 23 23:59 Tue 22 23:58 Mon 21 23:00 Sun 20 23:01 Sat 19 23:59 Fri 18 23:59 Thu 17 10:04 Wed 16 19:01 Tue 15 17:00 Mon 14 06:00 Sun 13 05:00 Fri 11 21:00 Tue 8 21:00 Mon 7 22:57 Thu 3 16:59 Wed 2 22:03
Details

6>6>

7> Deferred Chat Completions are currently available only via REST requests or xAI SDK.7> Deferred Chat Completions are currently available only via REST requests or xAI SDK.

8 8 

9Deferred Chat Completions allow you to create a chat completion, get a `response_id`, and retrieve the response at a later time. The result would be available to be requested exactly once within 24 hours, after which it would be discarded.9Deferred Chat Completions allow you to create a chat completion, get a `request_id`, and retrieve the response at a later time. The result would be available to be requested exactly once within 24 hours, after which it would be discarded.

10 10 

11> [!TIP]11> [!TIP]

12>12>

Details

14cost_usd = cost_in_usd_ticks / 10,000,000,00014cost_usd = cost_in_usd_ticks / 10,000,000,000

15```15```

16 16 

17For example, a response with `"cost_in_usd_ticks": 37756000` cost $0.0038. An image generation with `"cost_in_usd_ticks": 200000000` cost $0.02.17For example, a response with `"cost_in_usd_ticks": 37756000` cost $0.0038. An image generation with `"cost_in_usd_ticks": 400000000` cost $0.04.

18 18 

19Ticks exist for precision: they represent costs down to fractions of a cent without floating-point rounding, which matters when you're processing thousands of requests and need the totals to add up.19Ticks exist for precision: they represent costs down to fractions of a cent without floating-point rounding, which matters when you're processing thousands of requests and need the totals to add up.

20 20 


303 "model": "grok-imagine-image-2.0",303 "model": "grok-imagine-image-2.0",

304 "prompt": "A cat on a rocket"304 "prompt": "A cat on a rocket"

305 }' | jq '.usage.cost_in_usd_ticks'305 }' | jq '.usage.cost_in_usd_ticks'

306# => 200000000 ($0.02)306# => 400000000 ($0.04)

307```307```

308 308 

309```python customLanguage="pythonXAI"309```python customLanguage="pythonXAI"

faq/billing.md +1 −1

Details

4 4 

5## I'm having payment issues with an Indian payment card5## I'm having payment issues with an Indian payment card

6 6 

7Unfortunately we cannot process Indian payment cards for our API service. We are working toward supporting it but you might want to consider using a third-party API in the meantime. As Grok Website and Apps' payments are handled differently, those are not affected.7Due to regulatory requirements, Indian payment cards cannot be saved for later charges. Purchase prepaid credits via Guest Checkout instead. See [Prepaid credits](/console/billing#prepaid-credits).

8 8 

9## When will I be charged?9## When will I be charged?

10 10 

files.md +1 −1

Details

160 160 

161## Limitations161## Limitations

162 162 

163* **File size**: Maximum 48 MB per file163* **File size**: Maximum 512 MB per file

164* **No batch requests**: File attachments with document search are agentic requests and do not support batch mode (`n > 1`)164* **No batch requests**: File attachments with document search are agentic requests and do not support batch mode (`n > 1`)

165* **Agentic models only**: Requires models that support agentic tool calling (e.g., `grok-4.20`, `grok-4.5`, `grok-4.6`)165* **Agentic models only**: Requires models that support agentic tool calling (e.g., `grok-4.20`, `grok-4.5`, `grok-4.6`)

166* **Supported file formats**:166* **Supported file formats**:

Details

733 733 

734### File Size Limits734### File Size Limits

735 735 

736* **Maximum file size**: 48 MB per file736* **Maximum file size**: 512 MB per file

737* **Processing time**: Larger files may take longer to process737* **Processing time**: Larger files may take longer to process

738 738 

739### File Retention739### File Retention

rate-limits.md +3 −3

Details

40| grok-4.20-0309-non-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |40| grok-4.20-0309-non-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

41| grok-build-0.1 | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |41| grok-build-0.1 | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

42| grok-4.20-multi-agent-0309 | T0: 9, T1: 12, T2: 18, T3: 31, T4: 56 | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |42| grok-4.20-multi-agent-0309 | T0: 9, T1: 12, T2: 18, T3: 31, T4: 56 | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |

43| grok-imagine-image | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

44| grok-imagine-image-2.0 | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

45| grok-imagine-image-quality | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |43| grok-imagine-image-quality | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

46| grok-imagine-video | T0: 10, T1: 20, T2: 39, T3: 79, T4: 158 | — |44| grok-imagine-image-2.0 | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

45| grok-imagine-image | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

47| grok-imagine-video-1.5 | T0: 10, T1: 20, T2: 39, T3: 79, T4: 158 | — |46| grok-imagine-video-1.5 | T0: 10, T1: 20, T2: 39, T3: 79, T4: 158 | — |

47| grok-imagine-video | T0: 10, T1: 20, T2: 39, T3: 79, T4: 158 | — |

48 48 

49### What counts toward TPM49### What counts toward TPM

50 50 

Details

77 77 

78* `tool_choice` (string | object)78* `tool_choice` (string | object)

79 79 

80* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.80* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 350 functions are supported.

81 81 

82* `top_logprobs` (integer | null) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. Not supported by models \`grok-4.20\` and newer; the field will be silently ignored if set.82* `top_logprobs` (integer | null) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. Not supported by models \`grok-4.20\` and newer; the field will be silently ignored if set.

83 83 

Details

182 182 

183* `tool_choice` (object | object | object)183* `tool_choice` (object | object | object)

184 184 

185* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.185* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 350 functions are supported.

186 186 

187* `top_k` (integer | null) — (Unsupported) When generating next tokens, randomly selecting the next token from the k most likely options.187* `top_k` (integer | null) — (Unsupported) When generating next tokens, randomly selecting the next token from the k most likely options.

188 188 

Details

87 87 

88* `tool_choice` (string | object)88* `tool_choice` (string | object)

89 89 

90* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.\`web\_search\_preview\` tool, if specified, will be overridden by \`search\_parameters\`.90* `tools` (array | null) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 350 tools are supported.\`web\_search\_preview\` tool, if specified, will be overridden by \`search\_parameters\`.

91 91 

92* `top_k` (integer | null) — Top-k sampling: only the \`top\_k\` most probable tokens are considered at each sampling step. Disabled when unset.92* `top_k` (integer | null) — Top-k sampling: only the \`top\_k\` most probable tokens are considered at each sampling step. Disabled when unset.

93 93 


167 167 

168 * `type` (string, required) — Type is always \`"function"\`.168 * `type` (string, required) — Type is always \`"function"\`.

169 169 

170* `tools` (array\<object | object | object | object | object | object | object | object | object>, required) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.170* `tools` (array\<object | object | object | object | object | object | object | object | object>, required) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 350 tools are supported.

171 171 

172* `top_logprobs` (integer, required) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.172* `top_logprobs` (integer, required) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.

173 173 


420 420 

421 * `type` (string, required) — Type is always \`"function"\`.421 * `type` (string, required) — Type is always \`"function"\`.

422 422 

423* `tools` (array\<object | object | object | object | object | object | object | object | object>, required) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.423* `tools` (array\<object | object | object | object | object | object | object | object | object>, required) — A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 350 tools are supported.

424 424 

425* `top_logprobs` (integer, required) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.425* `top_logprobs` (integer, required) — An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.

426 426 

Details

384 384 

385| Field | Required | Description |385| Field | Required | Description |

386|-------|----------|-------------|386|-------|----------|-------------|

387| `name` | Yes | Unique identifier (max 200 tools per request) |387| `name` | Yes | Unique identifier (max 350 tools per request) |

388| `description` | Yes | What the tool does — helps the model decide when to use it |388| `description` | Yes | What the tool does — helps the model decide when to use it |

389| `parameters` | Yes | JSON Schema defining function inputs |389| `parameters` | Yes | JSON Schema defining function inputs |

390 390 

Details

38chat = client.chat.create(38chat = client.chat.create(

39 model="grok-4.6",39 model="grok-4.6",

40 tools=[40 tools=[

41 mcp(server_url="https://mcp.deepwiki.com/mcp"),41 mcp(server_url="https://mcp.deepwiki.com/mcp", server_label="deepwiki"),

42 ],42 ],

43 include=["verbose_streaming"],43 include=["verbose_streaming"],

44)44)