APIMart
Back to all models

Grok 4.5 API

xAIModel ID grok-4.5Text modelReleased July 16, 2026

Use Grok 4.5 to find why a test fails after a refactor, check a pull request for changes that break callers, or match invoices against purchase orders line by line.

Max input
500,000 tokens
Max output
500,000 tokens
Input → output
Text, Image → Text
  • Image input
  • Streaming
  • Cached input pricing
  • OpenAI SDK compatible

Grok 4.5 API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on Grok 4.5.

Try Grok 4.5 with your own material

Debugging failing tests

Send the failing test output and the code it covers, and have Grok 4.5 explain the cause and propose the smallest fix. Run the full test suite on the fix before merging.

Example: Why does this test fail after the refactor?

Material

Test output
expected formatPrice(1999) to be "$19.99", received "$1999.00"
price.ts
export const formatPrice = (amount: number) => `$${amount.toFixed(2)}`;
Commit message
Refactor: prices are now stored in cents everywhere.

PromptUsing the test output and the function, explain why the test fails and give the smallest fix.

Sample answer · written by hand to show the reasoning

Prices are now stored in cents, but formatPrice still treats its argument as dollars, so 1999 cents prints as $1999.00. Divide by 100 before formatting: `$${(amount / 100).toFixed(2)}`. Search for other callers that already divide by 100, or they will now be off by a factor of 100 in the other direction.

About the Grok 4.5 API

  • Built for coding agents

    xAI announced Grok 4.5 on July 16, 2026 for agentic software, engineering and knowledge work, trained alongside Cursor and served at about 80 tokens per second.

  • Newer Grok models cost the same

    Grok 4.6 and Grok 4.7 have the same input and output prices and 500,000-token context. Compare them first for new projects; workloads validated on Grok 4.5 can stay.

  • Always reasons, high by default

    Reasoning cannot be turned off and defaults to high effort. presence_penalty, frequency_penalty and stop are not supported on reasoning models.

  • Grok 4.5 API key and access

    You don’t need a separate Grok 4.5 API key: one APIMart key works for every model. Check the Grok 4.5 pricing table on this page, then call an OpenAI Chat Completions-compatible endpoint with the model ID grok-4.5.

Grok 4.5 official benchmark results

Selected results xAI published at launch.

  • Artificial Analysis Intelligence Index (high)

    56

    Composite score across many evaluations, from xAI’s Grok 4.6 results table. Grok 4.6 scores 61.

  • CursorBench v3.2 (high)

    66.7%

    Coding tasks from the Cursor editor. Grok 4.6 scores 69.9%.

  • FrontierCode v1.1 Extended (high)

    56.6%

    Whether coding agents produce changes ready to merge. Grok 4.6 scores 61.3%.

  • APEX-SWE (high)

    53.6%

    Software engineering tasks from professional work. Grok 4.6 scores 56.4%.

  • APEX-Agents (high)

    47.1%

    Agent tasks from professional work. Grok 4.6 scores 57.5%.

  • GDPval-AA v2 (high)

    1,526

    Real-world knowledge work across occupations, rated in Elo. Grok 4.6 scores 1,753.

How to call the Grok 4.5 API

To call Grok 4.5, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-4.5",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

Grok 4.5 access details

Model IDgrok-4.5
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

Grok 4.5 API request parameters

Grok 4.5 uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use grok-4.5 for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

Grok 4.5 API pricing

The Grok 4.5 API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input16Credits~$1.615.2Credits~$1.5214.4Credits~$1.4420Credits~$220%
Cached input2.4Credits~$0.242.28Credits~$0.2282.16Credits~$0.2163Credits~$0.320%
Output48Credits~$4.845.6Credits~$4.5643.2Credits~$4.3260Credits~$620%

Prices are for reference only. View full pricing

Why call Grok 4.5 API through APIMart

  • 20% below official pricing

    Grok 4.5 API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below xAI's official prices, and cached input costs just $0.24 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    Grok 4.5, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try Grok 4.5 with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which xAI model should you choose?

Base prices per 1M tokens (USD). Your Grok 4.5 API key works for every model in the table; just change the model parameter.

Differences between xAI models
ComparisonGrok 4.5 CurrentGrok 4.3Grok 4.6Grok 4.7
Best forCoding agents, Engineering workflows, Knowledge workTool calling, Instruction following, 1M-token contextLong-running agents, Interactive front-end work, Knowledge workAgentic coding, Legal and office work, Engineering calculations
Max input500,000 tokens1,000,000 tokens500,000 tokens500,000 tokens
Max output500,000 tokens1,000,000 tokens128,000 tokens128,000 tokens
Knowledge cutoff———May 2026
Input price$1.6$1$1.6$1.6
Output price$4.8$2$4.8$4.8

Grok 4.5 FAQ

Should I use Grok 4.5, Grok 4.6 or Grok 4.7?

Compare Grok 4.7 first for new projects: xAI calls it the most capable model it has built. Grok 4.6, released August 12, 2026, builds on Grok 4.5 with a longer supplemental training run and a focus on long-running agents and interactive, visual work. All three have a 500,000-token context window and the same input and output prices; Grok 4.5 has the lowest cached-input price of the three. Workloads already tuned and validated on Grok 4.5 can stay on it. On APIMart they share one endpoint and API key, so you only change the model parameter.

Can I turn off reasoning on Grok 4.5?

No. According to xAI’s docs, Grok 4.5 always reasons and the default effort is high; you can lower the effort for simpler requests but not set it to none. If you need a Grok model with reasoning switched off, Grok 4.3 accepts an effort of none. Reasoning models cannot use the presence_penalty, frequency_penalty and stop parameters.

What is Grok 4.5 good at in coding?

xAI built Grok 4.5 for agentic software, engineering and workflow tasks and trained it alongside Cursor. At launch it was the default model in Grok Build and available in Cursor. It suits agents that edit and test code over several steps, debugging and code review.

Can Grok 4.5 access real-time information?

Not by itself. According to xAI’s docs, Grok models have no real-time knowledge unless xAI’s server-side search tools (Web Search and X Search) are enabled. The examples on this page do not include search tools, so when you need current information, put the relevant material in the request.

Why is the APIMart output limit different from xAI’s documentation?

xAI does not publish a fixed text output limit for Grok 4.5; its docs give only the 500,000-token context window. For calls through APIMart, use the limit shown on this page: 500,000 tokens per request.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select Grok 4.5 in the text category to start exploring.

Which model ID does the Grok 4.5 API use?

Set model to grok-4.5. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of Grok 4.5?

On APIMart, Grok 4.5 accepts up to 500,000 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

Grok 4.5 can output up to 500,000 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the Grok 4.5 API cost?

The Grok 4.5 API on APIMart is billed by token, and prices depend on your membership tier. Gold: $1.6 per million input tokens and $4.8 per million output tokens. Diamond: $1.44 per million input tokens and $4.32 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.