API Docs

Authentication

Protect partner keys, request only the scopes you need, and send the headers required by the API.

Bearer authentication

Send the partner key in the Authorization header from a trusted backend. Keys are shown once, stored by Lahjty as one-way hashes, and can be revoked.

.env
# Server environment only — never prefix this with NEXT_PUBLIC_
LAHJTY_API_KEY=lhj_live_replace_with_your_key

Required headers

  • Authorization: Bearer lhj_live_... all private endpoints
  • Content-Type: application/json all POST requests
  • Idempotency-Key all billable POST requests

Scopes

copy:write

Copy and headlines

campaigns:write

Complete campaigns

images:write

Images and campaign images

speech:write

Speech and campaign speech

templates:write

WhatsApp drafts and outcomes

usage:read

Usage and stored requests

GET/capabilities

Test connectivity without spending credits

Capabilities is public and free, so it is useful for checking the base URL and live contract.

curl --request GET \
  --url https://www.lahjty.com/api/v1/capabilities

Example response

response.json
{
  "object": "capabilities",
  "api_version": "2026-09-03",
  "output_languages": [
    "ar",
    "en"
  ],
  "dialects": [
    "saudi",
    "gulf",
    "emirati",
    "egyptian",
    "classical",
    "levantine",
    "iraqi"
  ],
  "credit_costs": {
    "copy": 2,
    "headline": 2,
    "conversion": 1,
    "image": 5,
    "speech": 5,
    "whatsapp_template": 2
  }
}