Grok

by xAIText

Grok chat models for fast reasoning, coding, and tool-enabled application flows.

InputPromptmessages
Models9available
FlowSyncresult URL
Price50% offvendor token pricing
GrokExample conversation
You

Compare polling and webhooks for asynchronous AI jobs.

Grok logo
Grok

Polling is simplest for prototypes and private networks; webhooks reduce repeated requests and suit production systems with a public, verified callback endpoint.

Examples

A request and response, in context

01 · Technical comparisonGrok
You

Compare polling and webhooks for asynchronous AI jobs.

Grok logo
Grok

Polling is straightforward and works behind private networks, but adds repeated requests and completion delay. Webhooks are more efficient for production workloads when you can expose a verified callback and handle retries idempotently.

02 · DebuggingGrok
You

Why might an asynchronous job appear twice in a dashboard?

Grok logo
Grok

Common causes are webhook retries without event deduplication, optimistic UI rows that are not reconciled with the server ID, or polling responses appended instead of merged. Use one stable job key across every update path.

03 · Launch checklistGrok
You

Give me a five-item launch checklist for a new model integration.

Grok logo
Grok

Verify authentication and request validation; test success, timeout, and quota errors; confirm polling and callback flows; record model-specific pricing; and add monitoring for latency, failures, and duplicate jobs.

Capabilities

What you can build with Grok

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.5","messages":[{"role":"user","content":"Compare polling and webhooks for asynchronous AI jobs."}],"stream":false}'