Authorization
Hugging Face TGI
Prerequisites
Before creating a Hugging Face TGI credential, you'll need to obtain an API key from your Hugging Face account. Hugging Face provides API keys for programmatic access to their Text Generation Inference (TGI) endpoints and other services.
To obtain a Hugging Face API key:
-
Log in to your Hugging Face account at
https://huggingface.coor create an account if you don't have one. -
Navigate to your account settings by clicking on your profile picture in the top right corner and selecting Settings, or by visiting
https://huggingface.co/settings. -
In the Settings page, locate the Access Tokens section in the left sidebar or scroll to find the token management section.
-
Click New token or Create token to generate a new API key. You can create tokens with different scopes (read, write) depending on your needs.
-
Give your token a descriptive name (e.g., "Nexla Integration") and select the appropriate permissions. For TGI API access, you typically need read permissions.
-
Click Generate token to create the new API key.
-
Copy the API token immediately after generation, as it may only be displayed once for security purposes. Store it securely, as you'll need it to authenticate API requests.
-
Note the base URL for your TGI endpoint (typically
https://router.huggingface.co/novitaor your custom TGI endpoint URL) and the API version you'll be using (typicallyv3/openaifor OpenAI-compatible endpoints).
For detailed information about Hugging Face API authentication and token management, refer to the Hugging Face API Documentation and Text Generation Inference API Reference.
Create a Hugging Face TGI Credential
- To create a new Hugging Face TGI credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
New Credential Overlay – Hugging Face TGI

Credential Name & Description
-
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
Resource descriptions are recommended but are not required. They should be used provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.
Authentication Settings
-
In the API Key field, enter the Hugging Face API key that you obtained from your Hugging Face account settings. This is the secret API key used to authenticate requests to the Hugging Face TGI API.
The API key is sensitive information and should be kept secure. If you've lost your API key, you'll need to generate a new one in your Hugging Face account settings. API keys are used in the Authorization header as a Bearer token for all API requests.
-
In the Base URL field, enter the base URL for the Hugging Face TGI API. The default value is
https://router.huggingface.co/novita, which is a common TGI endpoint. You can specify a different base URL if you're using a custom TGI endpoint or inference endpoint. -
In the API Version field, enter the API version you want to use. The default value is
v3/openai, which provides OpenAI-compatible API endpoints for TGI. You can specify a different version if your TGI endpoint uses a different API version.
Save the Credential
-
Once all of the relevant steps in the above sections have been completed, click the Save button at the bottom of the overlay to save the configured credential.
-
The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.