Background supergraphic

Authentication

GLAIR Vision API uses API Key and basic authentication (with username & password) to authenticate requests.

You can obtain API Key, username, and password by contacting us via hi[at]glair.ai or via our representative for your company. In the future, we will release a dashboard to make it easier for you to manage your credentials.

How to authenticate

  1. Supply the username & password in Authorization: Basic header (convert username:password into base64 format).
  2. Supply the API Key using request header x-api-key.

Here are some code samples on how to authenticate

POST
/ocr/v1/ktp
1
2
3
4
5
6
7
8
9
10
const basicAuth = 'Basic ' + Buffer.from('USERNAME' + ':' + 'PASSWORD').toString('base64'); const apiKey = 'API_KEY'; fetch({ headers: { Authorization: basicAuth, 'x-api-key': apiKey, }, ... });

Using an SDK

If you use one of our official SDKs, you won't have to worry about any of the above. You only need to pass API Key, username, and password. All the boilerplate codes have been taken care of.