Tensorlake Account

You need to have a Tensorlake Cloud account to make API requests. 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.

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())

HTTP API

HTTP 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/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'labels={}'

Understand Access

Learn about the access control model for API Keys