# Source Verification API — verify a claim, find the official source, and look up or compare pricing for the sources AI agents cite

> Inspect a public URL for source-reliability: reachability, canonical + full redirect chain, title/publisher/published+updated dates, language, official-likelihood, and a stale/archived (wayback) signal.
> ReefAPI engine `agent-source` · 6 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/agent-source/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /agent-source/v1/source_url — 1 credit
Inspect a public URL for source-reliability: reachability, canonical + full redirect chain, title/publisher/published+updated dates, language, official-likelihood, and a stale/archived (wayback) signal.

**Parameters:**
- `url` (string, required) — Public source URL to inspect (scheme optional — https:// is added). Private/loopback/metadata hosts are rejected.
- `check_archive` (boolean, optional, default true) — Query the Wayback Machine for the latest snapshot (stale/archived signal). Default true.
- `official_for` (string, optional) — If set, also score whether the final URL is OFFICIAL for this curated provider (domain match).

**Returns:** url, final_url, final_domain, accessible, status_code, redirect{chain,hops,redirected,loop}, blocked, metadata{title,site_name,published_at,updated_at,lang,author,canonical,json_ld_types}, official{provider,is_official,reason}, freshness{updated_at,archive{available,closest,snapshot_url,age_days},staleness}, render_mode

**Example request body:**
```json
{
  "url": "https://openai.com/api/pricing/",
  "official_for": "openai"
}
```

### POST /agent-source/v1/official_source — 2 credits
Resolve the OFFICIAL URL a curated provider publishes for a given need (pricing/docs/changelog/status/legal/model_card) + why it is official (domain match + domain age via whois). Curated whitelist only.

**Parameters:**
- `entity` (string, required) — Provider/entity name (free text accepted: 'OpenAI', 'claude', 'gemini', 'grok'). Resolved against the curated whitelist — see the `providers` action for the supported set.
- `need_type` (string, optional, default "docs") — Which official resource you need. Default 'docs'. Use 'all' to return every known official URL for the entity. [one of: pricing, docs, changelog, status, legal, model_card]
- `verify` (boolean, optional, default false) — Also live-check the official URL is reachable (adds a url-resolver inner-call + latency).

**Returns:** entity, provider, matched, official_url, need_type, official_domains, why_official{domain_match,domain_age_days,registrar}, all_sources{}, (verify) reachable/final_url, disclaimer

**Example request body:**
```json
{
  "entity": "OpenAI",
  "need_type": "pricing"
}
```

### POST /agent-source/v1/verify_claim — 3 credits
Check whether one or more public source URLs support a factual claim — returns supported, contradicted, not_found, or unclear, along with the matching evidence snippet and a confidence level. Uses exact quote and number matching against the live page content. A source-evidence checker, not a general truth oracle.

**Parameters:**
- `claim` (string, required) — The factual claim to check against the source(s). Keep it specific (a number/quote verifies best).
- `url` (string, required) — Public source URL to inspect (scheme optional — https:// is added). Private/loopback/metadata hosts are rejected.
- `urls` (array, optional) — Up to 5 source URLs (array or comma-list). Combined with `url`; the best-supporting verdict wins.

**Returns:** claim, verdict, confidence, method, per_source[{url,final_url,accessible,verdict,confidence,evidence[{type,matched/snippet}],token_coverage}], best_source, note

**Example request body:**
```json
{
  "claim": "Claude Opus 4.5 costs $5 per million input tokens",
  "url": "https://docs.claude.com/en/docs/about-claude/pricing"
}
```

### POST /agent-source/v1/pricing_lookup — 1 credit
Current developer/LLM pricing for a curated provider, parsed live from the provider's own pricing page/API. Each row: model, input/output per-1M-token USD, source_url, last_seen_at, unit, currency, normalization_notes.

**Parameters:**
- `provider` (string, required) — Curated provider key (or any alias). Structured pricing is available for: openai, anthropic, gemini, xai, openrouter. aws/gcp/azure return official_source but no structured pricing (compute-SKU pages — see normalization_notes). [one of: openai, anthropic, gemini, xai, openrouter, aws, gcp, azure]
- `model` (string, optional) — Optional model-name filter (substring, case-insensitive), e.g. 'gpt-4o', 'opus', 'gemini-2.5-flash', 'grok-4'.
- `limit` (integer, optional, default 40) — Max model rows to return.

**Returns:** provider, source_url, last_seen_at, unit, currency, pricing_available, models[{model,input_per_1m_usd,output_per_1m_usd,...}], count, normalization_notes, parse_surface

**Example request body:**
```json
{
  "provider": "openrouter",
  "model": "claude"
}
```

### POST /agent-source/v1/pricing_compare — 3 credits
Compare current pricing across several curated providers (optionally filtered to a model substring) → normalized per-1M-token USD, cheapest-first, each traceable to its source_url + last_seen_at.

**Parameters:**
- `providers` (array, required) — Up to 6 curated providers (array or comma-list) from: openai, anthropic, gemini, xai, openrouter.
- `model` (string, optional) — Optional model-name filter (substring, case-insensitive), e.g. 'gpt-4o', 'opus', 'gemini-2.5-flash', 'grok-4'.

**Returns:** providers_requested, model_filter, rows[{provider,model,input_per_1m_usd,output_per_1m_usd,source_url,last_seen_at}], cheapest_input, cheapest_output, errors[], unit, currency

### POST /agent-source/v1/providers — 0 credits
List the curated provider whitelist + each provider's capabilities (which need_types and structured pricing are supported) and parse-surface metadata. The honest denominator for official_source / pricing.

**Parameters:**
- `provider` (string, optional) — Optional: return only this provider's detail.

**Returns:** providers[{key,display,primary_domain,official_domains,need_types,pricing_supported,parse_surface,sources{}}], count, pricing_supported_providers, whitelist_policy

## More
- Try it live, no code: https://reefapi.com/playground?engine=agent-source
- Human docs page: https://reefapi.com/docs/agent-source
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
