HENSTRUCT · Beginner · Authentication
Authentication
Create and prove a HENSTRUCT API key (hstk_) step by step.
Automation for HENSTRUCT uses one product API key. Keys start with hstk_. A key from another product will not work here.
Create your key
- Sign in at hendoi.com/login.
- Open Settings → Generate API key for HENSTRUCT (or the HENSTRUCT Developers page).
- Copy the full
hstk_…value once. The server stores a hash; you will not see the full key again. - Put it in your environment:
HENSTRUCT_API_KEY=hstk_….
How to send the key
Prefer this header on every call:
Authorization: Bearer hstk_…
Or send the raw key (no Bearer) as:
X-Henstruct-Key: hstk_…
Never put the key in the JSON body or in a query string. Never commit it to git.
Prove the key works
Send this GET before any analysis call:
GET https://henstruct.hendoi.com/api/v1/usage
Authorization: Bearer hstk_demo_4c91e2ab8d07
- Replace the demo key with your live key.
- Expect HTTP
200and a usage JSON object. - If you get
401, generate a new key and update every copy.
Python check
pip install henstruct
# set HENSTRUCT_API_KEY first
from henstruct import Client
print(Client().usage())
JavaScript check
npm install @hendoi/henstruct
import { Client } from "@hendoi/henstruct";
const usage = await new Client().usage();
console.log(usage);
Common mistakes
- Using a HENFOIL
hfk_key (or any other product key) against HENSTRUCT. - Adding an extra space or newline when pasting the key.
- Calling the wrong host (use
https://henstruct.hendoi.comin production). - Free plan with 0 automation calls left — upgrade or wait for the monthly reset (UTC).
Next: Limits and errors · back to Overview.
