Authentication
How to include authentication credentials in requests
TokenLink supports three authentication methods, matching three API protocol formats.
OpenAI-compatible API
Use an HTTP Bearer Token:
curl https://tokenlink.stelarx.ai/openai/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY"You can also use an API Key header:
curl https://tokenlink.stelarx.ai/openai/chat/completions \
-H "x-api-key: YOUR_API_KEY"Anthropic-compatible API
Use the API Key header (consistent with Anthropic's official API):
curl https://tokenlink.stelarx.ai/anthropic/v1/messages \
-H "x-api-key: YOUR_API_KEY"Gemini-compatible API
Use the Google API Key header (consistent with Gemini's official API):
curl https://tokenlink.stelarx.ai/gemini/v1beta/models/gemini-2.5-flash:generateContent \
-H "x-goog-api-key: YOUR_API_KEY"How to get an API Key
- Log in to the TokenLink console
- Create a new API Key
- Copy the key (shown only once)
- Pass it via a header in your requests
Security recommendations
- Do not put API Keys in client-side code or version control
- Store API Keys in environment variables
- Set an IP allowlist for the key in the console
- Rotate keys regularly