Authentication
The LLM-ready API supports following three methods of authentication:
If you need access to the LLM-ready API, please email market.intelligence@spglobal.com to obtain your LLM-ready API Okta credentials.
Browser Login
Browser login is available in the Python Library by executing the following code:
client = Client()
This will open a browser window for you to sign in with your LLM-ready API Okta credentials, and redirect you to the client. The username is the email address used for trial credentials. Remember to close the browser and return to your Python editor.
Note: This method is not applicable when working on a remote machine without direct access to a browser window. It is not advised to use them in production workflow scenarios.
Refresh Token
Refresh tokens are short strings which can be used to generate access tokens for API calls. Refresh tokens expire seven days after their last use, making them a great option for short-term API access. It is not advised to use them in production workflow scenarios unless the API is used at least once a week.
See Kensho's general instructions at authentication.
This is the simplest form of authentication, where you log in to the LLM-ready API directly using your browser. We do not recommend this method for production use, but it is the easiest way to get started.
To get your refresh token, follow these steps:
- Navigate to LLM-ready API Manual Login (opens in a new tab)
- Log in with your LLM-ready API Okta credentials
- Copy the refresh token
- Use the refresh token to authenticate your API requests. Here is an example in Python:
client = Client(refresh_token="your_refresh_token_here")
Public/Private Key
Public/Private keypair authentication is recommended when using Kensho APIs for production use cases. While it requires some additional setup, this method is the most secure and easy way to use Kensho APIs in the long term.
Follow the remaining instructions at authentication/keypair.