GET
/v1/schemas/grok/chat/v1/messages?kind=output
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source tracec2cb407652af94851e654028edb7ccef4ca55d38c384ab649f1984293022ae71{
"fetchedAt": 1788412236,
"extractorVersion": "1",
"verifiedAt": null
} |
Response body
8 properties · 6 required · 2 $defs| property | type | description | constraints |
|---|---|---|---|
| content* | MessageResponseContent[] | Response message content. | |
| id* | string | Unique object identifier. | |
| model* | string | Model name that handled the request. | |
| role* | string | Role of the generated message. Always `"assistant"` | |
| type* | string | Object type. This is always `"message"` for message types. | |
| usage* | MessageUsage | Token usage information. | |
| stop_reason | any | Reason to stop. `"stop_sequence"` means the inference has reached a model-defined or user-supplied stop sequence in `stop`. `"max_tokens"` means the inference result has reached models' maximum allowed token length or user defined value in `max_tokens`. `"end_… | |
| stop_sequence | any | Custom stop sequence used to stop the generation. |
Types
2 $defsMessageResponseContentobject | object | object | …
MessageUsageobject
| cache_creation_input_tokens* | integer | (Unsupported) Number of tokens written to the cache when creating a new entry. | format: int32 |
| cache_read_input_tokens* | integer | Number of tokens retrieved from the cache for this request. | format: int32 |
| input_tokens* | integer | Number of input tokens not served from cache (Anthropic semantics). | format: int32 |
| output_tokens* | integer | Number of output tokens used | format: int32 |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"grok","endpointId":"v1/messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}