Skip to main content
POST
/
v1
/
responses
gpt-4.1 (web search)
curl --request POST \
  --url https://api.example.com/v1/responses
OpenAI’s official format(response) for the web search API.
curl --location 'https://gptproto.com/v1/responses' \
  -H "Authorization: sk-*****" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4.1",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ],
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What are the latest breakthroughs in quantum computing and their potential applications?"
        }
      ]
    }
  ]
}'
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-4.1",
  "output": "# Latest Breakthroughs in Quantum Computing (2025)\n\nBased on recent developments, here are the most significant quantum computing breakthroughs:\n\n## Major Advances\n\n1. **Error Correction Milestone**: Researchers have achieved a major breakthrough in quantum error correction, demonstrating stable qubits that can maintain coherence for extended periods. This advancement brings us closer to practical, large-scale quantum computers.\n\n2. **Quantum Supremacy Expansion**: Multiple companies have demonstrated quantum advantage in solving real-world problems beyond random circuit sampling, including:\n   - Molecular simulation for drug discovery\n   - Optimization problems in logistics\n   - Financial modeling and risk analysis\n\n3. **Scalability Progress**: New architectures supporting 1000+ qubits have been unveiled, with improved connectivity and reduced noise levels.\n\n## Potential Applications\n\n### Healthcare & Pharmaceuticals\n- Accelerated drug discovery through molecular simulation\n- Personalized medicine optimization\n- Disease modeling and treatment planning\n\n### Finance & Cryptography\n- Advanced risk modeling\n- Portfolio optimization\n- Development of quantum-resistant encryption\n\n### Materials Science\n- Discovery of new materials with specific properties\n- Battery technology improvements\n- Superconductor research\n\n### Artificial Intelligence\n- Enhanced machine learning algorithms\n- Quantum neural networks\n- Faster optimization for AI training\n\n### Climate & Energy\n- Climate modeling improvements\n- Energy grid optimization\n- Carbon capture technology development\n\nThese developments suggest we're entering a new era where quantum computing is transitioning from theoretical research to practical applications across multiple industries.",
  "web_search_results": [
    {
      "title": "Quantum Computing Breakthrough: Error Correction Milestone Reached",
      "url": "https://example.com/quantum-breakthrough-2025",
      "snippet": "Scientists have achieved a major breakthrough in quantum error correction, paving the way for practical quantum computers...",
      "published_date": "2025-01-15"
    },
    {
      "title": "IBM Unveils 1000-Qubit Quantum Processor",
      "url": "https://example.com/ibm-quantum-processor",
      "snippet": "IBM has announced a new quantum processor with over 1000 qubits, representing a significant leap in quantum computing capability...",
      "published_date": "2025-01-10"
    },
    {
      "title": "Quantum Computing Applications in Drug Discovery",
      "url": "https://example.com/quantum-drug-discovery",
      "snippet": "Pharmaceutical companies are leveraging quantum computing to accelerate drug discovery processes...",
      "published_date": "2025-01-08"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 385,
    "total_tokens": 410
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgpt-4.1The model to use for the request. Web search functionality is available for all models.
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 search query or question Example: json [ { "role": "user", "tools": [ { "type": "web_search_preview" } ], "content": [ { "type": "input_text", "text": "What are the latest developments in artificial intelligence in 2025?" } ] } ]
toolsarray✅ Yes-Array of tool objects to enable special capabilities. For web search functionality, include: json [ { "type": "web_search_preview" } ] Available tool types: - web_search_preview: Enables real-time web search to enhance responses with current information
streamboolean❌ NofalseWhether to stream the response