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

# Authentication

All requests to Gizmo APIs must contain a valid API key.

## Get an API key

[Create a new API key](https://app.usegizmo.com/settings/api-keys) in the Gizmo dashboard.

## Authenticate HTTP Requests

Simply pass the API key in the `Authorization` header using the `Bearer` scheme.

## Authenticate with the Gimzo SDK

Gizmo publishes type-safe, lightweight SDKs for Typescript and Python.

### Install the SDK

<Tabs>
  <Tab icon="npm" title="npm">
    ```bash theme={"theme":"dracula"}
    npm install @gizmo-os/sdk
    ```
  </Tab>

  <Tab title="pnpm" icon="https://mintcdn.com/gizmo/xItrERMK6gGrOIXc/images/pnpm.svg?fit=max&auto=format&n=xItrERMK6gGrOIXc&q=85&s=af328fd05104d68a272de083d14ba06c" width="800" height="800" data-path="images/pnpm.svg">
    ```bash theme={"theme":"dracula"}
    pnpm add @gizmo-os/sdk
    ```
  </Tab>

  <Tab title="bun" icon="https://mintcdn.com/gizmo/xItrERMK6gGrOIXc/images/bun.svg?fit=max&auto=format&n=xItrERMK6gGrOIXc&q=85&s=0d6639fca9fd8d632fa13ac5052d0fe4" width="80" height="70" data-path="images/bun.svg">
    ```bash theme={"theme":"dracula"}
    bun add @gizmo-os/sdk
    ```
  </Tab>

  <Tab title="pypi" icon="https://mintcdn.com/gizmo/xItrERMK6gGrOIXc/images/pypi-icon.svg?fit=max&auto=format&n=xItrERMK6gGrOIXc&q=85&s=b0375365982034b270438dbc28998ebf" width="64" height="64" data-path="images/pypi-icon.svg">
    ```bash theme={"theme":"dracula"}
     pip install gizmo-sdk
    ```
  </Tab>
</Tabs>

### Authenticate with Environment Variables

Set the `GIZMO_API_KEY` environment variable to your API key you created in the Gizmo dashboard. The SDK will automatically use this environment variable to authenticate your requests.

<CodeGroup>
  ```typescript index.ts theme={"theme":"dracula"}
  import Gizmo from '@gizmo-os/sdk';

  // Uses GIZMO_API_KEY environment variable
  export const gizmo = new GizmoSDK();

  const application = await gizmo.applications.retrieve('<application-id>')
  ```

  ```python index.py theme={"theme":"dracula"}
  from gizmo_sdk import Gizmo

  client = Gizmo()

  application = client.applications.retrieve(
      "<application-id>",
  )
  ```
</CodeGroup>

### (Optional) Pass in the API key directly

As an alternative, you can pass the API key directly to the SDK constructor.

<CodeGroup>
  ```typescript index.ts theme={"theme":"dracula"}
  import Gizmo from '@gizmo-os/sdk';

  export const gizmo = new GizmoSDK({
      apiKey: '<your-api-key>',
  });

  const application = await gizmo.applications.retrieve('<application-id>')
  ```

  ```python index.py theme={"theme":"dracula"}
  from gizmo_sdk import Gizmo

  client = Gizmo(
      api_key="<your-api-key>",
  )
  application = client.applications.retrieve(
      "<application-id>",
  )
  ```
</CodeGroup>

<Warning>
  This method is great for local testing and development, but it is **not recommended** for production environments. **Never** commit your API key to version control.
</Warning>
