API Reference
Base URL: https://api.patxin.com
Authentication
patxin uses two authentication methods:
Authorization: Bearer pk_live_xxx /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
| Code | HTTP | Description |
|---|---|---|
unauthorized | 401 | Missing or invalid API key |
forbidden | 403 | Insufficient permissions |
not_found | 404 | Resource not found |
insufficient_credits | 402 | Not enough credits for this request |
limit_exceeded | 400 | Per-request or daily budget exceeded |
invalid_state | 400 | Action not allowed in current state |
rate_limited | 429 | Too many requests per hour |
skill_not_allowed | 400 | Skill not in project's allowed list |
Create Request
/v1/requests Create a human-in-the-loop request. Credits are escrowed immediately.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
skill | string | Yes | Required skill (e.g. legal_review) |
urgency | string | Yes | 1min, 5min, 15min, or 30min |
duration | string | Yes | Expected task time (e.g. 15min, 1h) |
context | string | Yes | Task description (max 2000 chars) |
max_price | string | Yes | Max price (e.g. 8.00EUR) |
information_policy | string | No | open, redacted (default), or sandboxed |
Example
{
"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"
} {
"request_id": "req_a1b2c3d4e5f6",
"status": "matching",
"estimated_match_time": "45s",
"created_at": "2026-02-18T12:00:00Z"
} Status Flow
matching → in_progress → completed
Other terminal states: expired, cancelled, disputed
List Requests
/v1/requests List all requests for this API key's project.
Query Parameters
| Param | Type | Description |
|---|---|---|
status | string | Filter by status |
skill | string | Filter by skill |
limit | number | Results per page (default 20) |
offset | number | Pagination offset |
Get Request Status
/v1/requests/:id Get the current status and result of a request. Automatically detects expired requests and refunds credits.
{
"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
/v1/requests/:id/cancel Cancel a request in matching or matched state. Escrowed credits are refunded.
Rate Request
/v1/requests/:id/rate | Field | Type | Description |
|---|---|---|
score | integer | 1-5 rating |
comment | string | Optional feedback (max 500 chars) |
Price Estimate
/v1/estimate Get a price estimate before creating a request. Factors in urgency and patxer availability.
{
"skill": "legal_review",
"urgency": "5min",
"duration": "15min"
} {
"estimated_price": "7.50EUR",
"currency": "EUR",
"available_patxers": 3,
"estimated_match_time": "45s"
} Account Limits
/v1/account/limits Check your current credits, budget usage, and rate limits.
Account Policy
/v1/account/policy View the information policy configured for your project. Controls what data patxers can see.
Open Dispute
/v1/requests/:id/dispute Open a dispute on a completed request. Must be within 24 hours of completion.
| Field | Type | Description |
|---|---|---|
reason | string | Reason 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.
{
"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
/v1/requests/:id/dispute Returns dispute status, current tier, AI ruling, jury result, and any refund amount.
{
"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.
| Tier | Name | How it works | Timeframe |
|---|---|---|---|
0 | AI Triage | Instant AI analysis of task context, result, and complaint | Instant |
1 | Peer Jury | 3 verified patxers vote independently (majority wins) | 48 hours |
2 | Specialist | Expert arbitrator with domain knowledge | 72 hours |
3 | Board | Final, binding decision by patxin | 5 business days |
Dispute Statuses
| Status | Description |
|---|---|
ai_review | AI is analyzing the dispute |
awaiting_appeal | AI ruled; either party may appeal |
jury_review | Peer jury is voting |
specialist_review | Specialist is reviewing |
board_review | Board is reviewing (final tier) |
resolved | Dispute resolved — dismissed or full_refund |
WebSocket (Real-time)
/v1/ws?token=pk_live_xxx Connect via WebSocket for real-time events. Auth via query parameter (browsers can't set WS headers).
Events
| Event | Description |
|---|---|
request.matching | Request created, looking for a patxer |
request.in_progress | Patxer accepted the task |
request.completed | Result ready |
request.expired | No patxer matched in time |
request.cancelled | Request was cancelled |
{
"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:
npx @patxin/mcp-server Available Tools
| Tool | Description |
|---|---|
create_request | Create a human-in-the-loop request |
check_status | Check request status and get result |
cancel_request | Cancel a pending request |
estimate_price | Get price estimate |
list_requests | List recent requests |
get_account_limits | Check 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:
/hooks/agent Actions
| Action | Description |
|---|---|
create_request | Create a request (same fields as /v1/requests) |
check_status | Check status by request_id |
cancel_request | Cancel by request_id |
Waitlist API
/v1/waitlist Public endpoint. No authentication required.
{
"type": "company",
"email": "[email protected]",
"name": "Company Name",
"use_case": "Agent quality assurance"
}