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

API Reference

Complete reference documentation for the HuiLink API.

Authentication

All API requests require authentication via a Bearer token in the Authorization header.

http
Authorization: Bearer sk-xxxxxxxxxxxxxxxx

Headers

AuthorizationBearer sk-xxxxxxxx
Required
Content-Typeapplication/json
Required

Already using the OpenAI SDK? The gateway is fully OpenAI-compatible — swap the base URL and go.

API Endpoints

MethodEndpointDescription
POST
/v1/chat/completionsSend a chat completion request to a supported model.
POST
/v1/responsesOpenAI Responses API — stateful, tool-native generation on the same model routing.
POST
/v1/messagesAnthropic Messages protocol — run Claude-format clients against gateway models.
POST
/v1/embeddingsCreate an embedding vector representing the input text.
POST
/v1/images/generationsGenerate images from text prompts
POST
/v1/video/generationsGenerate videos from text prompts
POST
/v1/audio/speechText-to-speech — returns binary audio
POST
/v1/audio/transcriptionsTranscribe audio to text (multipart)
POST
/v1/rerankRerank documents by relevance to a query
GET
/v1/modelsList the models available to your account.

Create Chat Completion

Send a chat completion request to a supported model.

cURL
curl https://gateway.hkting.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-api-key" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "temperature": 0.7,
    "max_tokens": 1024
  }'
Open in Playground
Try in Playground

Request Body

model
string
Required

Model ID to use (e.g. gpt-4o, deepseek-v4-flash)

messages
array
Required

Array of message objects with role and content

temperature
number
Optional

Sampling temperature 0-2 (default 1.0)

max_tokens
integer
Optional

Maximum tokens to generate (default 4096)

stream
boolean
Optional

Enable streaming via SSE (default false)

top_p
number
Optional

Nucleus sampling parameter (default 1.0)

frequency_penalty
number
Optional

Penalize token frequency (-2.0 to 2.0, default 0)

presence_penalty
number
Optional

Penalize token presence (-2.0 to 2.0, default 0)

stop
string|array
Optional

Up to 4 sequences where the API stops generating

tools
array
Optional

List of tool definitions for function calling

user
string
Optional

End-user identifier for monitoring

Response

id
string
Optional

Unique request identifier

object
string
Optional

Always chat.completion

created
integer
Optional

Unix timestamp of creation

model
string
Optional

The model used for completion

choices
array
Optional

List of completion choices

usage.prompt_tokens
integer
Optional

Number of prompt tokens

usage.completion_tokens
integer
Optional

Number of completion tokens

usage.total_tokens
integer
Optional

Total tokens consumed

Response Example

json
{
  "id": "chatcmpl-9a8b7c6d5e4f",
  "object": "chat.completion",
  "created": 1734567890,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9,
    "total_tokens": 21
  }
}

Create Embedding

Create an embedding vector representing the input text.

cURL
curl https://gateway.hkting.com/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-api-key" \
  -d '{
    "model": "text-embedding-ada-002",
    "input": "The quick brown fox jumps over the lazy dog"
  }'
Open in Playground
Try in Playground

Request Body

model
string
Required

Embedding model ID (e.g. text-embedding-ada-002)

input
string|array
Required

Input text or array of tokens to embed

Response Example

json
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        ... // 1536 dimensions
      ]
    }
  ],
  "model": "text-embedding-ada-002",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

List Models

List the models available to your account.

bash
curl https://gateway.hkting.com/v1/models \
  -H "Authorization: Bearer sk-your-api-key"
Open in Playground
Try in Playground
ModelProviderContext LengthFeatures
gpt-4oOpenAI128KVision, Function Calling
gpt-4o-miniOpenAI128KVision
gpt-4-turboOpenAI128KVision, Function Calling
deepseek-v4-flashDeepSeek1MReasoning, Fast
deepseek-v4-proDeepSeek1MReasoning, Pro
qwen-plusQwen128KGeneral
qwen-maxQwen128KFunction Calling

Image Generation

Generate images from text descriptions using our media generation providers (Jimeng/即梦, DALL-E, etc.).

cURL
curl https://gateway.hkting.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jimeng-image",
    "prompt": "A serene mountain landscape at sunset",
    "n": 1,
    "size": "1024x1024"
  }'
Open in Playground

Request Body

model
string
Required

Image model ID (e.g. jimeng-image, dall-e-3)

prompt
string
Required

Text description of the desired image

n
integer
Optional

Number of images to generate (1-4, default 1)

size
string
Optional

Image size (e.g. 1024x1024, 1920x1080, default 1024x1024)

style
string
Optional

Image style (e.g. realistic, cartoon, anime) — supported by Jimeng

negative_prompt
string
Optional

What to avoid in the generated image

seed
integer
Optional

Random seed for reproducible results

Response

created
integer
Optional

Unix timestamp of creation

data
array
Optional

Array of generated image objects

data[].url
string
Optional

URL of the generated image (expires after 24h)

data[].revised_prompt
string
Optional

AI-revised version of the input prompt (if applicable)

json
{
  "created": 1734567890,
  "data": [
    {
      "url": "https://.../generated-image.png",
      "revised_prompt": "A serene mountain landscape at sunset with golden light..."
    }
  ]
}
ModelProviderType
jimeng-imageJimeng (即梦)Text-to-Image
dall-e-3OpenAIText-to-Image
dall-e-2OpenAIText-to-Image

Video Generation

Generate short videos from text descriptions.

cURL
curl https://gateway.hkting.com/v1/video/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jimeng-video",
    "prompt": "A cat walking in the park",
    "duration": 5
  }'
Open in Playground

Request Body

model
string
Required

Video model ID (e.g. jimeng-video)

prompt
string
Required

Text description of the desired video

duration
integer
Optional

Video duration in seconds (5 or 10, default 5)

size
string
Optional

Aspect ratio (e.g. 16:9, 9:16, 1:1, default 16:9)

negative_prompt
string
Optional

What to avoid in the generated video

seed
integer
Optional

Random seed for reproducible results

Response

id
string
Optional

Unique video generation request ID

status
string
Optional

Generation status (e.g. processing, completed, failed)

output
string
Optional

URL of the generated video file

json
{
  "id": "video-gen-xxx",
  "status": "completed",
  "output": "https://.../generated-video.mp4"
}
ModelProviderMax Duration
jimeng-videoJimeng (即梦)10s

Audio

OpenAI-compatible audio endpoints. Speech turns text into audio (binary response); transcriptions convert uploaded audio to text via multipart/form-data (max 50 MB). Requests route to the first capable channel and fail over automatically.

Text-to-Speech

cURL
curl https://gateway.hkting.com/v1/audio/speech \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello! Welcome to our service.",
    "voice": "alloy",
    "response_format": "mp3"
  }' \
  --output speech.mp3
Open in Playground

Request Body

model
string
Required

TTS model ID (e.g. tts-1, tts-1-hd)

input
string
Required

Text to synthesize (max ~4096 chars)

voice
string
Required

Voice ID (e.g. alloy, echo, fable, onyx, nova, shimmer)

response_format
string
Optional

mp3 | opus | aac | flac | wav | pcm (default mp3)

speed
number
Optional

Speech speed, 0.25–4.0 (default 1.0)

Response

The raw audio bytes with the upstream Content-Type (e.g. audio/mpeg). Save the body directly to a file.

Transcriptions

cURL
curl https://gateway.hkting.com/v1/audio/transcriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F file="@speech.mp3" \
  -F model="whisper-1" \
  -F response_format="json"

Request Body

file
file
Required

Audio file (mp3, wav, m4a, webm, ...; max 50 MB)

model
string
Required

Transcription model ID (e.g. whisper-1)

language
string
Optional

ISO-639-1 hint (e.g. en, zh)

prompt
string
Optional

Optional spelling/style guidance

response_format
string
Optional

json | verbose_json | text | srt | vtt (default json)

json
{
  "text": "Hello! Welcome to our service."
}

Rerank

Cohere/SiliconFlow-compatible rerank: score a list of documents against a query by relevance. Documents may be plain strings or objects — both pass through unchanged.

cURL
curl https://gateway.hkting.com/v1/rerank \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bge-reranker-v2-m3",
    "query": "What is machine learning?",
    "documents": [
      "Machine learning is a subset of AI.",
      "The weather is nice today.",
      "Deep learning uses neural networks."
    ],
    "top_n": 2
  }'
Open in Playground

Request Body

model
string
Required

Rerank model ID (e.g. bge-reranker-v2-m3)

query
string
Required

The search query

documents
array
Required

Documents to rank — strings or objects

top_n
integer
Optional

Return only the top N results (default: all)

Response

id
string
Optional

Unique request ID (if provided by upstream)

model
string
Optional

Model that processed the request

results
array
Optional

Ranked results, sorted by relevance (descending)

results[].index
integer
Optional

Position of the document in the input array

results[].relevance_score
number
Optional

Relevance score against the query

results[].document
string | object
Optional

Echoed document (if the upstream returns it)

json
{
  "id": "rerank-xxx",
  "model": "bge-reranker-v2-m3",
  "results": [
    { "index": 0, "relevance_score": 0.93 },
    { "index": 2, "relevance_score": 0.87 }
  ]
}

Rate Limits

API requests are subject to rate limits based on your plan. Exceeding limits returns a 429 status code.

PlanRPMTPM
Free2040,000
Pay-as-you-go500200,000
EnterpriseCustomCustom

Rate limits can be configured per API key by an admin. Contact your admin to adjust limits.

Error Codes

The API uses standard HTTP status codes to indicate the outcome of a request.

CodeMeaningCommon Cause
200
OKRequest succeeded
400
Bad RequestInvalid request body or parameters
401
UnauthorizedInvalid or missing API key
402
Payment RequiredInsufficient balance
404
Not FoundModel or endpoint not found
422
Unprocessable EntityRequest validation failed
429
Too Many RequestsRate limit exceeded
500
Internal Server ErrorInternal server error
502
Bad GatewayUpstream provider returned an error
503
Service UnavailableAll upstream providers are unavailable