Reference · step 1 of 9

POST/generate-token

{{base_url}}/generate-token

Exchange the API key for a token that lives 4 hours (expires_in 14400). Every later call sends it as Authorization: Bearer <token>.

Headers

Content-Typeapplication/json
Keys and what they mean
Request
keytypewhen presentimportancemeaning
api_keystringrequiredmust readYour API key (starts with aiqo_). Keep it on your server; never send it from a browser or app.
Total: 1 keys
Reply
keytypewhen presentimportancemeaning
tokenstringalwaysmust readSend it as Authorization: Bearer <token> on every other call.
token_typestringalwaysinformationalAlways Bearer.
expires_inintegeralwaysmust readSeconds the token lives (14400 = 4 hours). Get a new token before it ends; a call with an expired token answers 401.
expires_atdatetimealwaysusefulThe same end as a time (UTC).
Total: 4 keys
Errors this call answers with (4)
HTTPcodemessagedetailwhen
4019001Authentication requiredInvalid api_keyUnknown key, suspended user, or the API has no API-key routes (today). Observed on the local stack.
4019001Authentication requiredApi_key required
4005000Invalid request(Huma's text)Malformed JSON or wrong content type.
4299004Too many requestsRate limit, when configured.
Questions developers ask (2)
How long does a token last?
4 hours (expires_in, expires_at). Renew before it ends; an expired token answers 401 with code 9001.
Can I call the API from a browser or a mobile app?
No. The API key must stay on your server; call the API from there.
Real captures of this call