HuiLinkHuiLink
HomeConsoleModelsDocsContact
HuiLinkHuiLink

One gateway for every AI model you use.

Product

  • Models
  • Docs

Resources

  • API Reference
  • Frequently Asked Questions
  • Contact

Company

  • Privacy Policy
  • Terms of Service
  • Acceptable Use Policy
  • Content Policy
  • Refund Policy
  • Data Policy
  • Training Policy

© 2026 HuiLink. All rights reserved.

ICP License: 粤ICP备2025396154号-2

HuiLink is an independent infrastructure platform. Third-party model names are trademarks of their respective owners.

Documentation
  • Quickstart
    • Authentication
    • Endpoints
    • Chat Completions
    • Embeddings
    • Image Generation
    • Video Generation
    • Audio (TTS / Transcriptions)
    • Rerank
    • Models
    • Rate Limits
    • Error Codes
    • Chat Completion
    • Streaming
    • Tool Calling
    • Embeddings
    • Agent Integration
  • Pricing
  • FAQ

Base URL

https://gateway.hkting.com/v1
Documentation
Documentation
  • Quickstart
    • Authentication
    • Endpoints
    • Chat Completions
    • Embeddings
    • Image Generation
    • Video Generation
    • Audio (TTS / Transcriptions)
    • Rerank
    • Models
    • Rate Limits
    • Error Codes
    • Chat Completion
    • Streaming
    • Tool Calling
    • Embeddings
    • Agent Integration
  • Pricing
  • FAQ

Base URL

https://gateway.hkting.com/v1

OpenAI Compatibility

Keep your existing OpenAI SDK code — change one line and route to 50+ models.

The HuiLink gateway implements the OpenAI API protocol: same endpoints, same request/response shapes, same streaming format, and OpenAI-style errors. Point the official OpenAI SDK at our base URL and use your HuiLink API key.

Base URL

https://gateway.hkting.com/v1

Connect with the official SDK

Install the official openai package, swap the base URL and API key — everything else stays the same.

cURL
curl https://gateway.hkting.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-huilink-key" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Environment variables

Tools and frameworks that read standard OpenAI env vars work without code changes.

bash
# Shell — works with any tool that reads standard OpenAI env vars
export OPENAI_API_KEY="sk-your-huilink-key"
export OPENAI_BASE_URL="https://gateway.hkting.com/v1"

# No code changes at all — the official SDK picks these up automatically

Parameter support

What happens to each OpenAI chat-completions parameter when it reaches the gateway.

ParameterSupportedNotes
modelRequired. Normalized to lowercase for routing and billing.
messagesString content and multimodal content arrays are both accepted.
streamServer-sent events; terminated by a data: [DONE] frame.
temperature / top_pForwarded to the upstream provider.
max_tokensAuto-raised to the model's minimum for reasoning models.
max_completion_tokensAccepted and mapped to max_tokens.
stop / seed / userForwarded unchanged.
frequency_penalty / presence_penaltyForwarded unchanged.
toolsFunction definitions; availability depends on the target model.
tool_choice"auto" | "none" | "required" | {type:"function",…}.
reasoning_effortPassed to reasoning-capable models; ignored elsewhere.
nAccepted but capped to 1 — only one completion is returned.
response_formatSilently ignored — not forwarded upstream.
logprobs / top_logprobsSilently ignored.
stream_optionsSilently ignored; the final chunk always carries usage.
parallel_tool_callsSilently ignored.

Gateway extension: model fallback

Beyond the OpenAI spec, an optional models array (OpenRouter-style) lists fallback models tried in order when the primary model has no healthy channel.

Streaming format

With "stream": true the gateway responds with standard OpenAI server-sent events — chat.completion.chunk frames and a data: [DONE] sentinel. Parse it with any OpenAI SDK or a plain SSE client.

json
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hel"}}]}

data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"lo!"}}]}

data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]

Error format

Errors use the OpenAI envelope ({"error": {message, type, param, code}}), so existing error handling keeps working.

json
{
  "error": {
    "message": "model is required",
    "type": "invalid_request_error",
    "param": "model",
    "code": null
  }
}
HTTPMeaning
400
Malformed request body or missing required field.
401
Invalid or revoked API key.
402
Insufficient balance — top up to continue.
403
Model blocked by this API key's model restrictions.
404
model_not_found — no pricing/channel serves this model.
429
Rate limit (RPM/TPM) or concurrency cap reached.
500
All channels for the model failed — retry with backoff.
502
Upstream provider error after failover was exhausted.

Other protocols

The gateway also speaks two more protocols on the same key and billing.

/v1/responses

OpenAI Responses API — stateful, tool-native generation endpoint with the same model routing.

/v1/messages

Anthropic Messages API (plus /v1/messages/count_tokens) — run Claude-protocol clients against gateway models.

Ready to route your first request?