Skip to main content

Tensorlake Account

You need to have a Tensorlake Cloud account to make API requests if you’re using the Python SDK or directly calling the REST API. You can create an account on cloud.tensorlake.ai.

API keys

API keys are project-specific credentials that allow programmatic access to resources within a project. Each API key exists solely within the context of its project and has the same permissions as a project member.
API keys cannot have organization-level permissions.

Creating API keys

  1. Go to the Tensorlake Dashboard
  2. Select the project to make API calls against.
  3. Create an API key.
Create API key
Every tensorlake API key starts with tl_apiKey_*.

Tensorlake Python SDK

The Tensorlake SDK leverages API keys fo authentication. For example:
your_app.py
from tensorlake.documentai import DocumentAI, ParsingOptions

API_KEY="tl__apiKey_xxxx"
doc_ai = DocumentAI(api_key=API_KEY)
file_id = doc_ai.upload(path="/path/to/file.pdf")
job_id = doc_ai.parse(file_id, options=ParsingOptions())

REST API

REST API requests needs to include the API key in the header as a Bearer Token. For example, to make a request to the Document File Management API, you would use the following curl command:
curl --request POST \
  --url https://api.tensorlake.ai/documents/v2/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'labels={}'

Frequently Asked Questions

You can regenerate your API key from the Tensorlake Dashboard. Go to your project settings, find the API keys section, and create a new key. Remember to update your applications with the new key.
No, API keys are project-specific. Each API key only works within the context of the project where it was created. You’ll need separate API keys for each project.
API keys have the same permissions as a project member. They cannot have organization-level permissions and are limited to project-specific operations.
Create a new API key first, update your applications to use the new key, then delete the old key from the dashboard. This ensures no downtime during rotation.
Immediately delete the compromised API key from the Tensorlake Dashboard and generate a new one. Update all applications using the old key as soon as possible.
API keys do not have explicit expiration dates. Each API key will remain active until it is deleted.
This usually means your API key is invalid, was deleted, or is not properly included in the Authorization header as a Bearer token. Verify your key exists in the project you expect on the Tensorlake Dashboard, then verify format and header structure.
Use environment variables or secure credential management systems. Never hardcode API keys in your source code or commit them to version control.
API keys are for programmatic access and machine-to-machine communication, while user authentication is for interactive dashboard access. API keys don’t expire with user sessions.
API keys inherit project member permissions.
I