Try Bifrost Enterprise free for 14 days.
Request access

grok-code-fast Cost Calculator - xAI

Calculate the cost of using grok-code-fast from xAI for your AI applications

Pricing data last updated:

grok-code-fast Cost Calculator

Mode: Chat

Max: 256,000 tokens

Max: 256,000 tokens

Cost Breakdown

Input Cost$0.00020000
Output Cost$0.001500
Total Cost$0.001700

Pricing Details

Input: $0.0000002000 per token
Output: $0.00000150 per token
[ WE'RE OPEN SOURCE ]

Scale with the Fastest LLM Gateway

Built for enterprise-grade reliability, governance, and scale. Deploy in seconds.

Model Specifications

Capabilities

Function Calling
Reasoning

Limits

Max Input Tokens256,000
Max Output Tokens256,000
Max Tokens256,000

About grok-code-fast

grok-code-fast is a chat model from xAI, one of 38 chat models they offer. It is priced at $0.20 per 1M input tokens and $1.50 per 1M output tokens, ranking 608 out of 2161 chat models by cost and cheaper than 67% of models in this category. grok-code-fast supports function calling, reasoning, prompt caching. Its 256K-token context window is in the top 27% among chat models.

Pricing Information

Input Cost$0.20 per 1M tokens
Output Cost$1.50 per 1M tokens

Note: Use the interactive calculator above to estimate costs for your specific usage patterns.

Technical Specifications

Maximum Input Tokens256,000
Maximum Output Tokens256,000
Maximum Total Tokens256,000

Pro Tip

Use the maximum token limits shown above to understand the model's capacity. This model can handle up to 256,000 input tokens. The maximum output length is 256,000 tokens.

Model Capabilities

Function Calling - Execute custom functions and tools
Advanced Reasoning - Complex problem-solving capabilities
Prompt Caching - Optimize repeated prompts

How grok-code-fast Pricing Compares

At $0.20 per 1M input tokens and $1.50 per 1M output tokens, grok-code-fast ranks 608 out of 2161 chat models by input cost. It is more affordable compared to the median of $0.55 for chat models, and is cheaper than 67% of models in this category.

grok-code-fast is one of 38 xAI chat models, with support for function calling, reasoning, prompt caching. its 256K-token context window places it in the top 27% of chat models.

ModelProviderInput / 1M tokensOutput / 1M tokensvs grok-code-fast
gpt-5.4-nanoAzure$0.20$1.250%
gpt-5.4-nano-2026-03-17Azure$0.20$1.250%
gpt-5-miniAzure$0.25$2.00+25%

Alternatives to grok-code-fast

Similar chat models from other providers

Azure
gpt-5.4-nano
$0.20/1M input
0% vs grok-code-fast
Azure
gpt-5-mini
$0.25/1M input
+25% vs grok-code-fast
Azure
gpt-5-mini-2025-08-07
$0.25/1M input
+25% vs grok-code-fast
Google Gemini
gemini-3.1-flash-lite-preview
$0.25/1M input
+25% vs grok-code-fast

Frequently Asked Questions

Is grok-code-fast cheaper than gpt-5.4-nano?

No. grok-code-fast costs $0.20 per 1M input tokens while gpt-5.4-nano costs $0.20 per 1M input tokens, making gpt-5.4-nano 0% more affordable for input. However, grok-code-fast may offer different capabilities or performance characteristics that justify the price difference.

How does grok-code-fast pricing compare to the average chat model?

grok-code-fast input pricing is $0.20 per 1M tokens, which is 64% below the median of $0.55 for chat models. It ranks 608 out of 2161 chat models by input cost, making it cheaper than 67% of models in this category. For output, it costs $1.50 per 1M tokens compared to the median of $1.44.

What makes grok-code-fast different from other xAI models?

Among xAI's 38 chat models, grok-code-fast ranks 8 by input cost.

What are the best alternatives to grok-code-fast?

The most comparable chat models to grok-code-fast are: gpt-5.4-nano from Azure ($0.20/1M input tokens); gpt-5.4-nano-2026-03-17 from Azure ($0.20/1M input tokens); gpt-5-mini from Azure ($0.25/1M input tokens); gpt-5-mini-2025-08-07 from Azure ($0.25/1M input tokens). These alternatives were selected based on similar capabilities, pricing, and provider diversity. You can compare any of these models in detail using the Bifrost Model Library.

How large is grok-code-fast's context window?

grok-code-fast supports up to 256,000 input tokens, placing it in the top 27% of chat models by context window size (rank 547 of 2086). This makes it suitable for processing long documents, extensive code repositories, or maintaining detailed conversation histories.

How do I calculate grok-code-fast costs?

grok-code-fast is priced based on input and output tokens. Use the interactive calculator at the top of this page to estimate costs for your specific workload. Enter your expected input and output tokens volume and the calculator will show the total cost breakdown. For reference, processing 1M input tokens costs $0.20 and generating 1M output tokens costs $1.50.