grok-4

by xAIText

grok-4 is available through TTAPI. Grok chat models for fast reasoning, coding, and tool-enabled application flows.

InputPromptmessages
Models6available
FlowSyncresult URL
Price50% offofficial
grok-4Example conversation
You

Turn these engineering notes into a release plan with owners, milestones, and rollback checks. Keep the answer practical for a grok-4 integration.

grok-4 logo
grok-4

Start with the goal and release window, assign an owner for each milestone, define an observable success condition, and include a tested rollback path before launch. This example is tailored to the grok-4 model page.

Examples

A request and response, in context

01 · Release plangrok-4
You

Turn these engineering notes into a release plan with owners, milestones, and rollback checks. Keep the answer practical for a grok-4 integration.

grok-4 logo
grok-4

Start with the goal and release window, assign an owner for each milestone, define an observable success condition, and include a tested rollback path before launch. This example is tailored to the grok-4 model page.

02 · Data contractgrok-4
You

Design a JSON data contract for an asynchronous generation job, including validation and status transitions. Keep the answer practical for a grok-4 integration.

grok-4 logo
grok-4

Use one immutable request ID, validate the input schema at ingestion, model status as a small state machine, and record timestamps plus result URLs for every terminal state. This example is tailored to the grok-4 model page.

03 · Customer updategrok-4
You

Rewrite this technical outage note as a calm customer update with clear next steps. Keep the answer practical for a grok-4 integration.

grok-4 logo
grok-4

Lead with impact and current status, state the mitigation in plain language, avoid speculative causes, and tell customers exactly when the next update will arrive. This example is tailored to the grok-4 model page.

Capabilities

What you can build with grok-4

Prompt driven generation

Submit a concise prompt and get production-ready responses output through one TTAPI job.

Core controls only

Keep integration simple with prompt, model, output settings, and callback handling.

Async result flow

Use polling or webhook callbacks so long-running generations do not block your UI.

Ready for product UI

Return Grok results that can be displayed, stored, or passed into downstream workflows.

Pricing

Token billing rules

One key and one balance across supported text models.

Token billing ruleOfficial pricing
PlatformTTAPI billing
xAI Grok50% off official pricing
API request

Headers and submit parameters

Use the endpoint below with your TTAPI key and the request fields shown.

POSThttps://api.ttapi.io/v1/chat/completions

Headers

Authorizationstringrequired

Your TTAPI API key.

Content-Typestringrequired

Use application/json.

Body

modelstringrequired

Supported model identifier.

messagesarrayrequired

OpenAI-compatible chat messages.

temperaturenumberoptional

Sampling temperature.

max_tokensintegeroptional

Maximum output tokens.

streambooleanoptional

Enable server-sent event streaming.

Open the official TTAPI documentation
Integrate

From key to first result

Copy the resolved endpoint, authentication headers, and request body for this model.

curl --request POST \
  --url https://api.ttapi.io/v1/chat/completions \
  --header 'Authorization: Bearer $TTAPI_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"model":"grok-4","messages":[{"role":"user","content":"Compare polling and webhooks for asynchronous AI jobs."}],"stream":false}'