> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getdecipher.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FastAPI

> Learn how to quickly set up Decipher in your FastAPI application.

<Check>**⏱ Estimated Time To Completion: 5 minutes**</Check>

<Note>
  Please make sure you've [installed Decipher for your frontend](/pages/browser-quickstart) via Sentry before continuing.
</Note>

<Steps>
  <Step title="Install the SDK">
    Decipher uses the Sentry SDK to collect runtime data from your application. Installation is simple:

    ```shell Bash theme={null}
    pip install --upgrade 'sentry-sdk[fastapi]'
    ```

    The FastAPI integration will be **automatically enabled** when you initialize the Sentry SDK, provided the FastAPI package is included in your application's dependencies.
  </Step>

  <Step title="Initialize the SDK">
    Initialize the SDK as soon as possible in your application's runtime.

    ```python theme={null}
    import sentry_sdk

    sentry_sdk.init(
        dsn="YOUR_DECIPHER_DSN", # Get this at https://app.getdecipher.com/settings?section=projects
        traces_sample_rate=1.0,
        profiles_sample_rate=1.0,
    )

    app = FastAPI(__name__)
    # ...
    ```

    You can get the `dsn` parameter by creating a project within [Decipher](https://app.getdecipher.com) with your work email. On the [Settings > Projects](https://app.getdecipher.com/settings?section=projects) page, select a new project name and click "**Create New Project**". Decipher will generate a DSN to that you can paste.
  </Step>

  <Step title="Test the integration">
    Throw an error anywhere in your application and Decipher will automatically capture the exception and runtime alongside it.

    For example:

    ```python theme={null}
    from FastAPI import FastAPI

    sentry_sdk.init(...)   # See above

    app = FastAPI(__name__)

    @app.route("/")
    def hello_world():
        1 / 0  # raises an error
        return "<p>Hello, World!</p>"

    ```

    Check out the [Decipher dashboard](https://app.getdecipher.com) to see information about your captured error.
    Decipher will automatically analyze and group your errors to highlight the important, high-impact ones.
  </Step>
</Steps>
