Skip to main content
The Hostlinku gateway uses Bearer token authentication with an API key in the format sk-…. Include the API key in every request to the /v1/* endpoint:
For the Anthropic Messages endpoint, the x-api-key: sk-… header is also accepted. API keys are created and managed at console.hostlinku.com, under the API Keys menu.

Creating an API Key

  1. Open the console → API Keys → Create API Key.
  2. Enter the Name, the optional Expiration Date, and the optional Credit Limit.
  3. Copy the secret that appears. The secret appears only once.
API keys are stored on the server as SHA-256 hashes: the original values are never stored and cannot be retrieved. Old API keys in the legacy format (hl_live_…) still work because authentication is based on the hash, not the prefix.

API Key Validity Period

Optional expiration date when creating an API key: Expired API keys are rejected with the following message:

Credit Limit per API Key

Each API key can be assigned a usage limit in USD (creditLimit) with a reset window: Usage is calculated based on the actual request costs (requests.customer_cost) recorded for that API key. When the cumulative cost reaches the limit, subsequent requests are rejected with a 402 PAYMENT_REQUIRED error:
The credit limit is different from the account balance: the limit applies to a single API key, while the account balance is the funding source for all API keys. Both must be sufficient for requests to succeed. See Billing & Balance.

Rate Limit

In addition to credit limits, the gateway enforces rate limits per API key:
  • POST /v1/chat/completions: 600 requests per minute per API key.
  • Console/public endpoint (cookie-based session): 120 requests per minute per IP address.
  • Authentication endpoints (login, sign-up, reset): 30 attempts per 15 minutes per IP address.
Exceeding the limit results in 429 RATE_LIMITED. For details, see Usage & Limits.

Common Authentication Errors