Skip to content

feat: add hostinger router provider - #699

Open
ricardasbitinas-jpg wants to merge 1 commit into
charmbracelet:mainfrom
ricardasbitinas-jpg:feat/hostinger-router-provider
Open

ricardasbitinas-jpg wants to merge 1 commit into
charmbracelet:mainfrom
ricardasbitinas-jpg:feat/hostinger-router-provider

Conversation

@ricardasbitinas-jpg

Copy link
Copy Markdown
  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

What

Adds Hostinger Router as an openai-compat provider.

  • Endpoint: https://router.hostinger.com/v1
  • Key: $HOSTINGER_ROUTER_API_KEY
  • Defaults: claude-sonnet-5 (large), gpt-5-mini (small)
  • 119 models, including the EU and US regional variants (e.g. claude-sonnet-5-eu) for data residency

Follows the Atlas Cloud pattern (#463):

  • cmd/hostinger-router/main.go: generator that reads the public, unauthenticated GET /v1/models
  • internal/providers/configs/hostinger-router.json: generated output
  • providers.go, KnownProviders(), Taskfile.yaml (gen:hostinger-router) and update.yml, so the 6-hourly job keeps the list current

Model selection

A model is included if the catalog lists it on /v1/chat/completions, with text in/out, tools support and a context window of at least 20k. That leaves out embeddings, image, audio and Responses-only models. These are the same filters as the OpenRouter and Atlas Cloud generators.

Data source

All values come from /v1/models:

  • Prices are per token in credits (1 credit = $0.01), converted to $/1M tokens. input_cache_read maps to cost_per_1m_out_cached and input_cache_write to cost_per_1m_in_cached.
  • context_window comes from context_length. default_max_tokens uses the Atlas Cloud rule: half of max_output_tokens, capped at 15% of the context window.
  • supports_attachments is set when architecture.input_modalities includes image.
  • can_reason and low/medium/high levels are set for models whose supported_parameters include reasoning_effort (66 of 119). Claude and Phi models are left out: with reasoning_effort on chat completions, Claude replies with Anthropic finish reasons (tool_use instead of tool_calls), which stops Crush's tool loop, and the Phi reasoning models reject the parameter.

Testing

  • go build ./..., go vet ./..., gofmt -l ., gofumpt -l: clean
  • go test ./...: pass (including TestValidDefaultModels and TestKnownProvidersMatchesRegistry)
  • golangci-lint run ./... (v2.13.1, Go 1.26.10): 0 issues
  • go run ./cmd/hostinger-router/main.go: Generated hostinger-router.json with 119 models
  • Crush (main, built locally) with CATWALK_URL=http://localhost:8080 against this branch's server (the task run + task run:catwalk setup): crush models hostinger lists all 119 hostinger-router/* models

Live test (2026-10-23, base URL and model IDs from the generated JSON):

# curl https://router.hostinger.com/v1/chat/completions
chat claude-sonnet-5  HTTP 200  finish=stop        content="Hi there, friend!"
chat gpt-5-mini       HTTP 200  finish=stop        content="Hi there, friend."
tool claude-sonnet-5  HTTP 200  finish=tool_calls  get_weather({"city":"Vilnius"})
tool gpt-5-mini       HTTP 200  finish=tool_calls  get_weather({"city":"Vilnius"})
$ crush run -m hostinger-router/claude-sonnet-5 "say hi"
Hi
$ crush run -m hostinger-router/gpt-5-mini "say hi"
Hi

# in an empty directory; the agent called the ls tool, then answered
$ crush run -m hostinger-router/claude-sonnet-5 "Use your ls tool to list the files in the current directory, then tell me how many there are. Do not create any files."
0 files.
$ crush run -m hostinger-router/gpt-5-mini "Use your ls tool to list the files in the current directory, then tell me how many there are. Do not create any files."
0

reasoning_effort: medium was also sent to each base model that gets reasoning levels here, plus a few regional variants. All returned HTTP 200, streaming and non-streaming.

Disclosure: I work at Hostinger. I'm happy to keep this provider's model list up to date.

馃 Generated with Claude Code

Add Hostinger Router (https://router.hostinger.com/v1) as an
OpenAI-compatible provider, with a generator that builds the config from
the public /v1/models endpoint and is wired into the update workflow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant