Skip to main content

Which Credentials You Need

To call an API that is published in the API Portal & AI Hub, you need the endpoint URL of the API and the right credentials in the right headers. An API requires an OAuth2 access token, an API key, or both. A subscription token is needed only when the API has a subscription rate limiting policy. When an API requires more than one credential, send all of them.

CredentialWhat It ProvesWhere It Comes FromHeader
Subscription tokenYou are subscribed to the API under a plan, so the gateway knows which rate limit to apply. Needed only when the API has a subscription rate limiting policy.Subscribing to a plan of the API in the portal.Subscription-Key
API keyYou are an authorized caller of the API.The API Keys page of the API in the portal, or the API publisher.The header configured in the API Key Auth policy of the API.
OAuth2 access tokenYou hold valid client credentials on a key manager.A key manager, through an OAuth2 key under Keys › OAuth2 Keys.Authorization: Bearer <token>

Find Out What an API Expects​

The API's specification defines which credentials the API requires.

  1. Open the API, and click Documentation, then API Definition.

  2. In securitySchemes, check what the API defines. A scheme of type oauth2 means an access token. A scheme of type apiKey names its header in the name field.

  3. In the security entries, check what the API requires. A root-level security block applies to every operation, and an operation can override it with its own. A scheme that is defined but not referenced in security is not required.

  4. Check whether the API has subscription plans. If it does, you need a subscription token to call it.

The page of the API also shows a Subscription plans panel when the API has subscription plans.

Get Each Credential​

CredentialHow to Get It
Subscription tokenOn the page of the API, under Subscription plans, click Subscribe on a plan, and copy the token. To view the token later, click View subscription on the plan. See Manage Subscriptions.
API keyOn the page of the API, click API Keys, and generate a key. A publisher can also create keys in the API Control Plane. See Consume an API-Key-Secured API and API Keys.
OAuth2 access tokenGenerate an OAuth2 key under Keys › OAuth2 Keys, and get a token with it. ThunderID is the default key manager. See Consume an OAuth2-Secured API.

Next Steps​

Was this page helpful?