# Exa Web Search

> Common

Submit an Exa web search request. `model` is fixed to `exa-web-search`; all other fields
are Exa native parameters, forwarded as-is.

## Endpoint

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

## Request Body

## Responses

- **200** — Exa native search results.
- **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 Exa Web Search API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse **Exa Search** 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 Exa's native parameters, forwarded and\nreturned as-is without normalization. The response is non-streaming JSON.\nBilling: each successful call counts as 1; upstream non-200 responses are treated as failures and not billed.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint."
    }
  ],
  "tags": [
    {
      "name": "Web Search",
      "description": "Exa web search."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/web_search": {
      "post": {
        "tags": [
          "Web Search"
        ],
        "operationId": "createExaWebSearch",
        "summary": "Exa Web Search",
        "description": "Submit an Exa web search request. `model` is fixed to `exa-web-search`; all other fields\nare Exa native parameters, forwarded as-is.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExaWebSearchRequest"
              },
              "examples": {
                "deepSearch": {
                  "summary": "Deep search returning highlights and page text",
                  "value": {
                    "model": "exa-web-search",
                    "query": "latest advances in large language models",
                    "numResults": 10,
                    "type": "deep",
                    "contents": {
                      "text": true,
                      "highlights": {
                        "numSentences": 3,
                        "highlightsPerUrl": 1
                      },
                      "subpages": 3,
                      "subpageTarget": "sources"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exa native search results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExaWebSearchResponse"
                },
                "examples": {
                  "results": {
                    "summary": "Search results",
                    "value": {
                      "results": [
                        {
                          "title": "...",
                          "url": "https://...",
                          "publishedDate": "2026-01-01",
                          "author": "...",
                          "score": 0.87,
                          "highlights": [
                            "..."
                          ],
                          "text": "..."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "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": {
      "ExaWebSearchRequest": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "model",
          "query"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "exa-web-search",
            "description": "Routing identifier, fixed to `exa-web-search`; stripped before forwarding."
          },
          "query": {
            "type": "string",
            "description": "Search query."
          },
          "numResults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "description": "Number of results to return; currently only values ≤ 10 are supported."
          },
          "type": {
            "type": "string",
            "enum": [
              "auto",
              "instant",
              "fast",
              "deep"
            ],
            "description": "Search type."
          },
          "contents": {
            "$ref": "#/components/schemas/ExaContents"
          }
        }
      },
      "ExaContents": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "text": {
            "type": "boolean",
            "description": "Whether to return the web page body."
          },
          "highlights": {
            "$ref": "#/components/schemas/ExaHighlights"
          },
          "subpages": {
            "type": "integer",
            "description": "Number of subpages to fetch."
          },
          "subpageTarget": {
            "type": "string",
            "description": "Subpage fetch target, e.g. `sources`."
          },
          "summary": {
            "type": "object",
            "additionalProperties": true,
            "description": "Not supported yet."
          }
        }
      },
      "ExaHighlights": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "numSentences": {
            "type": "integer",
            "description": "Number of sentences per highlight."
          },
          "highlightsPerUrl": {
            "type": "integer",
            "description": "Number of highlights per URL."
          },
          "query": {
            "type": "string",
            "description": "Query used to generate highlights (optional)."
          }
        }
      },
      "ExaWebSearchResponse": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExaResult"
            },
            "description": "Search result list."
          }
        }
      },
      "ExaResult": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "title": {
            "type": "string",
            "description": "Result title."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Result URL."
          },
          "publishedDate": {
            "type": "string",
            "description": "Published date."
          },
          "author": {
            "type": "string",
            "description": "Author."
          },
          "score": {
            "type": "number",
            "description": "Relevance score."
          },
          "highlights": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Highlight excerpts."
          },
          "text": {
            "type": "string",
            "description": "Web page body (returned when `contents.text=true`)."
          }
        }
      },
      "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>"
          }
        }
      }
    }
  }
}
```
