POST/v1/extract

Extraction API

Server-to-server content extraction. Pass any URL — web page, PDF, YouTube, or Bilibili — and get back clean markdown. No user account required on your end. Auth uses an sk_iopho_ API key, not OAuth.

Get an API key

  1. Sign in at console.iopho.com
  2. Go to API KeysNew key
  3. Name it, set an expiry (optional), click Generate
  4. Copy the key immediately — shown only once

Authentication

All requests require a Bearer token with your sk_iopho_ key:

curl -X POST https://fhgxapmrciwlhsffdeyj.supabase.co/functions/v1/reedle-api/v1/extract \
  -H "Authorization: Bearer sk_iopho_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://arxiv.org/abs/2310.06825"}'

Source type detection

SourceDetectionBackendCredits
Web pageAny HTTP/HTTPS URLJina AI reader1
PDF.pdf extension or arxiv.org/pdfJina AI reader5
YouTubeyoutube.com/watch or youtu.be/Transcript service3
Bilibilibilibili.com/video or BV prefixBilibili subtitle API3

Examples by source

curl -X POST $BASE/v1/extract \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"url": "https://news.ycombinator.com"}'

Response schema

200 OK
{
  "content": "# Mistral 7B\n\nWe introduce Mistral 7B...",
  "format": "markdown",
  "source_type": "web",       // "web" | "pdf" | "youtube" | "bilibili"
  "title": "Mistral 7B",
  "credits_used": 1,
  "source": "https://arxiv.org/abs/2310.06825"
}

Error codes

Error
{
  "error": "Insufficient credits",
  "credits_needed": 5         // only present for 402 responses
}
StatusCause
400Missing or invalid url field
401Invalid, revoked, or expired API key
402Insufficient credits
429Rate limit exceeded — 30 requests per 60 seconds
503Upstream extraction service unavailable

Key management endpoints

Manage keys programmatically using your Supabase session token (JWT):

MethodPathDescription
GET/v1/keysList all your API keys (hashed, not plaintext)
POST/v1/keysCreate a new key — returns plaintext once
DELETE/v1/keys/:idRevoke a key immediately
GET/v1/usagePaginated usage log

Security model

  • Keys are stored as SHA-256 hashes — the plaintext is never persisted after creation
  • Credits deducted only on successful extraction (status 200)
  • Usage logged fire-and-forget after response — never blocks latency
  • Each key can be independently revoked without affecting others