ProfusAPI
← All models

Grok 4

x-ai/grok-4·Created Sep 27, 2026
Chat with model

xAI's reasoning model with strong math and coding performance.

Context
256K tokens
Max output
—
Input price
$3 / M tokens
Output price
$15 / M tokens
Input
text, Image
Output
text
Requests (7d)
0
Tokens (7d)
0

API

ProfusAPI is OpenAI-compatible. Use your API key from Keys and set the model to x-ai/grok-4.

from openai import OpenAI

client = OpenAI(
    base_url="https://profusapi.com/api/v1",
    api_key="<PROFUSAPI_API_KEY>",
)

completion = client.chat.completions.create(
    model="x-ai/grok-4",
    messages=[{"role": "user", "content": "What is the meaning of life?"}],
)
print(completion.choices[0].message.content)