Documentation
API Reference

Authentication

Authenticate your requests using secret Bearer keys.

Authorization header#

All API requests must include your secret API key in the HTTP Authorization header:

HTTP
Authorization: Bearer tc_live_key

API keys#

Your account provides two key types to isolate environments:

Test Key

For sandbox testing and draft queries.

tc_test_xxxxx

Live Key

For production traffic and database access.

tc_live_xxxxx
⚠️
Keep API keys secretNever expose your API keys in frontend applications (like React, Next.js client components, or mobile client builds). Always route requests through a secure backend server to protect your credentials.

Verify credentials#

You can verify your connection and check your active API scope by sending a GET request to the verify endpoint:

GET/v1/auth/verify

Request

BASH
curl -H "Authorization: Bearer tc_live_key" \
  https://api.trained.chat/v1/auth/verify

Response

JSON
{
  "status": "authenticated",
  "organization": "Acme Corp",
  "scope": ["read", "write"]
}