Authentication and API keys
Create a key
Section titled “Create a key”Create an sk_ API key in the API center. The full key is shown only once, when it is created or rotated.
Use a separate key for each application, environment and automated task, so each can have its own budget and be disabled, rotated and audited on its own.
Send the credential
Section titled “Send the credential”Recommended:
X-API-Key: sk_your_keyThe standard Bearer form also works:
Authorization: Bearer sk_your_keySend only one of the two in a request.
curl https://omnidoc.top/api/v1/jobs \ -H "X-API-Key: $OMNIDOC_API_KEY"What a key represents
Section titled “What a key represents”A key acts for the account that created it: it can call the services that account may use and reach only that account’s resources. A key cannot change the sign-in email, password, phone number or profile, and cannot create, rotate or revoke API keys.
Optional limits:
allowed_engines: only the listed translation settings; an empty array adds no key-level limit.expires_at: expiry time.quota_limit: the key’s lifetime budget in whole millicredits;0sets no key-level budget, and the account’s credits are settled as usual.
Rotate and revoke
Section titled “Rotate and revoke”Create keys, change their limits, rotate or revoke them in the API center. Once a key is revoked, disabled or expired, or its account is disabled, new requests fail immediately.
Rotation creates a new secret and disables the old one at once; the new key keeps the original limits and the budget already used. An expired key cannot be rotated; create a new one. For a smooth switch, create a new key and deploy it, confirm that calls succeed, then revoke the old key.
Security
Section titled “Security”- Keep keys only on the server or in a controlled runtime.
- Use environment variables or a secrets manager; never put keys in source code, logs, browser bundles or public repositories.
- Never send the key to upload or download addresses returned by the API.
- Log the key ID, request ID and operation ID; never log the full key.
- If a key leaks, rotate it at once and review its jobs and charges.