One flat price per answer, no token math, credits never expire.
One API call. AI answers grounded in real-time web search, with inline citations, sources, and confidence scores. OpenAI-compatible. Built for developers.
Switching from Perplexity Sonar? Change 2 lines →
*Median of 4,885 real /v1/answer calls, 14 Oct – 13 Nov 2026, measured at our server.
Get a grounded AI answer in one API call.
curl -X POST https://api.miapi.uk/v1/answer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "question": "What is quantum computing?", "citations": true, "include_sources": true }'
import requests response = requests.post( "https://api.miapi.uk/v1/answer", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "question": "What is quantum computing?", "citations": True } ) data = response.json() print(data["answer"]) # "Quantum computing uses qubits to perform calculations [1]..." print(data["sources"]) # [{"title": "...", "url": "...", "snippet": "..."}]
const response = await fetch("https://api.miapi.uk/v1/answer", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ question: "What is quantum computing?", citations: true }) }); const data = await response.json(); console.log(data.answer); // Grounded answer with [1][2] citations console.log(data.sources); // Array of source URLs
# Just change base_url — your existing OpenAI code works instantly from openai import OpenAI client = OpenAI( api_key="YOUR_MIAPI_KEY", base_url="https://api.miapi.uk/v1" # ← just this line ) response = client.chat.completions.create( model="miapi-grounded", messages=[{"role": "user", "content": "What is quantum computing?"}] ) print(response.choices[0].message.content) # Real-time web-grounded answer with citations!
Everything you need in one API. Nothing you don't.
Every answer is written from a real-time web search, and the sources come with it, so you can check every claim.
Get answers with [1][2] citation markers linked to sources. Professional, verifiable, trustworthy.
Drop-in replacement for /v1/chat/completions. Change one URL and your existing code works instantly.
Pass a conversation_id and follow-ups just work. "How old is he?" resolves against what came before, and it recalls relevant points from earlier in the thread.
Pass your own documents. Get answers from your data, web search, or both combined. Perfect for RAG.
Real-time Server-Sent Events streaming. Show answers as they generate, just like ChatGPT.
Get raw search results without LLM processing. Bring your own model. Built for LangChain and RAG pipelines.
Dedicated news endpoint with article dates, sources, and snippets. Real-time news intelligence.
Find images from across the web with titles, thumbnails, dimensions, and source URLs.
About 2.2s median response. Built-in caching with X-Cache headers, so repeat questions come back almost instantly.
What it costs to get an AI-written answer with sources back from each API.
| Provider | Per 1,000 answers | How it is priced |
|---|---|---|
| MIAPI | $2.50–$3.60 | One flat price per answer, AI answer included. One-time packs from $9, credits never expire, 100 free queries a month. |
| Brave Answers | $4 + tokens | $4 per 1,000 requests plus $5 per million tokens. |
| You.com Answer API | $5 | $5 per 1,000 calls. |
| Exa answer | $5 | $5 per 1,000 requests to /answer. |
| Linkup sourced answer | $6 | $0.006 per standard-depth call ($0.055 for deep). |
| Tavily | ≈ $8 | $0.008 per credit pay-as-you-go; a basic search is 1 credit. 1,000 free credits a month. |
| OpenAI web search tool | $10 + tokens | $10 per 1,000 calls plus search content tokens at model rates. |
| Google Gemini grounding | $14 + tokens | $14 per 1,000 grounded requests after 5,000 free a month (Gemini 3 and newer), plus model tokens. |
2–5x cheaper than Tavily, OpenAI and Gemini, with one flat price per answer and no token math.
Published pay-as-you-go prices from each provider's own pricing page, checked 13 November 2026. ≈ marks an estimate: the real cost depends on tokens used, plan usage or settings. Some subscription plans can work out cheaper per answer if you use your whole monthly allowance. The “55–82% cheaper” figure compares MIAPI's $2.50–$3.60 with Tavily ($8), OpenAI web search ($10 + tokens) and Gemini grounding ($14 + tokens) per 1,000, before their token charges. Prices change, so follow the links for today's figures.
MIAPI speaks the OpenAI chat-completions format, so code written for Sonar keeps working. Swap your API key and the base URL, and that is it. Any model name is accepted; we suggest miapi-grounded. Streaming works too.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_MIAPI_KEY", # was: your Perplexity key
base_url="https://api.miapi.uk/v1", # was: https://api.perplexity.ai
)
resp = client.chat.completions.create(
model="miapi-grounded",
messages=[{"role": "user", "content": "What is the tallest building in the world?"}],
)
print(resp.choices[0].message.content)stream = client.chat.completions.create(
model="miapi-grounded",
messages=[{"role": "user", "content": "What is the tallest building in the world?"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="", flush=True)Try MIAPI right now. No signup required for the demo.
Demo: 5 queries per minute limit. Sign up for full access.
Complete documentation for every endpoint.
The core endpoint. Searches the web, synthesizes an AI answer with sources and confidence scores.
| Name | Type | Required | Description |
|---|---|---|---|
| question | string | required | The question to answer (2-1000 chars) |
| mode | string | optional | answer (default), search (raw results), knowledge (from your text) |
| citations | boolean | optional | Include [1][2] citation markers. Default: false |
| knowledge | string | optional | Custom context (up to 10K chars). Used alongside or instead of web search. |
| system_prompt | string | optional | Custom system prompt for the AI (max 2000 chars) |
| response_format | string | optional | text, short, json, markdown |
| temperature | float | optional | 0.0 to 1.0 (default 0.3) |
| max_tokens | integer | optional | 50-2000 (auto if not set) |
| include_sources | boolean | optional | Include source URLs. Default: true |
| search_domains | array | optional | Restrict search to specific domains, e.g. ["wikipedia.org"] |
| exclude_domains | array | optional | Block specific domains from results, e.g. ["reddit.com", "wikipedia.org"] |
| language | string | optional | Force response language, e.g. "Spanish", "French" |
| conversation_id | string | optional | Pass the same id across calls and the server remembers the conversation, so follow-ups like "how old is he?" work without sending history. Keeps 30 exchanges, expires after 24h idle, scoped to your key. |
| context | array | optional | Send conversation history yourself, instead of using conversation_id |
| style | string | optional | "kids" answers the way you would talk to a child: short, definite, spoken, no lists or links. It sings, counts, spells, tells jokes and stories and plays games, and answers follow-ups like "say that again" or "what does that mean?" from the conversation (conversation_id, context, or a "Recent conversation" block in knowledge). Default: "default" |
| timezone | string | optional | Your user's time zone, e.g. "America/New_York". Dates, match times and "what time is it" come back in their local time, with the event's own time alongside when it differs. Default: "Europe/London" |
| blocked_topics | array | optional | Kids mode only. Topics a parent wants to handle themselves: "sex", "death", "religion", "politics" (opinions and arguments about politicians and parties, not basic facts) and "drugs_alcohol". A matching question gets a gentle "ask a grown-up" reply and a parental_flag in the response. Adds no waiting time |
| blocked_reply | string | optional | Kids mode only. Your own wording for the reply to a blocked question |
{
"answer": "Quantum computing uses qubits... [1][2]",
"sources": [
{"title": "...", "url": "...", "snippet": "..."}
],
"confidence": 0.9,
"cached": false,
"query_time_ms": 1200,
"mode": "answer",
"request_id": "req_abc123...",
"conversation_turns": 4
}
| X-Request-ID | Unique request identifier for debugging | ||
| X-Cache | HIT or MISS — whether the response was cached | ||
| X-Response-Time | Server processing time (e.g. "1200ms") | ||
| X-MIAPI-Version | API version (e.g. "1.6.0") | ||
Drop-in replacement for OpenAI's chat completions. All answers are web-grounded with citations.
| Name | Type | Required | Description |
|---|---|---|---|
| messages | array | required | Array of {role, content} messages |
| model | string | optional | "miapi-grounded" (default) |
| stream | boolean | optional | Enable SSE streaming |
| temperature | float | optional | 0.0-1.0 |
| max_tokens | integer | optional | 50-2000 |
Real-time streaming via Server-Sent Events. Sends sources first, then streams the answer token by token.
Same parameters as /v1/answer. Events: sources → answer (multiple) → done
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | required | News search query |
| num_results | integer | optional | 1-20 (default 5) |
Returns: articles with title, url, snippet, date, source name.
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | required | Image search query |
| num_results | integer | optional | 1-20 (default 5) |
Returns: images with title, url, thumbnail, source, width, height.
Returns raw search results without LLM processing. Ideal for LangChain, RAG pipelines, or bring-your-own-model setups.
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | required | Search query |
| num_results | integer | optional | 1-20 (default 7) |
| search_domains | array | optional | Restrict to specific domains |
| exclude_domains | array | optional | Block specific domains from results |
Public demo endpoint, no API key required. Rate limited to 20 queries/min per IP. Max 500 char questions, 200 token responses.
| Name | Type | Required | Description |
|---|---|---|---|
| question | string | required | Question (2-500 chars) |
| include_sources | boolean | optional | Include source URLs. Default: true |
| response_format | string | optional | text, short, markdown, json |
Returns all available model identifiers. OpenAI-compatible format. No request body needed.
List, create, and revoke API keys on your account. Returns key metadata including creation date, usage count, and rate limit.
Returns queries today, this month, rate limit, tier, and monthly limit. No request body needed.
Buy query packs. Use them anytime. No subscriptions, no expiry.
All queries are one-time purchases. No subscriptions. Buy more anytime. Prices range from $2.50 to $3.60 per 1,000 queries.
Install and start querying in 30 seconds.
Full-featured Python client with sync and async support, streaming, and all endpoints.
from miapi import MIAPI client = MIAPI("YOUR_API_KEY") # Grounded answer with citations result = client.answer("What is CRISPR?", citations=True) print(result.answer) print(result.sources) # Knowledge mode — answer from your data result = client.answer( "What is the return policy?", mode="knowledge", knowledge="Returns accepted within 30 days..." ) # Search only — raw results for your pipeline results = client.search("latest AI research papers") for source in results: print(source.url) # News search news = client.news("technology", num_results=5) # Image search images = client.images("golden retriever")
Plug MIAPI into any MCP-compatible AI assistant — Cursor, Claude Desktop, Windsurf, and more.
Download the server file, set your API key, and your AI assistant gets web search with citations built in.
Questions, feedback, or partnership inquiries — we'd love to hear from you.
Or email us directly at support@miapi.uk