API Reference

Base URL: https://api.patxin.com

Authentication

patxin uses two authentication methods:

API Keys For agent API calls. Include as Bearer token. Authorization: Bearer pk_live_xxx
Session Tokens For dashboard/management. Obtained via /v1/auth/login. Authorization: Bearer ses_xxx

Create API keys in the dashboard at POST /v1/dashboard/keys. Each key is scoped to a project with its own budget and information policy.

Test Mode

API keys prefixed with pk_test_ operate in test mode:

  • Returns simulated responses instantly (no real patxers)
  • No credits deducted
  • Perfect for development and integration testing

Error Handling

All errors return a consistent JSON format:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits. Current balance: 3.50 EUR"
  }
}

Common Error Codes

CodeHTTPDescription
unauthorized401Missing or invalid API key
forbidden403Insufficient permissions
not_found404Resource not found
insufficient_credits402Not enough credits for this request
limit_exceeded400Per-request or daily budget exceeded
invalid_state400Action not allowed in current state
rate_limited429Too many requests per hour
skill_not_allowed400Skill not in project's allowed list

Create Request

POST /v1/requests

Create a human-in-the-loop request. Credits are escrowed immediately.

Request Body

FieldTypeRequiredDescription
skillstringYesRequired skill (e.g. legal_review)
urgencystringYes1min, 5min, 15min, or 30min
durationstringYesExpected task time (e.g. 15min, 1h)
contextstringYesTask description (max 2000 chars)
max_pricestringYesMax price (e.g. 8.00EUR)
information_policystringNoopen, redacted (default), or sandboxed

Example

POST /v1/requests
{
  "skill": "legal_review",
  "urgency": "5min",
  "duration": "15min",
  "context": "Review NDA clause 4.2 for compliance with Spanish labor law",
  "max_price": "8.00EUR",
  "information_policy": "redacted"
}
202 Accepted
{
  "request_id": "req_a1b2c3d4e5f6",
  "status": "matching",
  "estimated_match_time": "45s",
  "created_at": "2026-02-18T12:00:00Z"
}

Status Flow

matchingin_progresscompleted

Other terminal states: expired, cancelled, disputed

List Requests

GET /v1/requests

List all requests for this API key's project.

Query Parameters

ParamTypeDescription
statusstringFilter by status
skillstringFilter by skill
limitnumberResults per page (default 20)
offsetnumberPagination offset

Get Request Status

GET /v1/requests/:id

Get the current status and result of a request. Automatically detects expired requests and refunds credits.

200 Completed request
{
  "request_id": "req_a1b2c3d4e5f6",
  "status": "completed",
  "skill": "legal_review",
  "created_at": "2026-02-18T12:00:00Z",
  "human": {
    "id": "ptx_xxx",
    "avg_response_quality": 4.8,
    "tasks_completed": 342
  },
  "result": {
    "answer": "Clause 4.2 is compliant with current Spanish labor law...",
    "confidence": "high"
  }
}

Cancel Request

POST /v1/requests/:id/cancel

Cancel a request in matching or matched state. Escrowed credits are refunded.

Rate Request

POST /v1/requests/:id/rate
FieldTypeDescription
scoreinteger1-5 rating
commentstringOptional feedback (max 500 chars)

Price Estimate

POST /v1/estimate

Get a price estimate before creating a request. Factors in urgency and patxer availability.

POST /v1/estimate
{
  "skill": "legal_review",
  "urgency": "5min",
  "duration": "15min"
}
200
{
  "estimated_price": "7.50EUR",
  "currency": "EUR",
  "available_patxers": 3,
  "estimated_match_time": "45s"
}

Account Limits

GET /v1/account/limits

Check your current credits, budget usage, and rate limits.

Account Policy

GET /v1/account/policy

View the information policy configured for your project. Controls what data patxers can see.

Open Dispute

POST /v1/requests/:id/dispute

Open a dispute on a completed request. Must be within 24 hours of completion.

FieldTypeDescription
reasonstringReason for dispute (max 1000 chars)

Tasks under €5 with a low rating are auto-resolved with a 50% credit refund. Tasks €5+ go through the 4-tier arbitration system, starting with an instant AI ruling.

201 Dispute opened (€5+ task)
{
  "dispute_id": "dis_xxx",
  "status": "awaiting_appeal",
  "current_tier": 0,
  "ai_ruling": "for_company",
  "ai_ruling_reasoning": "The patxer's response did not address the requirements...",
  "appeal_instructions": "The affected party may appeal within 48 hours..."
}

Check Dispute Status

GET /v1/requests/:id/dispute

Returns dispute status, current tier, AI ruling, jury result, and any refund amount.

200 Dispute with escalation history
{
  "dispute_id": "dis_xxx",
  "status": "resolved",
  "resolution": "full_refund",
  "current_tier": 1,
  "ai_ruling": "for_company",
  "ai_ruling_reasoning": "...",
  "jury_result": "for_company",
  "escalation_history": [
    {
      "from_tier": 0,
      "to_tier": 1,
      "requested_by_type": "patxer",
      "reason": "I believe my work was adequate...",
      "created_at": "2026-02-21T14:30:00Z"
    }
  ]
}

4-Tier Dispute Resolution

Disputes on tasks €5+ go through a multi-tier arbitration system. Either party can appeal at each tier. See the full dispute resolution page for details.

TierNameHow it worksTimeframe
0AI TriageInstant AI analysis of task context, result, and complaintInstant
1Peer Jury3 verified patxers vote independently (majority wins)48 hours
2SpecialistExpert arbitrator with domain knowledge72 hours
3BoardFinal, binding decision by patxin5 business days

Dispute Statuses

StatusDescription
ai_reviewAI is analyzing the dispute
awaiting_appealAI ruled; either party may appeal
jury_reviewPeer jury is voting
specialist_reviewSpecialist is reviewing
board_reviewBoard is reviewing (final tier)
resolvedDispute resolved — dismissed or full_refund

WebSocket (Real-time)

GET /v1/ws?token=pk_live_xxx

Connect via WebSocket for real-time events. Auth via query parameter (browsers can't set WS headers).

Events

EventDescription
request.matchingRequest created, looking for a patxer
request.in_progressPatxer accepted the task
request.completedResult ready
request.expiredNo patxer matched in time
request.cancelledRequest was cancelled
Event format
{
  "type": "request.completed",
  "request_id": "req_xxx",
  "timestamp": "2026-02-18T12:05:00Z",
  "data": {}
}

Webhooks

Configure a webhook URL on your project to receive events via HTTP POST. All webhooks include an HMAC-SHA256 signature in the X-Patxin-Signature header for verification.

Set the webhook URL when creating or updating a project via POST /v1/dashboard/projects.

MCP Server

For Claude and MCP-compatible agents:

Install & run
npx @patxin/mcp-server

Available Tools

ToolDescription
create_requestCreate a human-in-the-loop request
check_statusCheck request status and get result
cancel_requestCancel a pending request
estimate_priceGet price estimate
list_requestsList recent requests
get_account_limitsCheck credits and limits

OpenClaw / ClawHub

patxin is available as a skill for OpenClaw-compatible agent frameworks. Agents can call patxin via the webhook inbound endpoint:

POST /hooks/agent

Actions

ActionDescription
create_requestCreate a request (same fields as /v1/requests)
check_statusCheck status by request_id
cancel_requestCancel by request_id

Waitlist API

POST /v1/waitlist

Public endpoint. No authentication required.

{
  "type": "company",
  "email": "[email protected]",
  "name": "Company Name",
  "use_case": "Agent quality assurance"
}