TenZenTenzen AI
User Guide

Authentication

API keys and auth headers for OpenAI, Anthropic, and Gemini-style APIs

All HTTP API calls to model endpoints must be authenticated with an API key (access token) from the Tenzen AI console. The same key is typically reused across protocols; only the headers and base URL change.

For self-hosted deployments, replace https://tenzen.ai with your gateway root. If your paths differ from the examples, follow your operator’s documentation.

Get an API key

  1. Sign in to the Tenzen AI console (or your self-hosted admin).
  2. Create an API token in the console.
  3. Copy and store the secret safely.
  4. If the full secret is shown only once, save it immediately—you may need to create a new key if it is lost.

Auth by protocol

OpenAI-compatible

Use the Authorization header:

Authorization: Bearer <YOUR_API_KEY>
from openai import OpenAI

client = OpenAI(
    base_url="https://tenzen.ai/v1",
    api_key="<YOUR_API_KEY>",
)

Anthropic Messages

Use x-api-key plus anthropic-version (value per your gateway docs):

x-api-key: <YOUR_API_KEY>
anthropic-version: 2023-06-01

Gemini-compatible routes

Use x-goog-api-key:

x-goog-api-key: <YOUR_API_KEY>

Example generateContent URL (matches Quick Start):

curl "https://tenzen.ai/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Hello"}]}]}'

Some tools use a dedicated /gemini base path; the header name usually stays x-goog-api-key.

Environment variables

TENZEN_API_KEY=<YOUR_API_KEY>

OPENAI_API_KEY=<YOUR_API_KEY>
OPENAI_BASE_URL=https://tenzen.ai/v1

ANTHROPIC_API_KEY=<YOUR_API_KEY>
ANTHROPIC_BASE_URL=https://tenzen.ai/v1

GEMINI_API_KEY=<YOUR_API_KEY>

When a CLI expects ANTHROPIC_BASE_URL with an /anthropic prefix, follow Tool Integration and that tool’s docs; the key is still the same console token.

Security practices

  1. Never hard-code keys; use env vars or a secret manager.
  2. Rotate keys regularly; revoke immediately if leaked.
  3. Use separate keys per environment (dev/staging/prod).
  4. Monitor usage and anomalies in the console.
  5. Prefer per-project keys for traceability.

Do not commit .env or secrets to Git—add them to .gitignore.

Next steps