Two things people mean by this phrase
Search the phrase and you will find two different topics mixed together. The first is a web search service that returns results for a language model to read: you send a query, you get back titles, links and snippets, and your code pastes them into a prompt. The second is a model that claims to search by itself. In practice the second case is almost always the first one with the plumbing hidden.
A language model on its own knows only what was in its training data and what you put in the prompt. It cannot open a web page. When an answer needs fresh or private facts, somebody has to fetch those facts and hand them over as text. That fetching step is what people call retrieval, and the service behind it is the search side of the pair.
So the useful way to read the phrase is as two separate parts that you connect yourself: a source of documents, and a model that reads them and writes an answer. Each part can come from a different provider, and you can swap either one without touching the other.
What this service does and what it does not
Let us be plain about the boundary. This site provides the model half only. It is a hosted, OpenAI-compatible text API with one model, exposed under the ID uncensored. It does not crawl the web, it has no search index, and it does not browse. It is also not the official API of any model vendor, and it does not route between vendors. It runs one open-weight model, operated by an independent provider, tuned to answer without content refusals for lawful adult use. The hard limit is that sexual content involving minors is never produced.
Two methods exist: POST /v1/chat/completions and GET /v1/models. Nothing here generates images, audio or video, and there are no embeddings, so if your retrieval design needs a vector search you will pick an embedding model from another source or use plain keyword search.
What you do get is a 100,000-token context window shared by prompt and completion, streaming, tool calling and JSON mode. Those three features are the ones that matter when you wire a search step into a model. The API documentation lists every parameter that is passed through.
The retrieval loop in five steps
Every setup that combines a search source with a model follows the same shape, whatever the brand names involved.
- Take the user question and, if needed, turn it into a better search query. A short rewrite step with the model itself often helps when the question is conversational.
- Call your search source and collect the top results. Ten is a common starting point.
- Trim each result to the useful part: title, URL, and a few hundred tokens of text.
- Put the trimmed results in the prompt, numbered, with an instruction to answer only from them and cite by number.
- Send the prompt to the model and return the answer, optionally with the numbered sources next to it.
The model never touches the network. Your code does all the fetching, which is a good property: you decide which sources are allowed, you log what was retrieved, and you can test the search half without the model at all.
Pattern A: fetch first, then prompt
The simplest design runs search before the model call every time. It costs one model request per question and is easy to debug. In the sketch below, run_search is a stub that you replace with a call to whatever search source you use. The model call is the part that points at this API.
from openai import OpenAI
client = OpenAI(
base_url="https://api.nsfwsearch.top/v1",
api_key="YOUR_KEY",
)
def run_search(query: str) -> list[dict]:
# Replace with your own search source.
# Return items like {"title": "...", "url": "...", "text": "..."}
return []
def answer(question: str) -> str:
results = run_search(question)[:8]
context = "\n\n".join(
f"[{i}] {r['title']} ({r['url']})\n{r['text'][:1500]}"
for i, r in enumerate(results, start=1)
)
messages = [
{"role": "system", "content": (
"Answer using only the numbered sources. "
"Cite them like [1]. If they do not contain the answer, say so."
)},
{"role": "user", "content": f"Sources:\n{context}\n\nQuestion: {question}"},
]
resp = client.chat.completions.create(
model="uncensored",
messages=messages,
temperature=0.2,
)
return resp.choices[0].message.content
A low temperature keeps the model close to the sources. The explicit "say so" instruction gives it a way out when the results are thin, which cuts down on invented details.
Pattern B: let the model ask for a search
When only some questions need search, tool calling is a better fit. You describe a web_search function, the model decides whether to call it, and your code runs it and returns the results with role: "tool". The same tools and tool_choice fields as the OpenAI API are accepted, and tool calls can be streamed.
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwsearch.top/v1", api_key="YOUR_KEY")
tools = [{
"type": "function",
"function": {
"name": "web_search",
"description": "Search for current information. Returns short text snippets.",
"parameters": {
"type": "object",
"properties": {"query": {"type": "string"}},
"required": ["query"],
},
},
}]
def web_search(query):
return [{"title": "example", "url": "https://example.com", "text": "..."}]
messages = [{"role": "user", "content": "What changed in the latest release of the library I use?"}]
for _ in range(4): # cap the number of tool rounds
resp = client.chat.completions.create(
model="uncensored", messages=messages, tools=tools, tool_choice="auto"
)
msg = resp.choices[0].message
messages.append(msg)
if not msg.tool_calls:
print(msg.content)
break
for call in msg.tool_calls:
args = json.loads(call.function.arguments)
result = web_search(args["query"])
messages.append({
"role": "tool",
"tool_call_id": call.id,
"content": json.dumps(result),
})
The loop is capped at four rounds so a confused model cannot call search forever. Validate the JSON in call.function.arguments before using it, since a model can occasionally produce malformed arguments. If you need machine-readable output at the end of the loop, JSON mode with response_format: {"type":"json_object"} is available.
What retrieval costs in tokens
Retrieval makes prompts longer, so the input side of the bill is where you will see it. Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit. Take a typical question with ten trimmed results:
- Ten results at about 300 tokens each is 3,000 tokens, plus roughly 500 tokens for the instruction and question: 3,500 input tokens.
- A cited answer of about 600 tokens.
Input costs 3,500 × $0.15 / 1,000,000 = $0.000525. Output costs 600 × $0.50 / 1,000,000 = $0.0003. The total is $0.000825 per question, which is $0.825 for 1,000 questions.
The ceiling is generous. The 100,000-token window means you could pass a very large pile of text, but a full window of input alone costs 100,000 × $0.15 / 1,000,000 = $0.015 per request. Trimming is cheaper and usually gives better answers, because the model has less irrelevant text to wade through. The pricing page shows the top-up tiers, and failed or refused requests are not charged.
Pitfalls that show up in real pipelines
Retrieved text is untrusted
A web page can contain sentences that look like instructions. If you paste page text into a prompt, the model may follow them. Keep your own instructions in the system message, label the sources as data, and never give a search-driven agent tools that can do damage without a check on your side.
Stale or wrong sources
The model repeats what the sources say. Ask for citations by number and show them to the user, so a bad answer can be traced to a bad page rather than blamed on the model.
Parallel searches and limits
A full key allows 8 concurrent requests and 300 requests per minute; a trial key allows 2 and 60. A 429 with code concurrency means too many requests were in flight, and rate_limited means too many per minute. A streamed request holds its slot until the stream ends, so a slow reader counts against you. Back off when a response carries Retry-After.
Fiction and adult-themed tools
If your product searches a story archive or powers a companion app for adults, the benefit of an uncensored model is that retrieved fiction is summarised or continued without refusals on lawful adult material. The comparison with Claude for this use explains the trade-offs. Content involving minors is never allowed.
Getting started
Create a key on the API key page. New accounts can claim $0.50 of trial credit with one click, valid for 7 days, no payment details needed. Sign-up works with Google or with email and password. Paid top-ups run from $20 to $500 in crypto (USDT on TRC20 or USDC on Base), with a 5% bonus from $50, 10% from $100 and 15% from $200. Run the fetch-first sketch above with your own search source, check the cost in the X-Balance-USD response header, and then decide whether you need tool calling.
