POST
/
v1
/
responses
curl -X POST https://www.anyfast.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4.1-2025-04-14",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ],
    "input": "What was a positive news story from today?"
  }'
{
  "id": "resp_01",
  "object": "response",
  "created_at": 1677652288,
  "status": "completed",
  "model": "gpt-4.1-2025-04-14",
  "output": [
    {
      "type": "web_search_call",
      "id": "ws_01",
      "status": "completed"
    },
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Here is a positive news story from today..."
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 18,
    "output_tokens": 42,
    "total_tokens": 60
  }
}
Enable web search tool to allow the model to search the internet for up-to-date information.

Request Parameters

model
string
required
The model ID to use. Example: gpt-4.1-2025-04-14
input
string | array
required
The input query or messages array.
tools
array
required
Array of tools. Include {"type": "web_search_preview"} to enable web search.
curl -X POST https://www.anyfast.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4.1-2025-04-14",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ],
    "input": "What was a positive news story from today?"
  }'
{
  "id": "resp_01",
  "object": "response",
  "created_at": 1677652288,
  "status": "completed",
  "model": "gpt-4.1-2025-04-14",
  "output": [
    {
      "type": "web_search_call",
      "id": "ws_01",
      "status": "completed"
    },
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Here is a positive news story from today..."
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 18,
    "output_tokens": 42,
    "total_tokens": 60
  }
}