> For the complete documentation index, see [llms.txt](https://docs.aimlapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aimlapi.com/faq/can-i-use-api-in-python.md).

# Can I use API in Python?

Quick guide about how to configure Python on different operational systems to use AI/ML API with it.

Of course you can! Here is a quick guide on how to configure your environment and use our API.

## Installation

Our API is just an interface, which means you need to use it within some application or code. When you choose Python, you first need to install it on your system.

### Is it already installed?

Depending on your operating system and version, it might already be installed out-of-the-box. To test it, you need to open the [terminal ](/glossary/concepts.md#terminal)and type one of the following commands:

```bash
python3 --version
python --version
py --version
```

If any of these commands print a Python version higher than 3.8, as shown below, then Python is properly installed:

```bash
Python 3.11.0
```

If your result is different (for example, if it just prints "Python" without a version or if on Windows 11 the Microsoft Store opens), then it isn't installed.

### On Windows

You can install Python from the [Microsoft Store marketplace](https://apps.microsoft.com/detail/9pjpw5ldxlz5?hl=en-US\&gl=US) if you are using a newer version of Windows 11, or you can follow the [official Python distribution site](https://www.python.org/downloads/) and install it as a usual executable from there. You can safely install version 3.10 as most modern modules support it, or the latest version if you wish.

### On Mac

There are several good articles that describe the installation process. You can look at one [here](https://docs.python-guide.org/starting/install3/osx/) or search the Internet for more options.

### On Linux

The installation process varies depending on your Linux distribution. Here is an example for Ubuntu (make sure that Python isn't installed, as described in the beginning):

```bash
sudo apt update
sudo apt install -y python3-venv
```

## Using

Test your installation and you can proceed with the tutorial on the [quickstart](broken://pages/ngeSCZKxiGVWqYZTHDjY) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aimlapi.com/faq/can-i-use-api-in-python.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
