Grok 4 · Grok 3 · pay as you go

Build with Grok through one fast API.

Instant access to xAI's Grok models through a drop-in, OpenAI-compatible proxy. Buy credits, get a key, and start building in minutes — you only pay for what you use.

99.9%Uptime target
<50msProxy overhead
$5Minimum top-up
quickstart.py
from openai import OpenAI

client = OpenAI(
    api_key="sk-grok-your-key",
    base_url="https://api.grokapi.io/v1",
)

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

Works with the tools you already use

OpenAI SDK LangChain LlamaIndex Vercel AI SDK cURL
Why grokapi.io

A thin, reliable layer over the Grok API

Everything you need to run Grok in production — without rebuilding your stack.

Drop-in compatible

Standard REST with an OpenAI-style schema. Point your existing client at grokapi.io — just change the base URL and key.

# point your client at us base_url = "https://api.grokapi.io/v1" api_key  = "sk-grok-your-key"

Prepaid credits

Top up and spend only on what you use. No subscription, no surprise invoices.

Low-latency proxy

Globally routed edge with minimal overhead, automatic retries, and failover.

Usage & keys

Real-time spend tracking per key and model, scoped keys, instant rotation and limits.

Secure by default

Encrypted in transit, rate-limit smoothing, and a 99.9% uptime target.


Models

The Grok lineup, one API

Pick the right model per request through a single consistent interface.

grok-4Abstract visual representing Grok 4

Grok 4

xAI's flagship reasoning model for complex analysis, coding, and tool use.

View in docs
grok-3Abstract visual representing Grok 3

Grok 3

Fast, capable general model for chat, drafting, and everyday tasks.

View in docs

Get started

From sign-up to first call in three steps

01

Buy credits

Create an account and top up. Credits never require a subscription.

02

Generate a key

Create an API key from your dashboard and drop it into your environment.

03

Make your first call

Set the base URL to our endpoint and call the API with the SDK you already use.


Pricing

Simple, pay-as-you-go credits

Buy a credit pack, spend it on any model. Top up more, get more bonus credit.

Starter

$5

For testing and side projects.

  • $5 in usage credit
  • Access to all models
  • 2 API keys
  • Usage dashboard
Get started

Scale

$500 + $75 bonus

For high-volume workloads.

  • $575 in usage credit
  • Highest rate limits
  • Dedicated routing
  • Invoicing, SSO & SLA
Get started
ModelInput / 1M tokensOutput / 1M tokens
grok-4$3.00$15.00
grok-3$2.00$10.00

Indicative rates for illustration. See your dashboard for live pricing.


FAQ

Frequently asked questions

No. grokapi.io is an independent API proxy and reseller for Grok and is not affiliated with x.ai. For Grok's official site, visit x.ai.

Immediately. After you top up credits and generate a key, you can make your first call in minutes — no waitlist or approval step.

Yes. The endpoint mirrors the OpenAI Chat Completions schema, so most existing SDKs and tools work by changing only the base URL and API key.

Prepaid credits are valid for 12 months from purchase, and you'll get spend alerts before your balance runs low.

Requests are proxied over encrypted connections and we don't sell your data. See our Privacy Policy for full detail.

Yes — on the Scale plan we support invoicing and wire payment. Contact us to set it up.

Start building on Grok today

Top up, get an instant API key, and ship your first Grok-powered feature this afternoon.

Get your API key