> ## 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

> [tab] npm
>
> ```bash theme={"theme":"dracula"}
> npm install @gizmo-os/sdk
> ```

> [tab] pnpm
>
> ```bash theme={"theme":"dracula"}
> pnpm add @gizmo-os/sdk
> ```

> [tab] bun
>
> ```bash theme={"theme":"dracula"}
> bun add @gizmo-os/sdk
> ```

> [tab] pypi
>
> ```bash theme={"theme":"dracula"}
>  pip install gizmo-sdk
> ```

### 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.

```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>",
)
```

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

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

```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>",
)
```

> [!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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.