API Docs

Authentication

Protect partner keys, request only the scopes you need, and send the headers the Lahjty Partner API requires on every request.

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

ad-library:read

Ad Library search and details

ad-library:write

Ad preparation and reference uploads

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,
    "whatsapp_template": 2,
    "image": 5,
    "image_2k": 8,
    "image_edit": 5,
    "image_edit_2k": 8,
    "speech": 5
  }
}