Speed uses API keys to authenticate requests. These keys are used by the Speed platform to identify the account, and mode you are working on and accordingly allow or restrict access to resources.

Every account has two types of keys: publishable and secret. Each type includes two keys: one for the test environment and one for the live environment.

Types of keys

Secret API key

  • Your account's secret key can be used to call almost all objects supported by Speed without any restrictions, such as creating checkout links, checkout sessions, creating payments, or checking the account balance.
  • This should be kept confidential and only used on your server-side code. Learn more about this here.
  • Sample Test Secret key: sk_test_l3o6dqxz6yJrb75Gl7ef0t0ufhhmuOV265zz6eZJST6GnqjK

Publishable API key

  • Publishable API keys are limited to certain endpoints of an object.

  • Using the publishable key, you can access a number of functionalities of Speed.js. For example, create a checkout session so that your customer can make a payment.

  • While we recommend using a secret key for maximum security, here, you can use the publishable key in the client-side code of your web or mobile app.

  • Sample Test Publishable key: pk_test_l3o6d77z6yJrbuCGl7ef0s9nsuR5kWPyvNhOteD7O58hieSR

Keys in different modes

Users can make API requests in either test or live mode for their respective Speed accounts using applicable keys. API objects created in one mode (for example, a checkout link) are not accessible in the other using the same key. This means that the test key will provide test account information, while the live key will provide live account information.

Test mode:

  • The test mode is a simulation mode that you can use to test your integration flow. Your customers will not be able to make actual payments in this mode. However, you and your customer can simulate the entire payment process in our test mode. See more about this here.

  • For Test mode, the Speed Platform provides,

    • One (default) publishable key.
    • One (default) secret key.

    It means you cannot create any more keys in this mode.

Live mode:

  • When you're ready to launch your app, replace your test key with a live key to start accepting customer payments.
  • For Live mode, the Speed Platform provides,
    • One (default) publishable key.
    • One (default) secret key for this mode.
    • Additionally, you can generate new secret keys. (Right now, you can generate two more secret keys in addition to the default one.)

How to get API keys?

Follow these steps to acquire the API keys:

  1. Log into your Speed web application with your login credentials.
  2. Select the mode (Test or Live) for which you want to generate the API keys.
  3. Navigate to DevelopersAPI KeysStandard Keys to generate keys for the selected mode.
  4. You will see both publishable and secret keys here.
  5. Click the reveal key button to generate the required keys.
  6. Click on the Create Secret Key button to generate new secret keys. See Manage API keys for more information.