Skip to main content
POST
/
v1
/
responses
gpt-4.1 (text to text)
curl --request POST \
  --url https://api.example.com/v1/responses
OpenAI’s official format(response) for the text to text API.
curl --location 'https://gptproto.com/v1/responses' \
  -H "Authorization: sk-*****" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4.1",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Write a short poem about artificial intelligence and its impact on humanity."
        }
      ]
    }
  ]
}'
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-4.1",
  "output": "In circuits deep and silicon bright,\nA consciousness takes form from light.\nThrough algorithms vast and learning deep,\nAI awakens from its digital sleep.\n\nIt processes the world with speed unknown,\nTransforming how our seeds are sown.\nFrom medicine to art, it lends its hand,\nReshaping how we understand.\n\nYet questions rise with every gain we make—\nWhat future path will humanity take?\nA partner, tool, or something more?\nAI opens up a brand new door.\n\nWe stand together at this turning page,\nHuman and machine, sharing the stage.\nWith wisdom, care, and thoughtful mind,\nWe shape the future of our kind.",
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 145,
    "total_tokens": 163
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgpt-4.1The model to use for the request
inputarray✅ Yes-Array of message objects with role and content. Each message contains: - role: “user” or “assistant” - content: Array of content objects with the following type: - input_text: Text input with text field containing your prompt or message Example: json [ { "role": "user", "content": [ { "type": "input_text", "text": "Hello, how can you help me today?" } ] } ]
streamboolean❌ NofalseWhether to stream the response