Developer API

Embed Patent Intelligence
Into Any Airo App

Two REST endpoints. Drop-in widget. Full USPTO-formatted patent drafts generated from plain-language answers — ready to embed in your own application.

Two Endpoints
Analyze ideas and generate full patent drafts via simple POST requests.
Drop-in Widget
Embed the full interview UI with a single script tag and data attribute.
USPTO-Formatted
Output includes abstract, background, claims, and detailed description.

Quickstart

Call /api/patent/analyze to score an idea, then pass the answers to /api/patent/draft to generate the full document.

javascript
// 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);
}

API Reference

All endpoints accept and return application/json. Click any endpoint to expand its full reference.

Embed Widget

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.

html
<!-- 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>
Note: The embeddable widget script is coming soon. Use the REST API endpoints above for immediate integration.

Error Codes

StatusError CodeMeaning
400invalid_inputA required field is missing or fails validation.
400invalid_typeThe `type` field must be "utility" or "design".
500server_errorAn unexpected server error occurred. Retry with exponential backoff.

Ready to integrate?

Start with the analyze endpoint — no API key required during development.