API Documentation

Everything an agent needs to discover, authenticate, and use ParseKit.

Base URL: https://parsekit.polsia.app

Discovery

GET /.well-known/agent-service.json NO AUTH

Agent discovery manifest. Returns available tools, auth method, pricing URL, and wallet endpoints.

Response
{
  "schema_version": "1.0",
  "name": "ParseKit",
  "tools": [{ "name": "extract_text", "endpoint": "/agent/extract_text", ... }],
  "wallet": { "deposit_url": "/wallet/deposit", "balance_url": "/wallet/balance" }
}
GET /pricing NO AUTH

Machine-readable pricing for all tools.

Response
{
  "currency": "USD",
  "tools": {
    "extract_text": {
      "cost_per_call": 0.01,
      "free_tier": { "calls_per_month": 100 }
    }
  }
}

Authentication

Register your agent to get a Bearer token. Include it in the Authorization header for all authenticated endpoints.

POST /auth/register NO AUTH

Register a new agent. Returns an API key and creates a wallet with $1.00 in free credits.

Request Body
ParameterTypeDescription
agent_name requiredstringName of your agent (min 2 chars)
Example
curl -X POST https://parsekit.polsia.app/auth/register \
  -H "Content-Type: application/json" \
  -d '{"agent_name": "my-agent"}'
Response (201)
{
  "api_key": "pk_a1b2c3d4e5f6...",
  "agent_name": "my-agent",
  "wallet": { "balance": 1.00, "currency": "USD" }
}

Text Extraction

POST /agent/extract_text AUTH REQUIRED

Extract text from a file URL. Supports text, HTML, JSON, CSV, images (OCR), and PDFs. Costs $0.01 per call. Failed extractions are auto-refunded.

Request Body
ParameterTypeDescription
file_url requiredstringPublic URL of the file to extract text from
Example
curl -X POST https://parsekit.polsia.app/agent/extract_text \
  -H "Authorization: Bearer pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"file_url": "https://example.com/document.pdf"}'
Response (200)
{
  "job_id": 42,
  "text": "Extracted text content...",
  "confidence_score": 0.88,
  "cost": 0.01,
  "processing_time_ms": 1234,
  "file_url": "https://example.com/document.pdf"
}
Error: Insufficient Funds (402)
{
  "error": "insufficient_funds",
  "wallet": { "balance": 0.005, "required": 0.01, "deposit_url": "/wallet/deposit" }
}

Wallet

GET /wallet/balance AUTH REQUIRED

Check your current wallet balance and recent transactions.

Example
curl https://parsekit.polsia.app/wallet/balance \
  -H "Authorization: Bearer pk_your_api_key"
Response
{
  "wallet": { "balance": 0.99, "currency": "USD" },
  "recent_transactions": [
    { "amount": 0.01, "type": "charge", "description": "extract_text: https://..." }
  ]
}
POST /wallet/deposit AUTH REQUIRED

Add credits to your wallet. Minimum $1.00, maximum $1,000.00 per transaction.

Request Body
ParameterTypeDescription
amount requirednumberAmount to deposit in USD (min 1.00)
Example
curl -X POST https://parsekit.polsia.app/wallet/deposit \
  -H "Authorization: Bearer pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"amount": 10.00}'
Response
{
  "success": true,
  "wallet": { "balance": 10.99, "currency": "USD" },
  "transaction": { "amount": 10.00, "type": "deposit" }
}