xAI Grok via VerticalAPI

Call Grok-3 and Grok-2 Vision via VerticalAPI's OpenAI-compatible endpoint. BYOK with your xAI key, zero markup, real-time X-data-aware reasoning.

Endpoint: https://api.verticalapi.com/v1/chat/completions  ·  BYOK header: X-Provider-Key: xai-...

xAI Grok models routed by VerticalAPI

Pass the model ID below as model in any OpenAI-compatible request. New xAI Grok models are typically supported within 24h of release.

Model IDNameContextPricing (provider)
grok-3 Grok-3 128K $3 / $15 per 1M tok
grok-3-mini Grok-3 mini 128K $0.30 / $0.50 per 1M tok
grok-2-vision Grok-2 Vision 32K $2 / $10 per 1M tok

Pricing reflects xAI Grok's rates — you pay xAI Grok directly. VerticalAPI adds zero markup on tokens.

5-line xAI Grok call via VerticalAPI

Drop-in replacement for the OpenAI SDK. Works with the OpenAI Python client, Node, Go, curl — anything that speaks HTTP.

xai_quickstart.py Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.verticalapi.com/v1",
    api_key="vapi_...",
    default_headers={"X-Provider-Key": "xai-..."}
)

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

Four reasons developers route xAI Grok through us

Zero token markup

You pay xAI Grok directly with your own key. VerticalAPI's revenue is the gateway subscription, not a tax on your tokens.

One key, every provider

xAI Grok alongside OpenAI, Anthropic, Gemini and 12 more — same OpenAI-compatible endpoint, same SDK, switchable per-request.

Latency & cost monitoring

Per-request token counts, p50/p95 latency and cost dashboards out of the box. Compare xAI Grok to other providers on identical prompts.

Observability built in

Every xAI Grok call gets a trace ID, replayable payload and audit log entry. Wire to Datadog or Sentry via OpenTelemetry.

Where xAI Grok shines

X / real-time data context reasoning (Grok-3) vision (Grok-2) uncensored research

Common questions about xAI Grok on VerticalAPI

Does VerticalAPI surface Grok's X-data feature?

Grok's real-time X data access is enabled via xAI's native parameters; VerticalAPI passes them through unchanged.

Is the xAI API OpenAI-compatible already?

xAI's API is broadly OpenAI-compatible at the wire format. VerticalAPI normalizes edge cases (tool_choice, response_format) so your code is portable across all providers.

All supported LLM providers

Same endpoint, same SDK — just change the model and the BYOK header.