Skip to main content

Hostinger AI Router

Since v1.109.0

Overview​

PropertyDetails
DescriptionHostinger AI Router is a hosted, OpenAI-compatible gateway to OpenAI, Anthropic, Google, and other model families, billed in Hostinger credits.
Provider Route on LiteLLMhostinger_router/
Link to Provider DocHostinger AI Router ↗
Base URLhttps://router.hostinger.com/v1
Supported Operations/chat/completions, /responses, /messages, /embeddings


We support ALL Hostinger AI Router models, just set hostinger_router/ as a prefix when sending requests. The router's own model ids, such as claude-sonnet-5 or gpt-5.2, go after the prefix.

Available Models​

ModelMode
hostinger_router/claude-sonnet-5chat
hostinger_router/gpt-5.2chat
hostinger_router/text-embedding-3-smallembedding
hostinger_router/text-embedding-3-largeembedding

LiteLLM tracks spend for the models above, counting one Hostinger credit as $0.01. Any other model in the router's catalog also works with the hostinger_router/ prefix, but LiteLLM records its spend as $0 until a price is added, which you can set yourself through model_info on the proxy.

Every chat model works on /chat/completions, /responses, and /messages. When LiteLLM knows a model serves /v1/responses or /v1/messages on the router, such as gpt-5.2 on /responses or claude-sonnet-5 on /messages, it calls that route directly. For every other model, LiteLLM converts the call and sends it through the router's /v1/chat/completions.

Required Variables​

Environment Variables
os.environ["HOSTINGER_ROUTER_API_KEY"] = ""  # your Hostinger AI Router API key

Create an API key in the AI Router section of hPanel.

You can overwrite the base url with:

os.environ["HOSTINGER_ROUTER_API_BASE"] = "https://router.hostinger.com/v1"

Usage - LiteLLM Python SDK​

Non-streaming​

Hostinger AI Router Non-streaming Completion
import os
from litellm import completion

os.environ["HOSTINGER_ROUTER_API_KEY"] = "" # your Hostinger AI Router API key

response = completion(
model="hostinger_router/claude-sonnet-5",
messages=[{"content": "Hello, how are you?", "role": "user"}],
)

print(response)

Streaming​

Hostinger AI Router Streaming Completion
import os
from litellm import completion

os.environ["HOSTINGER_ROUTER_API_KEY"] = "" # your Hostinger AI Router API key

response = completion(
model="hostinger_router/gpt-5.2",
messages=[{"content": "Hello, how are you?", "role": "user"}],
stream=True,
)

for chunk in response:
print(chunk)

Responses API​

LiteLLM sends /responses calls for gpt-5.2 to the router's own /v1/responses endpoint, and converts calls for other models through /v1/chat/completions.

Hostinger AI Router Responses API
import os
import litellm

os.environ["HOSTINGER_ROUTER_API_KEY"] = "" # your Hostinger AI Router API key

response = litellm.responses(
model="hostinger_router/gpt-5.2",
input="Name three primary colors",
)

print(response.output[0].content[0].text)

Anthropic Messages API​

LiteLLM sends /messages calls for claude-sonnet-5 to the router's own /v1/messages endpoint, and converts calls for other models through /v1/chat/completions.

Hostinger AI Router Messages API
import asyncio
import os
import litellm

os.environ["HOSTINGER_ROUTER_API_KEY"] = "" # your Hostinger AI Router API key

async def main():
response = await litellm.anthropic.messages.acreate(
model="hostinger_router/claude-sonnet-5",
messages=[{"role": "user", "content": "Name three primary colors"}],
max_tokens=200,
)
print(response["content"])

asyncio.run(main())

Embeddings​

Hostinger AI Router Embeddings
import os
import litellm

os.environ["HOSTINGER_ROUTER_API_KEY"] = "" # your Hostinger AI Router API key

response = litellm.embedding(
model="hostinger_router/text-embedding-3-small",
input=["hello from litellm"],
)

print(len(response.data[0]["embedding"]))

Usage - LiteLLM Proxy​

Add the following to your LiteLLM Proxy configuration file:

config.yaml
model_list:
- model_name: hostinger-claude
litellm_params:
model: hostinger_router/claude-sonnet-5
api_key: os.environ/HOSTINGER_ROUTER_API_KEY

- model_name: hostinger-gpt
litellm_params:
model: hostinger_router/gpt-5.2
api_key: os.environ/HOSTINGER_ROUTER_API_KEY

- model_name: hostinger-embedding
litellm_params:
model: hostinger_router/text-embedding-3-small
api_key: os.environ/HOSTINGER_ROUTER_API_KEY

You can also add these models from the Admin UI. Open Models, click Add Model, pick Hostinger Router as the provider, and paste your API key.

Start your LiteLLM Proxy server:

Start LiteLLM Proxy
export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)"
printf 'Local proxy key: %s\n' "$LITELLM_MASTER_KEY"
litellm --config config.yaml

# RUNNING on http://0.0.0.0:4000

In another terminal, set LITELLM_API_KEY to the key printed above, then call the proxy:

Hostinger AI Router via Proxy - Chat Completions
curl http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "hostinger-claude",
"messages": [{"role": "user", "content": "hello from litellm"}]
}'
Hostinger AI Router via Proxy - Responses API
curl http://localhost:4000/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "hostinger-gpt",
"input": "hello from litellm"
}'
Hostinger AI Router via Proxy - Messages API
curl http://localhost:4000/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "hostinger-claude",
"max_tokens": 200,
"messages": [{"role": "user", "content": "hello from litellm"}]
}'
Hostinger AI Router via Proxy - Embeddings
curl http://localhost:4000/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "hostinger-embedding",
"input": ["hello from litellm"]
}'

For more detailed information on using the LiteLLM Proxy, see the LiteLLM Proxy documentation.

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →