Authentication
All requests to the API must be authenticated using an API Key. The API key identifies your account and is required for access to any protected endpoint.
Obtaining an API Key
You can generate and manage your API keys from your Account Dashboard. Each key is associated with your account and will be subject to your plan’s usage limits. Keep your API keys private.
Using the API Key
Include your API key in the x-api-key header on every request.
X-API-KEY: YOUR_API_KEY If the header is missing or the key is invalid, the API will return a 401 Unauthorized response.
Example request
import axios from "axios";// You can use// - readFile if you're on Node.js// - File input element if you're on browserconst file = ...;const form = new FormData();form.append("image", file);// Optional; Tab-separataed list of category hints// form.append("categories", ["food", "grocery"].join("\t"));const options = { method: "POST", url: "https://eny.gege.mn/api/v1/receipts", headers: { "x-api-key": "your_api_key", // starts with 'eny' }, data: form,};try { const result = await axios.request(options); console.log(result.data);} catch (error) { console.error(error);} file.js
Best Practices
- Do not expose your API key in client-side code or public repositories.
- Rotate keys periodically through the dashboard.
- Revoke any keys that may have been compromised.