api-keys

Generate Key

Generate a free-trial API key.

Creates a new API key with 500 free tokens for the given email address. Generating again for the same email deactivates the prior free key and carries its usage forward — it never resets the quota.

curl example:

curl -X POST https://api.halalterminal.com/api/keys/generate \
  -H "Content-Type: application/json" \
  -d '{"email": "dev@example.com"}'

Python example:

import requests

resp = requests.post(
    "https://api.halalterminal.com/api/keys/generate",
    json={"email": "dev@example.com"},
)
key_data = resp.json()
print("Your API key:", key_data["api_key"])
post/api/keys/generate

Request

  • Base URL: https://api.halalterminal.com
  • URL: https://api.halalterminal.com/api/keys/generate
  • Auth: none required

Request body

emailstring email required

Email address to associate with the new API key

marketing_opt_inboolean

Opt in to occasional product updates and onboarding tips. Defaults to False; transactional emails (key delivery, payment receipts, quota alerts) are always sent regardless.

Example request

{
  "email": "dev@example.com",
  "marketing_opt_in": false
}

Response

The newly generated API key with plan details

api_keystring required

The generated API key

emailstring required

Email address associated with the key

planstring required

Plan tier assigned to this key (e.g. free)

tokens_limitinteger required

Monthly token allowance

tokens_usedinteger required

Tokens consumed so far this period

requests_limitinteger required

Maximum number of requests allowed

requests_usedinteger required

Number of requests consumed so far

billing_period_endstring nullable

ISO-8601 timestamp when the current billing period ends

created_atstring required

ISO-8601 timestamp when the key was created

Example response

{
  "api_key": "ht_abc123def456",
  "billing_period_end": "2025-07-01T12:00:00Z",
  "created_at": "2025-06-01T12:00:00Z",
  "email": "dev@example.com",
  "plan": "free",
  "requests_limit": 50,
  "requests_used": 0,
  "tokens_limit": 500,
  "tokens_used": 0
}

Changes

No recorded changes to this operation across all 1 revision of this API.