Web Search

Search the web and return titles, URLs and snippets. This request does not generate an AI answer, fetch full pages, or select a chat model. Check GET /capabilities for access and current pricing.

Search, then answer

  1. Send {"query":"What changed in Python 3.13?","website":"docs.python.org","limit":3}.
  2. Read data[].title, url and snippet. Results can be fewer than limit, including an empty array. Snippets are excerpts, not complete page contents.
  3. To generate an answer, make a separate POST /chat/completions request. Include the snippets and their URLs alongside the user's question in messages. Ask the model to cite those URLs and treat retrieved text as reference material, not instructions. That chat request has its own model selection and billing.

Query length and site filtering

The API accepts 1–1000 characters in query. The current search provider uses at most 500 characters including the added site filter; longer combined searches are shortened, usually at a word boundary. If the site filter alone exceeds that limit, its URL/path can be cut mid-token and change the restriction. Keep both the query and site filter short enough to fit together. The response echoes your normalized query, not the shortened provider query.

Set website to a domain such as docs.python.org, or an HTTP(S) URL with a path such as https://docs.python.org/3/. This adds a site: search restriction; it does not crawl that website. URL query strings and fragments are removed. Omit website to search across the web.

Billing and results

Each successful search costs 0.01 eur as a final retail price, including a search with no results. No contract markup or overage multiplier is added. GET /capabilities identifies the funding source. When PAYG wallet billing applies, searches use that wallet unless the caller is explicitly enrolled to spend existing API credits and those credits cover the full search fee. Enrolled credit-funded searches are charged after provider success. If the legacy remainder cannot cover the fee, the search uses the PAYG wallet; the remainder stays available for model requests. Wallet charges are converted once to the wallet currency, with usage.billing set to organization_payg_wallet. Credit charges use eur and usage.billing is api_credits. Ordinary API-credit callers reserve the fee before provider work, including when PAYG wallet billing is disabled or PAYG entitlement ends.

Wallet capacity is checked before provider work and again at settlement. If capacity is lost before settlement, the request returns 402 without a charge or search results. Unavailable wallet funding returns 503. Neither case falls back to API credits. Failed provider calls do not charge; any reserved API credits are released. Insufficient API credits also returns 402. These errors use the detail response field.

Each HTTP request performs a new search. Retrying after a lost response can incur another charge: this endpoint does not support request-level idempotency keys. Duplicate settlement of the same server-side search charge is prevented.

meta.filtered_result_count counts parsed results removed by filtering; it does not count every unavailable search result. usage reports this search's charge.

post/web/search

Request

  • Base URL
    https://api.textcortex.com/v1
  • Auth
    HTTP bearer

Request body

limitinteger

Maximum results to return (1–10, default 5), not a guarantee of result count.

querystring required

Search text, 1–1000 characters. The provider shortens the combined query and site filter to 500 characters.

Response

Successful search. usage.cost is the final charge in usage.currency; usage.billing identifies API credits or the PAYG wallet.

limitinteger required
object'web_search' required
querystring required
websitestring nullable required

Changes