Skip to main content
Base URL: https://api.hostlinku.com. All gateway endpoints are located under /v1 and accept the Hostlinku API key (sk-…) via the Authorization: Bearer or x-api-key header.

Rate Limiting

To maintain service quality for all users, the gateway enforces the following limits per API key: Rate limit details:
  • 60-second window per API key; requests from all models are counted together.
  • Requests rejected by the limiter do not affect the balance (no credit is reserved).
  • Console and public endpoints (/api/*) are limited to 120 requests per minute per IP; authentication endpoints 30 attempts / 15 minutes per IP.
When you reach the limit:
  • Returns an HTTP 429 Too Many Requests error.
  • The Retry-After header specifies the recommended number of seconds before retrying.
  • The RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset headers (IETF format) indicate the current RPM quota.

Anthropic Messages API Format

POST /v1/messages Call the model using the native Anthropic format. The request header must include x-api-key: YOUR_API_KEY (or Authorization: Bearer). Compatible with the Anthropic SDK, Claude Code, Cursor, and Cline—simply set ANTHROPIC_BASE_URL=https://api.hostlinku.com. Complete documentation: Anthropic Messages.

Request Body Parameters

Example Request

Response Example

Output Streaming

Responses are sent per segment in SSE format:

OpenAI Protocol (Chat Completions API)

POST /v1/chat/completions Call any model using the OpenAI Chat Completions format. The request header must include Authorization: Bearer YOUR_API_KEY. The OpenAI SDK simply needs to be configured with base_url="https://api.hostlinku.com/v1". Full documentation: Chat Completions.

Request Body Parameters

Example Request

Example Response

Output Streaming

OpenAI Responses API Format

POST /v1/responses The format used by Codex CLI, OpenAI Agents SDK, and client.responses.create(). The request header includes Authorization: Bearer YOUR_API_KEY; the base URL is https://api.hostlinku.com/v1. Stateless: store is always false, previous_response_id results in a 400 error — send the full history in input. Complete documentation: Responses API.

Request Body Parameters

Example Request

Example Response

Output Streaming

Error Codes

The envelope error follows the protocol of the called endpoint: /v1/chat/completions → { "status": "error", "error": { "code", "message" } }; /v1/messages → { "type": "error", "error": { "type", "message" } }; /v1/responses → { "error": { "message", "type", "param", "code" } }. Error messages never contain the identity or raw text of the upstream provider. A complete list of OpenAI-format codes is available at Error.

429 Response Headers

Query Available Models

GET /v1/models Returns the available models for the Service Mode API key being used, along with the price per 1M tokens in that mode.

Example Request

Response Example