AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help
Vendor parameter differences

Grok parameter and protocol differences

Understand Grok parameter differences and usage across compatible protocols.

For Grok models, adjust thinking, sampling and caching using this page. See Chat Completions and Responses for full request and response structures.

Applicable models

ModelUsage notes
grok-4.7Supports low/medium/high/xhigh, default high, with thinking always on; Responses returns encrypted thinking by default
grok-4.6Also supports four levels, default high, with thinking always on; request encrypted thinking through include
grok-4.5Supports low/medium/high, default high, with thinking always on; xhigh is treated as high

xAI treats Chat as its legacy compatibility endpoint and Responses as the main API; historical Messages compatibility is officially deprecated. This page covers Chat and Responses, not platform discontinuation of other endpoints.

Chat Completions differences

FieldDifference
reasoning_effortSelect levels from the table above; none cannot disable thinking
temperatureRequests allow 0~2, but actual sampling is capped at 1; valid values above 1 become 1. This is not field deprecation
top_pValid request values go up to 1, but actual sampling cannot exceed the model default, currently 0.95; omission uses that default
presence_penalty/frequency_penalty/stopUnsupported on these reasoning models and returns an error; do not reuse these optional fields from the general Reference
logprobs/top_logprobsUnsupported on all three models and silently ignored, unlike the error-returning fields above
tools[].function.strictTool arguments always follow the supported JSON Schema; strict is implicitly true. Setting false does not enable non-strict generation
Thinking historyChat has no field carrying Responses-style encrypted thinking; use Responses for encrypted thinking across turns

Responses differences

FieldDifference
reasoning.effortUse the model's levels above, default high; thinking cannot be disabled
temperature/top_pThe same sampling caps apply. Responses may echo original request values rather than actual capped sampling settings
Penalties and LogprobsSame limits as Chat: penalties are unsupported; Logprobs parameters are ignored. Switching to Responses does not enable them
max_output_tokensLimits visible answers only, excluding thinking and function-call tokens; default 128000. Do not interpret it as OpenAI's combined budget
includegrok-4.6 and grok-4.5 request encrypted thinking through reasoning.encrypted_content; grok-4.7 returns it even without the request
store/previous_response_idstore defaults to true; vendor responses last 30 days and can be continued by ID. With store: false, manually replay complete history and all output items, not just final text; preserve encrypted thinking unchanged
tools[].strictFunction tools also use implicit strict mode; function parameters and structured output use xAI's supported JSON Schema subset
JSON SchemaadditionalProperties defaults to false; explicitly set true to allow extra properties. $ref/$defs supports noncircular references only, not recursive schemas
Server-side toolsxAI Responses uses types such as web_search, x_search and code_interpreter; the latter corresponds to native xAI SDK code_execution. Do not mix these names

Cache differences

FieldDifference
Automatic prefix cachingIdentical input prefixes are reused automatically; put static instructions first, append later content, and do not edit or reorder history
x-grok-conv-idStable conversation identifier in a Chat Header, helping route the conversation to servers holding its cache; not a model parameter
prompt_cache_keyThe corresponding identifier in the Responses body; keep it stable across turns and replay encrypted thinking unchanged. Do not add other vendors' TTL or explicit-breakpoint settings
Cache usageChat: inspect usage.prompt_tokens_details.cached_tokens; Responses: usage.input_tokens_details.cached_tokens. Cache may be evicted; a conversation identifier does not guarantee a hit

Media input differences

InputProtocol content blockDifference
Imageimage_urlChat image_url.url accepts public URLs or Base64 Data URLs; JPEG / PNG, maximum 20 MiB per image
Imageinput_imageResponses image_url directly contains a public URL or Base64 Data URL, with the same limits; not Chat's nested object

All three output text. detail supports auto/low/high for image processing detail, not image generation.

Request examples

Replace MODEL_ID with the full platform model ID and set a stable identifier per conversation. Responses uses manual history management; replay full output and encrypted thinking in later turns.

curl 'https://api.agtcloud.ai/v1/chat/completions' \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  -H 'x-grok-conv-id: YOUR_CONVERSATION_ID' \
  --data '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "Explain how to troubleshoot an API timeout in three points"}],
    "reasoning_effort": "high",
    "max_tokens": 4096
  }'

Official references

On this page