\n\n\n\n\n## FastAPI SDK\n\n[](https://github.com/topics/apitoolkit-sdk) [](https://pypi.org/project/apitoolkit-fastapi) [](https://pypi.org/project/apitoolkit-fastapi) [](https://apitoolkit.io/discord?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme) [](https://apitoolkit.io/docs/sdks/python/fastapi?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme) \n\nAPItoolkit is an end-to-end API and web services management toolkit for engineers and customer support teams. To integrate your FastAPI (Python) application with APItoolkit, you need to use this SDK to monitor incoming traffic, aggregate the requests, and then deliver them to the APItoolkit's servers.\n\n
\n\n---\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Contributing and Help](#contributing-and-help)\n- [License](#license)\n\n---\n\n## Installation\n\nKindly run the command below to install the SDK:\n\n```sh\npip install apitoolkit-fastapi\n```\n\n## Configuration\n\nNext, initialize APItoolkit in your application's entry point (e.g., `main.py`), like so:\n\n```python\nfrom fastapi import FastAPI\nfrom apitoolkit_fastapi import APIToolkit\n\napp = FastAPI()\n\n# Initialize APItoolkit\napitoolkit = APIToolkit(\n api_key = '{ENTER_YOUR_API_KEY_HERE}'\n debug = False\n tags = [\"environment: production\", \"region: us-east-1\"]\n service_version = \"v2.0\"\n)\napp.middleware('http')(apitoolkit.middleware)\n\n\n@app.get(\"/\")\ndef read_root():\n return {\"Hello\": \"World\"}\n```\n\n> [!NOTE]\n> \n> The `{ENTER_YOUR_API_KEY_HERE}` demo string should be replaced with the [API key](https://apitoolkit.io/docs/dashboard/settings-pages/api-keys?utm_source=github-sdks) generated from the APItoolkit dashboard.\n\n \n\n> [!IMPORTANT]\n> \n> To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this [SDK documentation](https://apitoolkit.io/docs/sdks/python/fastapi?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme).\n\n## Contributing and Help\n\nTo contribute to the development of this SDK or request help from the community and our team, kindly do any of the following:\n- Read our [Contributors Guide](https://github.com/apitoolkit/.github/blob/main/CONTRIBUTING.md).\n- Join our community [Discord Server](https://apitoolkit.io/discord?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme).\n- Create a [new issue](https://github.com/apitoolkit/apitoolkit-fastapi/issues/new/choose) in this repository.\n\n## License\n\nThis repository is published under the [MIT](LICENSE) license.\n\n---\n\n