Integrate in under 10 lines. Works with any language that can make HTTP requests.
REST API — Take a Screenshot ($0.01 USDC)
// Node.js / Browser — zero dependencies
const res = await fetch('https://a2a.opspawn.com/x402/screenshot', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Payment-Signature': signedPayment // USDC authorization
},
body: JSON.stringify({ url: 'https://example.com' })
});
const screenshot = await res.blob(); // PNG image
Free API — Markdown to HTML (no payment needed)
const res = await fetch('https://a2a.opspawn.com/x402/html', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ markdown: '# Hello\n\n**Bold** and *italic*' })
});
const html = await res.text(); // Rendered HTML
Python — Take a Screenshot ($0.01 USDC)
import requests
res = requests.post('https://a2a.opspawn.com/x402/screenshot',
headers={'Payment-Signature': signed_payment},
json={'url': 'https://example.com'})
with open('screenshot.png', 'wb') as f:
f.write(res.content) # PNG image saved
Python — Discover Agent Services
import requests
card = requests.get('https://a2a.opspawn.com/.well-known/agent-card.json').json()
for skill in card['skills']:
print(f"{skill['name']}: {skill['description']}")
A2A JSON-RPC — Agent-to-Agent Communication
// A2A v0.3 standard message/send
const response = await fetch('https://a2a.opspawn.com/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: crypto.randomUUID(),
method: 'message/send',
params: {
message: {
messageId: crypto.randomUUID(),
role: 'user',
parts: [{ kind: 'text',
text: 'Convert this markdown to HTML: # Hello World' }],
kind: 'message'
},
configuration: { blocking: true }
}
})
});
const task = await response.json();
// task.result.artifacts[0].parts[0] contains HTML output