# Doubao Search (Global)

> Common

Submit a Doubao Search (Global) request. `model` is fixed to `doubao-web-search-global`;
all other fields are Doubao native parameters (PascalCase), forwarded as-is.

## Endpoint

`POST https://api.modelverse.cn/v1/web_search`

## Request Body

## Responses

- **200** — Doubao Global native response. Success requires HTTP 200, an empty `Error.Code`, and `Result.ErrorCode` = 0.
- **default** — Error response (gateway-side parameter/auth error or upstream non-200).

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "ModelVerse Doubao Search (Global) API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse **Doubao Search (Global)** web search model.\nUnified endpoint `POST /v1/web_search`; the `model` field in the body selects the provider\n(stripped before forwarding). All other fields are Doubao Search native parameters (PascalCase),\nforwarded and returned as-is without normalization. The response is non-streaming.\n⚠️ The Global version's request/response fields differ entirely from the Custom version\n(`DocCount` + `Documents[]` instead of `Count` + `WebResults[]`).\nBilling: each successful call counts as 1; success requires HTTP 200, an empty `ResponseMetadata.Error.Code`,\nand `Result.ErrorCode` equal to 0; otherwise it is not billed.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint."
    }
  ],
  "tags": [
    {
      "name": "Web Search",
      "description": "Doubao Search (Global) web search."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/web_search": {
      "post": {
        "tags": [
          "Web Search"
        ],
        "operationId": "createDoubaoWebSearchGlobal",
        "summary": "Doubao Search (Global)",
        "description": "Submit a Doubao Search (Global) request. `model` is fixed to `doubao-web-search-global`;\nall other fields are Doubao native parameters (PascalCase), forwarded as-is.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DoubaoGlobalRequest"
              },
              "examples": {
                "globalSearch": {
                  "summary": "Web search",
                  "value": {
                    "model": "doubao-web-search-global",
                    "Query": "recommended attractions around Beijing",
                    "DocCount": 2,
                    "MaxSnippetLength": 500,
                    "MaxImageCountPerDoc": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Doubao Global native response. Success requires HTTP 200, an empty `Error.Code`, and `Result.ErrorCode` = 0.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoubaoGlobalResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Success response (excerpt)",
                    "value": {
                      "ResponseMetadata": {
                        "RequestId": "...",
                        "Error": {
                          "Code": "",
                          "Message": ""
                        }
                      },
                      "Result": {
                        "TotalDocCount": 2,
                        "Documents": [
                          {
                            "Rank": 1,
                            "Url": "https://...",
                            "Title": "...",
                            "Snippet": [
                              {
                                "Type": "text",
                                "Text": "..."
                              }
                            ],
                            "DocumentInfo": {
                              "ContentCharCount": 1234,
                              "ContentTokenCount": 456,
                              "Filetype": "webpage",
                              "PublishTime": "2026-01-01"
                            },
                            "HostInfo": {
                              "Hostname": "...",
                              "IconUrl": "https://...",
                              "AuthorityLevel": "high"
                            }
                          }
                        ],
                        "ErrorCode": 0,
                        "ErrorMsg": ""
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response (gateway-side parameter/auth error or upstream non-200).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/WebSearchError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "Platform API Key, passed via `Authorization: Bearer <API Key>`."
      }
    },
    "schemas": {
      "DoubaoGlobalRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "model",
          "Query"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "doubao-web-search-global",
            "description": "Routing identifier, fixed to `doubao-web-search-global`; stripped before forwarding."
          },
          "Query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Search query, 1–100 characters."
          },
          "SearchType": {
            "type": "string",
            "default": "web",
            "description": "Search type, default `web`."
          },
          "DocCount": {
            "type": "integer",
            "maximum": 20,
            "description": "Number of results; ≤ 20, default 10 for web / 5 for image."
          },
          "MaxSnippetLength": {
            "type": "integer",
            "maximum": 3000,
            "description": "Maximum snippet length, default 500, max 3000."
          },
          "MaxImageCountPerDoc": {
            "type": "integer",
            "maximum": 10,
            "description": "Maximum images per document, default 3, max 10."
          },
          "Filter": {
            "$ref": "#/components/schemas/DoubaoGlobalFilter"
          },
          "ImageFilter": {
            "type": "object",
            "additionalProperties": true,
            "description": "Image size / aspect-ratio filter."
          }
        }
      },
      "DoubaoGlobalFilter": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "IcpHostOnly": {
            "type": "boolean",
            "description": "Only return sites with an ICP filing."
          }
        }
      },
      "DoubaoGlobalResponse": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "ResponseMetadata": {
            "$ref": "#/components/schemas/DoubaoResponseMetadata"
          },
          "Result": {
            "$ref": "#/components/schemas/DoubaoGlobalResult"
          }
        }
      },
      "DoubaoResponseMetadata": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "RequestId": {
            "type": "string",
            "description": "Unique request identifier."
          },
          "Error": {
            "$ref": "#/components/schemas/DoubaoError"
          }
        }
      },
      "DoubaoError": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "Code": {
            "type": "string",
            "description": "Business error code; empty string on success."
          },
          "Message": {
            "type": "string",
            "description": "Business error message; empty string on success."
          }
        }
      },
      "DoubaoGlobalResult": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "TotalDocCount": {
            "type": "integer",
            "description": "Total number of returned documents."
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DoubaoGlobalDocument"
            },
            "description": "Document result list."
          },
          "ErrorCode": {
            "type": "integer",
            "description": "Business error code; 0 on success."
          },
          "ErrorMsg": {
            "type": "string",
            "description": "Business error message; empty string on success."
          }
        }
      },
      "DoubaoGlobalDocument": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "Rank": {
            "type": "integer",
            "description": "Ranking position."
          },
          "Url": {
            "type": "string",
            "format": "uri",
            "description": "Document URL."
          },
          "Title": {
            "type": "string",
            "description": "Document title."
          },
          "Snippet": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Snippet segment list; elements include `Type` (text/image), `Text`, `Image`, etc."
          },
          "DocumentInfo": {
            "type": "object",
            "additionalProperties": true,
            "description": "Document info; includes ContentCharCount, ContentTokenCount, Filetype, PublishTime."
          },
          "HostInfo": {
            "type": "object",
            "additionalProperties": true,
            "description": "Host info; includes Hostname, IconUrl, AuthorityLevel."
          }
        }
      },
      "WebSearchErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/WebSearchError"
          }
        }
      },
      "WebSearchError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message",
          "type",
          "code",
          "param"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error description."
          },
          "type": {
            "type": "string",
            "description": "Error type.",
            "examples": [
              "invalid_request_error"
            ]
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code.",
            "examples": [
              "error_code"
            ]
          },
          "param": {
            "type": "string",
            "description": "Request ID, for feedback or troubleshooting."
          }
        }
      }
    },
    "examples": {
      "WebSearchError": {
        "summary": "Standard JSON error response",
        "value": {
          "error": {
            "message": "error description",
            "type": "invalid_request_error",
            "code": "error_code",
            "param": "<request ID, for feedback or troubleshooting>"
          }
        }
      }
    }
  }
}
```
