Concepts

Authentication

Token formats, authentication headers, and security guidance for the TENSORAXIS API.

Every API request must be authenticated with a TENSORAXIS token. You can create tokens from the Tokens page in the console and scope them by model, group, IP, rate limits, and other policies.

OpenAI-Compatible APIs

OpenAI-compatible endpoints use the Authorization header:

curl https://api.tensoraxis.com/v1/chat/completions \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

This applies to endpoints such as /v1/chat/completions, /v1/responses, /v1/embeddings, /v1/images/*, /v1/audio/*, /v1/rerank, and /v1/video/generations.

Claude Native APIs

Claude-native requests can use x-api-key together with the Anthropic version header:

curl https://api.tensoraxis.com/v1/messages \
  -H "x-api-key: $TENSORAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Gemini Native APIs

Gemini-native requests support the key query parameter and the x-goog-api-key header:

curl "https://api.tensoraxis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Hello"}]}]
  }'

Security Recommendations

  • Do not put API keys in frontend code, mobile bundles, public repositories, or screenshots.
  • On servers, read tokens from environment variables such as TENSORAXIS_API_KEY.
  • Create separate tokens for separate applications, and scope each token by model, group, IP, quota, and rate policy.
  • If a token is exposed, disable or rotate it immediately from the console.

For backward compatibility, https://www.tensoraxis.com/v1 can still be used as an API origin. New integrations should use https://api.tensoraxis.com/v1.