How do i use my api key?

Modified on Sun, 2 Feb at 7:27 PM

To use your API key, follow these steps:


1. Generate Your API Key: First, create an account on the AI/ML API platform and generate your API key from the Key Management section.



2. Include the API Key in Your Requests: When making API calls, include your API key in the Authorization header. For example, in Python, you would do it like this:



headers = {

    "Authorization": "Bearer your_<span class="css-e8liw6">api</span>_key_here",

}


In JavaScript, it would look like this:



headers: {

    "Authorization": "Bearer your_<span class="css-e8liw6">api</span>_key_here",

}


3. Make API Calls: Use the API key in your requests to authenticate and access the services provided by the API.



For more detailed instructions, you can visit the API reference.
https://docs.aimlapi.com/

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article