Text Generation

Generate text completions using the /v1/responses endpoint. Send a model and input array to receive a generated response.

curl -X POST http://localhost:18645/v1/responses   -H 'Authorization: Bearer anything'   -H 'Content-Type: application/json'   -d '{
  "model": "grok-4.3",
  "input": [
    {"role": "user", "content": "Explain quantum computing in one paragraph."}
  ]
}'

Parameters

model — Model ID (e.g. grok-4.3).

input — Array of message objects with role and content.

temperature — Sampling temperature (0–2, default 1).

max_output_tokens — Maximum tokens in the response.

Response

{
  "id": "resp_abc123",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{"type": "output_text", "text": "..."}]
    }
  ],
  "usage": {"input_tokens": 25, "output_tokens": 140}
}