Endpoints & Authentication
Base URLs
| Endpoint | Base URL |
|---|---|
| Default | https://api.llmnex.com |
| Hong Kong acceleration | https://hk.llmnex.com |
Examples use https://api.llmnex.com by default. To use Hong Kong acceleration, change only the base URL. Keep the API paths and authentication unchanged.
https://www.llmnex.com is the console for creating keys and reviewing usage and bills, not an API endpoint.
| Operation | Method and path |
|---|---|
| List models | GET /v1/models |
| Generate images with Gemini | POST /v1beta/models/{model}:generateContent |
Only Gemini models are currently supported. For direct HTTP calls, combine the base URL with the complete endpoint path.
For example, list models through the Hong Kong acceleration endpoint:
curl "https://hk.llmnex.com/v1/models" \
-H "Authorization: Bearer YOUR_API_KEY"Get an API Key
Create a token in the LLMNEX console. Keys look like sk-xxxxxxxx.
Keep your key private
Make requests from your server. Do not embed keys in frontend code or client apps. Replace the YOUR_API_KEY placeholder with your own key and never commit it to a repository.
Bearer Authentication
The model-list and image-generation examples use:
Authorization: Bearer YOUR_API_KEYGemini Authentication
Gemini endpoints also accept the following header. Use either this or Bearer authentication.
x-goog-api-key: YOUR_API_KEYFor endpoint-specific parameters and compatibility limits, see the Gemini Image Guide.