Skip to main content
POST
/
v1
/
responses
Web Search
curl --request POST \
  --url https://gptproto.com/v1/responses \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "input": [
    {}
  ],
  "tools": [
    {}
  ],
  "stream": true
}'
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-41-nano",
  "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
  }
}

Overview

This endpoint provides web search functionality using advanced language models in response mode. Send search queries and receive AI-generated responses enhanced with real-time web search results. Perfect for getting up-to-date information, news, research, and factual data from across the internet.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: sk-*****

Request Body

model
string
default:"gpt-41-nano"
required
The model to use for the request. Web search functionality is available for all models.
input
array
required
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:
[
  {
    "role": "user",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ],
    "content": [
      {
        "type": "input_text",
        "text": "What are the latest developments in artificial intelligence in 2025?"
      }
    ]
  }
]
tools
array
default:"[{\"type\": \"web_search_preview\"}]"
required
Array of tool objects to enable special capabilities. For web search functionality, include:
[
  {
    "type": "web_search_preview"
  }
]
Available tool types:
  • web_search_preview: Enables real-time web search to enhance responses with current information
stream
boolean
default:false
Whether to stream the response

Request Example

curl --location 'https://gptproto.com/v1/responses' \
  -H "Authorization: sk-*****" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-41-nano",
  "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?"
        }
      ]
    }
  ],
}'

Response

id
string
Unique identifier for the response
object
string
Object type, always “response”
created
integer
Unix timestamp of when the response was created
model
string
The model used for generating the response
output
string
The generated text output enhanced with web search results
web_search_results
array
Array of web search results used to generate the response (optional, only included when web_search is enabled)
usage
object
Token usage statistics
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-41-nano",
  "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
  }
}