Update authentication docs with code examples and API endpoint

This commit is contained in:
Dhravya Shah 2026-02-08 10:37:50 -08:00 committed by GitHub
parent bf82efe2bf
commit 7b6793ecf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
---
title: Authentication
description: API keys, scoped keys, and connector branding.
title: "Authentication"
description: "API keys, scoped keys, and connector branding."
icon: "key"
---
@ -21,12 +21,14 @@ curl https://api.supermemory.ai/v3/search \
-d '{"q": "hello"}'
```
```typescript TypeScript
import Supermemory from "supermemory";
const client = new Supermemory({ apiKey: "YOUR_API_KEY" });
```
```python Python
from supermemory import Supermemory
@ -63,7 +65,7 @@ This works for Google Drive, Notion, and OneDrive. See the full setup in [Custom
### Create a scoped key
```bash
curl https://api.supermemory.ai/api/auth/scoped-key \
curl https://api.supermemory.ai/v3/auth/scoped-key \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
@ -76,13 +78,13 @@ This works for Google Drive, Notion, and OneDrive. See the full setup in [Custom
### Parameters
| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `containerTag` | Yes | — | Alphanumeric, hyphens, underscores, colons, dots |
| `name` | No | `scoped_{containerTag}` | Display name for the key |
| `expiresInDays` | No | — | 1365 days |
| `rateLimitMax` | No | `500` | Max requests per window (110,000) |
| `rateLimitTimeWindow` | No | `60000` | Window in milliseconds (13,600,000) |
| Parameter | Required | Default | Description |
| --------------------- | -------- | ----------------------- | ------------------------------------------------ |
| `containerTag` | Yes | — | Alphanumeric, hyphens, underscores, colons, dots |
| `name` | No | `scoped_{containerTag}` | Display name for the key |
| `expiresInDays` | No | — | 1365 days |
| `rateLimitMax` | No | `500` | Max requests per window (110,000) |
| `rateLimitTimeWindow` | No | `60000` | Window in milliseconds (13,600,000) |
### Response
@ -98,4 +100,4 @@ This works for Google Drive, Notion, and OneDrive. See the full setup in [Custom
```
Use the returned key exactly like a normal API key — it just won't work outside its container scope.
</Accordion>
</Accordion>