Authorization
Alpaca
Prerequisites
Before creating an Alpaca credential in Nexla, you need an active Alpaca account and a set of API keys for the appropriate environment (paper trading or live trading).
Create an Alpaca Account
If you do not already have an Alpaca account, follow these steps to create one:
-
Navigate to alpaca.markets and click Get Started or Sign Up.
-
Enter your name, email address, and password, then submit the form.
-
Check your email inbox for a verification message from Alpaca and click the confirmation link to activate your account.
-
Log in to your new account and complete any additional identity verification steps required by Alpaca.
Generate API Keys
Alpaca provides separate API keys for its paper trading (simulated) environment and its live trading (production) environment. Generate the keys for the environment you intend to use with Nexla.
-
Log in to your Alpaca account at app.alpaca.markets.
-
In the top-left corner of the dashboard, confirm that the correct account type is selected — Paper Trading for a simulated environment or the live account for production.
-
On the Home tab, locate the API Keys section and click Generate New Keys (or Regenerate if keys already exist).
-
Copy both the API Key ID and the Secret Key immediately and store them in a secure location. The Secret Key is only displayed once — it cannot be retrieved after you close or navigate away from this screen.
Store your Secret Key securely at the time of generation. Alpaca does not allow you to view the Secret Key again after it has been shown. If the key is lost, you must regenerate a new key pair.
Paper trading keys and live trading keys are distinct credentials associated with different API endpoints. Use paper trading keys when connecting to https://paper-api.alpaca.markets and live trading keys when connecting to https://api.alpaca.markets. Using the wrong key pair for the environment will result in authentication errors.
For complete information about API key management, refer to the Alpaca Authentication documentation.
Create an Alpaca Credential
- To create a new Alpaca credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
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 to provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.
API Key Authentication
Alpaca uses API key authentication. Each request to the Alpaca API is authenticated by passing your API Key ID and Secret Key as HTTP headers. Nexla handles this header injection automatically once the credential is saved.
-
Enter your Alpaca API Key ID in the API Key field. This is the alphanumeric identifier generated on the Alpaca dashboard (for example,
PKXXXXXXXXXXXXXXXXfor paper accounts orAKXXXXXXXXXXXXXXXXfor live accounts). -
Enter your Alpaca Secret Key in the Secret Key field. This value was displayed once when the key pair was generated. Nexla encrypts this value at rest after the credential is saved.
Ensure that the API Key ID and Secret Key correspond to the same environment (paper or live). Mixing keys from different environments will result in authentication failures.
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.