Tensorlake Account

You need to have a Tensorlake Cloud account to make API requests. You can create an account on cloud.tensorlake.ai.

The Access Control page has more information on API keys and their access.

Creating API Keys

API Keys are project-specific credentials that allow programmatic access to resources within a project.

  1. Select the project to make API calls against.
  2. Create an API key, we recommend giving it a name.

Every tensorlake API key starts with tl_apiKey_*.

Using the Tensorlake SDK

The Tensorlake SDK leverages API Keys fo authentication.

export TENSORLAKE_API_KEY=<YOU_API_KEY>
python your_app.py

For example, your_app.py:

from tensorlake.documentai import DocumentAI, ParsingOptions

doc_ai = DocumentAI()
file_id = doc_ai.upload(path="/path/to/file.pdf")
job_id = doc_ai.parse(file_id, options=ParsingOptions())
data = doc_ai.get_job(job_id=job_id)

Refer to [/documentai/](Document AI) for more examples.

Making API Requests

Every API request needs to include the API Key in the header as a Bearer Token.

For example, to make a request to the Document Parsing API, you would use the following curl command:

curl -X POST https://api.tensorlake.ai/documents/v1/parse \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "file": "tensorlake-ID",
    "outputMode": "markdown"
}'