Grok 4 API

Access Grok 4 through a simple, OpenAI-compatible API. Change one URL and one key — your existing code works immediately. No SDK changes needed.

Grok 4 Pricing

Token TypeQubaxRetailSave
Input (per 1M)$3.31$2.55
Output (per 1M)$16.57$12.75-30%

At $3.31/1M input tokens, Grok 4 is one of the most affordable APIs in its class.

Why use Grok 4 API on Qubax?

  • Point your OpenAI SDK at https://api.qubax.ai/v1
  • Use model ID: grok-4
  • Generate API keys starting with qbx_live_
  • Full streaming, function calling, and vision support

About Grok 4

Grok 4 — xAI flagship with 2M context, vision, and advanced reasoning. It supports a 2M-token context window and up to 128K output tokens per request. Native capabilities include reasoning, vision, tool calling, structured output, streaming. On Qubax it is served by 12 independent sellers, so pricing stays competitive and uptime stays high.

2M context window128K max output tokensReasoning with selectable effort levels (default)Vision / image inputFunction & tool callingJSON schema responsesInput modalities: text, imageToken streaming

Grok 4 API Access — code example

Python — OpenAI SDK, one-line switchpython
from openai import OpenAI

# Only two lines change vs the official API:
client = OpenAI(
    base_url="https://api.qubax.ai/v1",
    api_key="qbx_live_YOUR_KEY",
)

response = client.chat.completions.create(
    model="grok-4",
    messages=[{"role": "user", "content": "Hello, Grok 4!"}],
)
print(response.choices[0].message.content)

More xAI models on Qubax

Get started in 60 seconds

  1. 1Create a free account at qubax.ai/register
  2. 2Add crypto credits (200+ coins, $3 minimum, credits never expire)
  3. 3Generate an API key and set your base URL to https://api.qubax.ai/v1
  4. 4Use model ID grok-4 — done!

Grok 4 API Access FAQ

How much does Grok 4 cost API?

On Qubax, Grok 4 costs $3.31 per 1M input tokens and $16.57 per 1M output tokens. Pay with 200+ cryptocurrencies.

Can I use Grok 4 with my existing tools?

Yes. Qubax is fully OpenAI-compatible. Change your base URL to api.qubax.ai/v1 and use your Qubax key. Works with Cline, Cursor, OpenCode, LangChain, and any OpenAI SDK.

Do I need a credit card?

No. Qubax accepts 200+ cryptocurrencies. No credit card, no KYC.

Start using Grok 4 API

No credit card. Crypto accepted. Credits never expire.

Get started →
Grok 4 API · Qubax AI