API v1.6 — Beats Perplexity at 60% less cost

AI Answers Grounded
in Real-Time Search

One API call. Web-grounded answers with inline citations, sources, and confidence scores. OpenAI-compatible. Built for developers.

~1.1s
Avg Response
10+
Endpoints
98%
Accuracy
$0.0025
As Low As / Query

Quick Start

Get a grounded AI answer in one API call.

cURL
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
  }'
Python
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": "..."}]
JavaScript
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
OpenAI Drop-in Replacement
# 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!

Built for Developers

Everything you need in one API. Nothing you don't.

🔍

Web-Grounded Answers

Every answer is backed by real-time web search. No hallucinations. Sources included with every response.

📎

Inline Citations

Get answers with [1][2] citation markers linked to sources. Professional, verifiable, trustworthy.

🤖

OpenAI Compatible

Drop-in replacement for /v1/chat/completions. Change one URL and your existing code works instantly.

📚

Knowledge Mode

Pass your own documents. Get answers from your data, web search, or both combined. Perfect for RAG.

🌊

Streaming

Real-time Server-Sent Events streaming. Show answers as they generate, just like ChatGPT.

🔎

Search-Only Mode

Get raw search results without LLM processing. Bring your own model. Built for LangChain and RAG pipelines.

📰

News Search

Dedicated news endpoint with article dates, sources, and snippets. Real-time news intelligence.

🖼️

Image Search

Find images from across the web with titles, thumbnails, dimensions, and source URLs.

Fast & Cached

~1.5s average response. Built-in caching with X-Cache headers. Repeat queries return in 1ms.

Cheapest on the Market

Compare us to every grounded AI API. We include everything they charge extra for.

Provider AI Answer Citations Knowledge Mode News Search OpenAI Compat Streaming Per 1,000 queries
MIAPI ⚡ $2.50–3.60
Perplexity Search ~$5–12
Brave AI Grounding ~$5–8
Perplexity Sonar Pro ~$8–15
Exa.ai Answer API ~$5–25
Tavily Search $8.00
Google Grounding API $14–35

MIAPI is the only API with all 6 features at the lowest price point.

Live Playground

Try MIAPI right now. No signup required for the demo.

API Explorer ● Connected to api.miapi.uk
Question

Demo: 5 queries per minute limit. Sign up for full access.

Format
Response
Click "Send Request" to try the API...

API Reference

Complete documentation for every endpoint.

Base URL
https://api.miapi.uk
Authentication
Authorization: Bearer YOUR_API_KEY
POST /v1/answer Grounded AI answer with web search

The core endpoint. Searches the web, synthesizes an AI answer with sources and confidence scores.

Parameters

NameTypeRequiredDescription
questionstringrequiredThe question to answer (2-1000 chars)
modestringoptionalanswer (default), search (raw results), knowledge (from your text)
citationsbooleanoptionalInclude [1][2] citation markers. Default: false
knowledgestringoptionalCustom context (up to 10K chars). Used alongside or instead of web search.
system_promptstringoptionalCustom system prompt for the AI (max 2000 chars)
response_formatstringoptionaltext, short, json, markdown
temperaturefloatoptional0.0 to 1.0 (default 0.3)
max_tokensintegeroptional50-2000 (auto if not set)
include_sourcesbooleanoptionalInclude source URLs. Default: true
search_domainsarrayoptionalRestrict search to specific domains, e.g. ["wikipedia.org"]
exclude_domainsarrayoptionalBlock specific domains from results, e.g. ["reddit.com", "wikipedia.org"]
languagestringoptionalForce response language, e.g. "Spanish", "French"
contextarrayoptionalConversation history for follow-up questions

Response

Response
{
  "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..."
}

Response Headers

X-Request-IDUnique request identifier for debugging
X-CacheHIT or MISS — whether the response was cached
X-Response-TimeServer processing time (e.g. "1200ms")
X-MIAPI-VersionAPI version (e.g. "1.6.0")
POST /v1/chat/completions OpenAI-compatible endpoint

Drop-in replacement for OpenAI's chat completions. All answers are web-grounded with citations.

NameTypeRequiredDescription
messagesarrayrequiredArray of {role, content} messages
modelstringoptional"miapi-grounded" (default)
streambooleanoptionalEnable SSE streaming
temperaturefloatoptional0.0-1.0
max_tokensintegeroptional50-2000
POST /v1/stream Streaming AI answer (SSE)

Real-time streaming via Server-Sent Events. Sends sources first, then streams the answer token by token.

Same parameters as /v1/answer. Events: sourcesanswer (multiple) → done

POST /v1/news Search recent news articles
NameTypeRequiredDescription
querystringrequiredNews search query
num_resultsintegeroptional1-20 (default 5)

Returns: articles with title, url, snippet, date, source name.

POST /v1/images Search for images
NameTypeRequiredDescription
querystringrequiredImage search query
num_resultsintegeroptional1-20 (default 5)

Returns: images with title, url, thumbnail, source, width, height.

POST /v1/search Raw web search results

Returns raw search results without LLM processing. Ideal for LangChain, RAG pipelines, or bring-your-own-model setups.

NameTypeRequiredDescription
querystringrequiredSearch query
num_resultsintegeroptional1-20 (default 7)
search_domainsarrayoptionalRestrict to specific domains
exclude_domainsarrayoptionalBlock specific domains from results
POST /v1/playground No-auth demo endpoint

Public demo endpoint, no API key required. Rate limited to 20 queries/min per IP. Max 500 char questions, 200 token responses.

NameTypeRequiredDescription
questionstringrequiredQuestion (2-500 chars)
include_sourcesbooleanoptionalInclude source URLs. Default: true
response_formatstringoptionaltext, short, markdown, json
GET /v1/models List available models

Returns all available model identifiers. OpenAI-compatible format. No request body needed.

GET /v1/keys Manage your API keys

List, create, and revoke API keys on your account. Returns key metadata including creation date, usage count, and rate limit.

GET /v1/usage Check your usage stats

Returns queries today, this month, rate limit, tier, and monthly limit. No request body needed.

Simple Pricing

Buy query packs. Use them anytime. No subscriptions, no expiry.

Free
$0
  • 500 queries / month
  • 1 API key
  • 60 req/min
  • All endpoints
  • Refills monthly
Get Free Key
Starter
$9
  • 2,500 queries
  • $3.60 per 1,000
  • 5 API keys
  • 120 req/min
  • Never expires
Buy Queries
Pro
$90
  • 30,000 queries
  • $3.00 per 1,000
  • 5 API keys
  • 120 req/min
  • Never expires
Buy Queries
Scale
$250
  • 100,000 queries
  • $2.50 per 1,000
  • 5 API keys
  • 120 req/min
  • Never expires
Buy Queries
Enterprise
Custom
  • Volume discounts
  • Unlimited API keys
  • Custom rate limits
  • SLA guarantee
  • On-premise option
Contact Sales

All queries are one-time purchases. No subscriptions. Buy more anytime. Prices range from $2.50 to $3.60 per 1,000 queries.

Python SDK

Install and start querying in 30 seconds.

$ pip install miapi-sdk

Full-featured Python client with sync and async support, streaming, and all endpoints.

Python SDK
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")

MCP Integration

Plug MIAPI into any MCP-compatible AI assistant — Cursor, Claude Desktop, Windsurf, and more.

$ pip install "mcp[cli]" httpx

Download the server file, set your API key, and your AI assistant gets web search with citations built in.

Download MCP Server View on GitHub

Get in Touch

Questions, feedback, or partnership inquiries — we'd love to hear from you.

Or email us directly at support@miapi.uk

MIAPI - Product Hunt
Featured on Uneed MIAPI - Product Hunt