Two REST endpoints. Drop-in widget. Full USPTO-formatted patent drafts generated from plain-language answers — ready to embed in your own application.
Call /api/patent/analyze to score an idea, then pass the answers to /api/patent/draft to generate the full document.
// 1. Analyze an invention idea
const analysis = await fetch('/api/patent/analyze', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
description: 'Your invention description here...',
type: 'utility'
})
}).then(r => r.json());
// 2. If patentability looks good, generate a full draft
if (analysis.patentability !== 'uncertain') {
const draft = await fetch('/api/patent/draft', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
title: 'My Invention',
type: 'utility',
answers: {
problem: 'The problem being solved...',
solution: 'How the invention solves it...',
advantage: 'Key benefits over existing solutions...'
}
})
}).then(r => r.json());
console.log('Draft ID:', draft.draftId);
console.log('Abstract:', draft.sections.abstract);
}All endpoints accept and return application/json. Click any endpoint to expand its full reference.
Drop the full guided interview UI into any page with a single script tag. The widget handles the entire Q&A flow and fires a callback with the completed draft.
<!-- PatentDraft Embed Widget -->
<script src="https://your-app.airoapp.ai/embed/patentdraft.js"></script>
<div
id="patentdraft-widget"
data-type="utility"
data-theme="dark"
data-on-complete="handlePatentComplete"
></div>
<script>
function handlePatentComplete(draft) {
console.log('Draft ready:', draft.draftId);
console.log('Claims:', draft.sections.claims);
}
</script>| Status | Error Code | Meaning |
|---|---|---|
| 400 | invalid_input | A required field is missing or fails validation. |
| 400 | invalid_type | The `type` field must be "utility" or "design". |
| 500 | server_error | An unexpected server error occurred. Retry with exponential backoff. |
Start with the analyze endpoint — no API key required during development.