Get started
Authentication
The native API authenticates with an API key passed in the x-api-key header. Keys are created and managed from your dashboard.
API keys
Create and manage keys on the API keys page. Keys start with tnsa_ and are shown only once, when you create them. Each key can carry its own spend limit. Treat keys like passwords.
- Store keys in environment variables, never in code or the browser.
- Use separate keys per environment (development, staging, production).
- Set a usage limit on a key to cap how much it can spend.
- Rotate or revoke a key immediately if it may have leaked.
The x-api-key header
Pass your key in the x-api-key header on every request:
curl https://api.tnsaai.com/v1/chat/completions \
-H "x-api-key: $TNSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "NGen-4.3-Pro", "messages": [{ "role": "user", "content": "Hello" }] }'Using an OpenAI client
The OpenAI-compatible endpoint at https://api.tnsaai.com/v1 works with OpenAI SDKs: change the base URL and send your key in the x-api-key header. See Libraries & SDKs.
import os
from openai import OpenAI
key = os.environ["TNSA_API_KEY"]
client = OpenAI(
base_url="https://api.tnsaai.com/v1",
api_key=key,
default_headers={"x-api-key": key},
)Leaked keys may be disabled
Credits
All of your keys spend from one prepaid credit balance, the same one the Playground uses. Add credits on the Billing page. A per-key spend limit caps what a single key can use, on top of the shared balance.
Authentication errors
401: nox-api-keyheader was sent.402 insufficient_credits: your credit balance is used up. Top up on Billing.403: the key is unknown, revoked, or over its spend limit.
See Error handling for the full list of status codes.