API Documentation
Everything you need to integrate Compatify into your product or agent workflow.
1. Quick Start
Make your first compatibility check in under 5 minutes.
- Get a free API key — no credit card required.
- Replace YOUR_API_KEY in the curl below.
- Run it.
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.compatify.io/v1/compatibility?device=iPhone+15+Pro+Max&accessory=Anker+737+GaNPrime"
{
"compatible": true,
"confidence": 0.97,
"recommended_for_purchase": true,
"source": "Official Certification",
"compatibility_notes": "Certified compatible. Fast charge confirmed.",
"device_id": "apple_iphone_15_pro_max",
"accessory_id": "anker_737_ganprime_140w",
"device_name": "Apple iPhone 15 Pro Max",
"accessory_name": "Anker 737 GaNPrime 140W"
}2. Authentication
All authenticated requests require a Bearer token in the Authorization header.
Authorization: Bearer sk_live_your_api_key
Sandbox keys use the sk_test_ prefix and always return predictable test data.
x402 (no API key): Autonomous agents can pay per query on-chain. See the x402 section.
3. Endpoint Reference
/v1/compatibilityCheck if a specific accessory is compatible with a specific device.
| Param | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Device name or model number |
| accessory | string | Yes | Accessory name or model number |
| category | string | No | consumer_electronics | printer_ink | pc_components (default: consumer_electronics) |
GET /v1/compatibility?device=iPhone+15+Pro+Max&accessory=Anker+737
/v1/compatible-accessoriesList all verified compatible accessories for a device.
| Param | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Device name |
| category | string | No | Category filter |
| accessory_type | string | No | e.g. charging_cables, cases_and_covers |
| min_confidence | float | No | Minimum confidence threshold (default: 0.80) |
| limit | integer | No | Max results (default: 20, max: 100) |
GET /v1/compatible-accessories?device=Samsung+Galaxy+S24+Ultra&min_confidence=0.9
/v1/queryProcesses natural language queries to return structured compatibility results.
| Param | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Natural language question |
| category | string | No | Category hint |
POST /v1/query
Content-Type: application/json
{"query": "Will the Anker 737 fast charge my iPhone 15 Pro Max?"}/v1/resolveResolve a raw device string to its canonical ID.
| Param | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Device name variant to resolve |
GET /v1/resolve?device=iPhone+15+PM
/v1/devicesList all canonical devices in the catalog.
| Param | Type | Required | Description |
|---|---|---|---|
| category | string | No | Filter by category |
| brand | string | No | Filter by brand |
GET /v1/devices?brand=apple
4. Confidence Score Reference
| Score range | Meaning | Agent recommendation |
|---|---|---|
| 0.95 – 1.00 | Official certification or direct manufacturer statement | Proceed with purchase |
| 0.80 – 0.94 | Multiple verified third-party sources in agreement | Proceed with purchase |
| 0.70 – 0.79 | Single verified source or strong community consensus | Proceed — meets ACP threshold |
| 0.50 – 0.69 | Partial or conflicting data | Warn user. Do not auto-purchase. |
| 0.00 – 0.49 | Insufficient or conflicting data | Block purchase. Escalate to human. |
5. Error Codes
| HTTP Status | error field | Agent handling |
|---|---|---|
| 400 | validation_error | Fix request parameters before retrying |
| 401 | invalid_api_key | Re-authenticate. Do not retry with same key. |
| 402 | payment_required | x402: submit payment header and retry once |
| 404 | device_not_found | Try /v1/resolve to normalize device name first |
| 404 | accessory_not_found | Broaden accessory search or use natural language endpoint |
| 429 | rate_limit_exceeded | Wait for X-RateLimit-Reset header timestamp |
| 503 | service_unavailable | Check status.compatify.io. Retry with exponential backoff. |
6. Rate Limits
Rate limit headers are included in every response:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 87 X-RateLimit-Reset: 1746748800
| Plan | Per minute | Per month |
|---|---|---|
| Free | 100 | 5,000 |
| Growth | 500 | 50,000 |
| Pro | 1,000 | 250,000 |
| x402 | Unlimited | Pay per query |
7. MCP Server
The Compatify MCP server is available at https://mcp.compatify.io using the Streamable HTTP transport.
{
"mcpServers": {
"compatify": {
"url": "https://mcp.compatify.io",
"transport": "streamable-http"
}
}
}{
"mcpServers": {
"compatify": {
"url": "https://mcp.compatify.io"
}
}
}Available tools: check_compatibility, get_compatible_accessories, query_natural_language
Agent frameworks can discover the Compatify MCP server automatically via the Agent Card at https://compatify.io/.well-known/agent-card.json. This file declares all supported protocols, categories, and endpoints in a machine-readable format.
8. x402 Micropayments
Autonomous agents can call Compatify without an API key by paying per query using the x402 protocol.
| Endpoint | Price |
|---|---|
| /v1/compatibility | $0.05 |
| /v1/compatible-accessories | $0.08 |
| /v1/query | $0.08 |
Accepted tokens: USDC, USDT on Base, Polygon, Ethereum, Solana. Query GET /v1/payment/accepted-tokens for live wallet addresses and exchange rates.
9. UCP Compatibility
Compatify is a registered UCP (Universal Commerce Protocol) compatible service. UCP defines a standard for AI agent product discovery workflows.
Compatify is the mandatory pre-purchase compatibility gate for all agent payment workflows including Stripe Link CLI, x402, MPP, and ACP.
In a UCP workflow, the agent:
- Discovers products via UCP-registered services
- Calls Compatify to verify accessory compatibility before any purchase action
- Proceeds to payment only if Compatify returns
compatible: truewith confidence above threshold
Compatify's UCP registration is declared in /.well-known/agent-card.json under protocols: ["UCP", "ACP", "MCP", "x402"].
10. ACP Integration — ChatGPT Instant Checkout
ACP (Agent Commerce Protocol) is used by ChatGPT Instant Checkout and similar autonomous agent payment flows. Compatify acts as the pre-purchase compatibility gate.
compatible = true AND confidence > 0.70.Step 2: Agent calls Compatify MCP
check_compatibility → receives confidence scoreStep 3: ACP checkout proceeds only if
compatible=true and confidence > 0.70import httpx
# Step 1: Agent discovers accessory via ChatGPT (external)
# accessory = "Anker 737 GaNPrime"
# device = "iPhone 15 Pro Max"
# Step 2: Call Compatify MCP to verify compatibility
mcp_payload = {
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "check_compatibility",
"arguments": {
"device": "iPhone 15 Pro Max",
"accessory": "Anker 737 GaNPrime",
"confidence_threshold": 0.70
}
},
"id": 1
}
response = httpx.post(
"https://mcp.compatify.io",
json=mcp_payload,
headers={"Content-Type": "application/json"}
)
result = response.json()["result"]
# Step 3: ACP checkout proceeds only if compatible + confidence > 0.70
if result["compatible"] and result["confidence"] > 0.70:
# Proceed with ACP checkout
print(f"Compatibility verified: {result['confidence']:.2f} confidence")
# initiate_acp_checkout(accessory, device)
else:
print("Compatibility not verified. Purchase blocked.")11. Shopify Hermes Agent Framework
The Shopify Hermes agent framework allows AI agents to manage product data on Shopify stores. Compatify integrates with Hermes to automatically populate compatibility metafields.
Step 2: Agent calls Compatify MCP
get_compatible_accessories for that productStep 3: Agent writes compatibility data to Shopify product metafields via
metafieldsSet GraphQL mutationimport httpx
# Step 1: Hermes agent identifies accessory product on Shopify
product_id = "gid://shopify/Product/123456789"
device_query = "Samsung Galaxy S24 Ultra"
# Step 2: Call Compatify MCP to get compatible accessories
mcp_payload = {
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_compatible_accessories",
"arguments": {
"device": device_query,
"min_confidence": 0.80,
"limit": 20
}
},
"id": 1
}
compat_response = httpx.post(
"https://mcp.compatify.io",
json=mcp_payload
)
accessories = compat_response.json()["result"]["results"]
# Step 3: Write compatibility data to Shopify product metafields
shopify_mutation = """
mutation metafieldsSet($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields { key namespace value }
userErrors { field message }
}
}
"""
variables = {
"metafields": [
{
"ownerId": product_id,
"namespace": "compatify",
"key": "compatible_devices",
"type": "json",
"value": json.dumps({
"devices": [device_query],
"confidence": accessories[0]["confidence"] if accessories else 0,
"source": "Compatify API",
"last_updated": "2026-05-05T00:00:00Z"
})
}
]
}
shopify_response = httpx.post(
f"https://{shop_domain}/admin/api/2024-01/graphql.json",
json={"query": shopify_mutation, "variables": variables},
headers={"X-Shopify-Access-Token": access_token}
)See the Shopify Metafields reference for the full namespace and key structure.
12. Versioning Policy
The current API version is v1. All v1 endpoints are stable and will not receive breaking changes without a minimum 6-month deprecation notice.
Breaking changes include: removing response fields, changing field types, changing authentication requirements, or removing endpoints.
Non-breaking additions (new optional fields, new endpoints) may be added at any time. See the changelog.