{"schemaVersion":"server402.agent-guide.v1","name":"Server402 API Marketplace","purpose":"Discover, choose, pay for, and call English-first paid APIs exposed by this Server402 marketplace via HTTP 402, x402 metadata, OpenAPI, and MCP.","endpoints":{"apiCatalog":"https://aivps.lat/.well-known/api-catalog","apisJson":"https://aivps.lat/apis.json","audit":"https://aivps.lat/api/discovery/audit","catalog":"https://aivps.lat/api/catalog","discovery":"https://aivps.lat/.well-known/server402.json","llms":"https://aivps.lat/llms.txt","mcp":"https://aivps.lat/mcp","openaiFunctions":"https://aivps.lat/api/catalog/openai-functions.json","openapi":"https://aivps.lat/openapi.json","payments":"https://aivps.lat/api/payments","search":"https://aivps.lat/api/catalog/search","sitemap":"https://aivps.lat/sitemap.xml"},"workflow":["Read /.well-known/server402.json, /.well-known/api-catalog, /apis.json, or /llms.txt first.","Read /llms.txt when you need a concise natural-language overview for model context.","Use /api/catalog/search?q=your-task to find matching services.","Inspect service inputSchema, outputSchema, pricing, quality, and discovery.paymentFlow.","Call the service or MCP tool without a token to receive a 402 payment object, or create payment directly with POST /api/payments.","After payment is paid, retry with X-Payment-Token for HTTP or paymentToken for MCP."],"payment":{"type":"http-402","createPayment":{"method":"POST","url":"https://aivps.lat/api/payments","bodySchema":{"properties":{"providerId":{"type":"string"},"serviceId":{"description":"Use the canonical service id from the catalog. Legacy internal ids remain accepted for backward compatibility.","type":"string"}},"required":["serviceId"],"type":"object"},"responseSchema":{"properties":{"amountCents":{"type":"integer"},"billingMode":{"type":"string"},"clientId":{"type":"string"},"currency":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"internalServiceId":{"description":"Legacy internal service id, included only for backward compatibility.","type":"string"},"maxCalls":{"type":"integer"},"paidAt":{"format":"date-time","type":"string"},"payTo":{"type":"string"},"paymentId":{"type":"string"},"provider":{"type":"string"},"providerId":{"type":"string"},"remainingCalls":{"type":"integer"},"serviceId":{"description":"Canonical public service id.","type":"string"},"status":{"type":"string"},"token":{"type":"string"},"usedCalls":{"type":"integer"}},"type":"object"}},"verifyPayment":{"method":"GET","url":"https://aivps.lat/api/payments/{paymentId}","responseSchema":{"properties":{"amountCents":{"type":"integer"},"billingMode":{"type":"string"},"clientId":{"type":"string"},"currency":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"internalServiceId":{"description":"Legacy internal service id, included only for backward compatibility.","type":"string"},"maxCalls":{"type":"integer"},"paidAt":{"format":"date-time","type":"string"},"payTo":{"type":"string"},"paymentId":{"type":"string"},"provider":{"type":"string"},"providerId":{"type":"string"},"remainingCalls":{"type":"integer"},"serviceId":{"description":"Canonical public service id.","type":"string"},"status":{"type":"string"},"token":{"type":"string"},"usedCalls":{"type":"integer"}},"type":"object"}},"token":{"header":"X-Payment-Token","mcpArgument":"paymentToken","httpUsage":"Send the paid token in the X-Payment-Token request header when calling /api/tools/*.","mcpUsage":"Pass the paid token as the paymentToken argument when calling the MCP tool."},"requiredResponse":{"status":402,"contentType":"application/json","headers":{"X-Payment-Required":"true","X-Payment-Token":"payment.token"},"bodySchema":{"properties":{"error":{"type":"string"},"payment":{"properties":{"amountCents":{"type":"integer"},"billingMode":{"type":"string"},"clientId":{"type":"string"},"currency":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"internalServiceId":{"description":"Legacy internal service id, included only for backward compatibility.","type":"string"},"maxCalls":{"type":"integer"},"paidAt":{"format":"date-time","type":"string"},"payTo":{"type":"string"},"paymentId":{"type":"string"},"provider":{"type":"string"},"providerId":{"type":"string"},"remainingCalls":{"type":"integer"},"serviceId":{"description":"Canonical public service id.","type":"string"},"status":{"type":"string"},"token":{"type":"string"},"usedCalls":{"type":"integer"}},"type":"object"}},"required":["error","payment"],"type":"object"}},"retry":{"when":"Retry after payment.status is paid and the token has remaining calls.","http":["Call POST /api/payments with serviceId to create a payment if the first service call returned 402.","Complete or verify payment using GET /api/payments/{paymentId}.","Retry the original /api/tools/* request with X-Payment-Token set to payment.token."],"mcp":["Call the tool without paymentToken to receive payment_required structuredContent.","Complete or verify payment using the returned payment.paymentId.","Call the same MCP tool again with paymentToken set to payment.token."],"failures":["payment required","payment token expired","payment token has no remaining calls","api key required","api key is not allowed to call this service"]}},"errorHandling":["HTTP 402 means payment is required, expired, pending, or exhausted; inspect the payment object and retry after status is paid.","HTTP 401 means an API key is required or invalid.","HTTP 403 means the API key is not allowed to use the requested service.","HTTP 400 means the request does not match the service inputSchema."],"notes":["Published and enabled services are visible to agents. Health checks are exposed as quality signals.","Search results are ranked by text match, price, quality score, success rate, and latency.","Search understands bilingual (English/Chinese) synonyms, so queries like \"文字识别\" match OCR services. Applied synonyms are returned in the response expandedTerms field.","OpenAI-compatible clients can import every service as function-calling tools from /api/catalog/openai-functions.json; each tool carries x-server402 payment metadata.","Quality metrics are derived from health checks and recent call logs."]}
