API Documentation

Getting Started with the LexiDoc API

Welcome to the LexiDoc API documentation. Our API allows you to integrate LexiDoc's powerful document generation, summarization, and analysis capabilities directly into your own applications.

Authentication

All API requests must be authenticated with an API key. You can obtain your key from the API Access page.

Include your API key in the `Authorization` header as a Bearer token:

Authorization: Bearer YOUR_API_KEY

API Endpoints

The base URL for all API endpoints is: https://api.lexidoc.com/v1

POST /generate/document

This endpoint allows you to generate a document based on a set of instructions.

Request Body

  • instructions (string, required): The plain language instructions for the document.
  • documentType (string, required): The type of document (e.g., "Essay", "Memo").
  • tone (string, required): The desired tone (e.g., "Professional", "Formal").
  • format (string, required): The desired format (e.g., "APA", "MLA").

Example Request

curl -X POST https://api.lexidoc.com/v1/generate/document \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instructions": "Write a press release about our new product launch.",
    "documentType": "Press Release",
    "tone": "Professional"
  }'

Example Response

{
  "document": "<h1>Press Release</h1><p>FOR IMMEDIATE RELEASE...</p>"
}

Rate Limiting

Our API uses rate limiting to ensure fair usage and stability. The rate limits depend on your subscription plan:

  • Free Plan: 100 requests per month, 10 requests per minute.
  • Pro Plan: 1,000 requests per month, 60 requests per minute.
  • Business Plan: 5,000 requests per month, 120 requests per minute.

If you exceed the rate limit, you will receive a 429 Too Many Requests HTTP status code.

Error Codes

The API uses standard HTTP status codes to indicate the success or failure of a request.

  • 200 OK: The request was successful.
  • 400 Bad Request: The request was malformed (e.g., missing required parameters).
  • 401 Unauthorized: Your API key is missing or invalid.
  • 403 Forbidden: You do not have permission to access this resource.
  • 429 Too Many Requests: You have exceeded your rate limit.
  • 500 Internal Server Error: An unexpected error occurred on our end.