API Documentation

Everything you need to integrate FaradayMind into your system.

Authentication

All requests must include your API key in the Authorization header as a Bearer token. Your key is provided when you subscribe.

Authorization: Bearer YOUR_API_KEY

Requests without a valid key return 401 Unauthorized. Keep your key secret — contact us immediately if you believe it has been compromised.

Base URL

https://api.faradaymind.com

Available Models

Model Plan Best for
llama3.1:8b Starter Summaries, extraction, classification — fast responses
qwen2.5:14b Pro Complex documents, nuanced analysis, drafting — highest accuracy

Generate a response

POST /api/generate

Request body

Field Type Required Description
model string Yes Model identifier (see above)
prompt string Yes Your instruction + document text
stream boolean No Set to false to receive a single JSON response (recommended)

Examples

cURL

curl https://api.faradaymind.com/api/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen2.5:14b",
    "prompt": "Summarise the key obligations in this contract:\n\n[DOCUMENT TEXT HERE]",
    "stream": false
  }'

Python

import requests

response = requests.post(
    "https://api.faradaymind.com/api/generate",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "model": "qwen2.5:14b",
        "prompt": f"Summarise the key obligations:\n\n{document_text}",
        "stream": False
    }
)

result = response.json()["response"]

Node.js

const response = await fetch("https://api.faradaymind.com/api/generate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "qwen2.5:14b",
    prompt: `Summarise the key obligations:\n\n${documentText}`,
    stream: false
  })
});

const { response: result } = await response.json();

Response

{
  "model": "qwen2.5:14b",
  "response": "The contract contains the following key obligations...",
  "done": true,
  "done_reason": "stop"
}

Rate Limits

Plan Requests per minute Burst
Starter 20 5
Pro 60 5

Exceeding your rate limit returns 429 Too Many Requests. Implement exponential backoff before retrying.

Best Practices

Need help?

Email us at hello@faradaymind.com and we'll get back to you within one business day.