Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.36 KB

File metadata and controls

79 lines (56 loc) · 2.36 KB
title Authentication
sidebarTitle Authentication
icon key
description How to authenticate with the Tuteliq API
keywords
API key
bearer token
auth
x-api-key

Every request to the Tuteliq API must include a valid API key. You can create and manage keys from the Tuteliq Dashboard.

Authentication methods

Tuteliq supports two ways to pass your API key. Both are equivalent; use whichever fits your stack.

Bearer token

Pass the key in the Authorization header:

curl https://api.tuteliq.ai/v1/safety/detect-unsafe \
  -H "Authorization: Bearer YOUR_API_KEY"

x-api-key header

Pass the key in a dedicated header:

curl https://api.tuteliq.ai/v1/safety/detect-unsafe \
  -H "x-api-key: YOUR_API_KEY"

If both headers are present, Authorization: Bearer takes precedence.

SDK authentication

```typescript Node.js import { Tuteliq } from "@tuteliq/sdk";

const tuteliq = new Tuteliq({ apiKey: process.env.TUTELIQ_API_KEY, });

```python Python
from tuteliq import Tuteliq

client = Tuteliq(api_key=os.environ["TUTELIQ_API_KEY"])
import Tuteliq

let client = Tuteliq(apiKey: ProcessInfo.processInfo.environment["TUTELIQ_API_KEY"]!)

Never hard-code API keys in source code. Use environment variables or a secrets manager.

Environments and tiers

Each API key is scoped to an environment. The environment determines which rate-limit tier applies:

Environment Tier Rate limit
production Premium 1,000 req/min
staging Basic 300 req/min
development Free 60 req/min

You select the environment when creating a key in the dashboard. Keys cannot be moved between environments after creation.

Security

  • API keys are hashed with SHA-256 before being stored. Tuteliq never retains your plaintext key.
  • Keys are shown only once at creation time. If you lose a key, revoke it and create a new one.
  • Each request updates the key's last_used_at timestamp and increments its requests_count, both visible in the dashboard.
If you suspect a key has been compromised, revoke it immediately from the [Dashboard](https://tuteliq.ai/dashboard) and generate a replacement.