Authentication
Get an API key and authenticate your REST and GraphQL requests.
All requests to the Zenode API require a bearer token. This guide covers how to get one, how to use it, and how to keep it safe.
Get an API key
Create your first key at zenode.ai/account/api. The same account covers both the web tool and the API.
Every new account starts with $5 of free usage. No credit card required to get started.
Create an API key
From the API Keys page:
- Click New key
- Give it a name (e.g.
dev,production) - Copy the key — it is shown only once
API keys are prefixed with zn_. Zenode stores only a hash of your key, so if you lose it you'll need to create a new one.
Using your key
Pass your API key as a Bearer token in the Authorization header on every request:
1curl "https://api.zenode.ai/v1/parts/match" \2 -H "Authorization: Bearer <YOUR API KEY HERE>" \3 -H "Content-Type: application/json" \4 -d '{"query": "LM358"}'The same header works for GraphQL:
1curl -X POST https://graphql.zenode.ai \2 -H "Authorization: Bearer <YOUR API KEY HERE>" \3 -H "Content-Type: application/json" \4 -d '{"query": "{ supSearchMpn(q: \"LM358\", limit: 3) { hits } }"}'Missing or invalid keys return 401 Unauthorized.
Treat keys as secrets. Send them only from server-side code, never from a browser or mobile client, and never commit them to source control.
Usage and billing
The API uses a dollar-based usage system — the same one that powers the zenode.ai web tool. Your balance is shared across both. You can monitor consumption and top up your balance from your zenode.ai account.
Pricing is usage-based. Think of it as a credit balance that depletes as you make requests. When your balance reaches $0, requests will return 402 Payment Required until you add more credits. See Rate limits & usage for how work is counted and throttled, and REST usage billing for which endpoints fall into each class.
Set up a usage alert in your zenode.ai account so you're notified before your balance runs out.
Security best practices
- Use environment variables — never hard-code keys or log them
- Use a separate key per environment (local, staging, production)
- Rotate keys periodically
- Revoke any key you suspect has been compromised immediately
Revoking a key
Keys can be revoked instantly from the API Keys page. A revoked key returns 401 Unauthorized on the next request.