Grok 4.3
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /grok/v1/responses
Full URL: https://ai.modelfold.online/grok/v1/responses
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Grok 4.3 uses an OpenAI Responses–compatible endpoint (input/output items and response.* streaming events).
Multimodal Input — Supports mixed text, image, and file inputs in a single message.
Reasoning Control — Adjustable reasoning effort from low to xhigh.
Tools — Function calling.
Tools & tool_choice
The tools array enables function calling.
Function Calling
Define business functions that the model can call when needed:
{
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location", "unit"]
}
}
],
"tool_choice": "auto"
}When function tools are configured in tools, set tool_choice to "auto" so the model can decide when to call them.
If you do not configure any function tools, omit the tool_choice field.
Error handling
Check the response body, not only the HTTP status. Errors are returned either as {"code": ..., "msg": "..."} (for example 401 invalid API key, 402 insufficient credits, 429 rate limited; the HTTP status may still be 200) or as {"error": {"type": "...", "message": "..."}}.
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Target model name. Allowed values: grok-4-3. 示例:grok-4-3。 |
stream | boolean | No | When true, responses stream in real time as server-sent events. When false, the full response is returned at once after completion. Default is true. Default:true。 示例:true。 |
input | `string | array<object>` | Yes |
reasoning | object | No | Reasoning configuration for the model. |
reasoning.effort | string | No | Reasoning effort: low, medium, high or xhigh. If omitted, the model chooses its own effort. Set "low" for faster, cheaper answers. Reasoning tokens are billed as output tokens. Allowed values:low / medium / high / xhigh。 示例:low。 |
tools | array<object> | No | Optional tools that the model may call. Supports function calling. |
text | object | Yes | — |
Request Example
curl -X POST "https://ai.modelfold.online/grok/v1/responses" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4-3",
"stream": true,
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Hello, please reply in Chinese"
}
]
}
],
"text": {
"format": {
"type": "json_schema",
"name": "basic_response",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "Response content"
},
"mood": {
"type": "string",
"description": "Mood when responding"
}
},
"required": [
"answer",
"mood"
],
"additionalProperties": false
}
}
}
}'{
"model": "grok-4-3",
"stream": true,
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Hello, please reply in Chinese"
}
]
}
],
"text": {
"format": {
"type": "json_schema",
"name": "basic_response",
"strict": true,
"schema": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "Response content"
},
"mood": {
"type": "string",
"description": "Mood when responding"
}
},
"required": [
"answer",
"mood"
],
"additionalProperties": false
}
}
}
}Response
200 — Request successful.
"{\n \"output\": [\n {\n \"type\": \"reasoning\",\n \"id\": \"rs_xxx\",\n \"summary\": []\n },\n {\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"id\": \"msg_xxx\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Hello! How can I help you today?\"\n }\n ],\n \"status\": \"completed\"\n }\n ],\n \"usage\": {\n \"total_tokens\": 4490,\n \"output_tokens\": 47,\n \"input_tokens\": 4443\n },\n \"credits_consumed\": 0.48,\n \"status\": \"completed\"\n}"400 — Bad request.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Invalid request parameters。 |
error.type | string | 否 | 示例:invalid_request_error。 |
{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}401 — Unauthorized.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Unauthorized。 |
error.type | string | 否 | 示例:authentication_error。 |
{
"error": {
"message": "Unauthorized",
"type": "authentication_error"
}
}429 — Too many requests.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Rate limit exceeded。 |
error.type | string | 否 | 示例:rate_limit_error。 |
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}