API Documentation

Getting Started

Welcome to the Laverdi.tech OpenClaw API. This documentation covers all available endpoints and features.

Base URL

https://api.laverdi.tech/v1

Authentication

All requests require an API key sent in the Authorization header.

Authentication

Include your API key in every request using the Authorization header:

Authorization: Bearer YOUR_API_KEY

curl -H "Authorization: Bearer lav_..." \
  https://api.laverdi.tech/v1/status

API Endpoints

GET/status

Check API status and your current usage.

Response Example
{
  "status": "ok",
  "usage": {
    "requests": 1234,
    "limit": 50000,
    "reset_at": "2024-04-30T00:00:00Z"
  }
}
POST/agents

Create a new AI agent. Enterprise feature.

Request Body
{
  "name": "Customer Support Bot",
  "model": "gpt-4",
  "system_prompt": "You are...",
  "temperature": 0.7
}

Error Handling

The API uses standard HTTP status codes. Error responses include a message:

{
  "error": "Invalid API key",
  "status": 401
}

Common Status Codes

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 429: Rate Limited
  • 500: Server Error

Code Examples

JavaScript/Node.js

const api = require('laverdi-sdk');

const client = new api.Client({
  apiKey: 'lav_...'
});

const status = await client.getStatus();
console.log(status.usage);

Python

import laverdi

client = laverdi.Client(api_key='lav_...')
status = client.get_status()
print(status.usage)

cURL

curl -X GET https://api.laverdi.tech/v1/status \
  -H "Authorization: Bearer lav_..." \
  -H "Content-Type: application/json"