Skip to content
HIPS
  • Earn with your GPU
  • Pricing
  • Docs
Sign inJoin early access
⌘K

Get started

  1. 01Developer hub
  2. 02Quickstart
  3. 03Migrate to HIPS

Guides

  1. 04HIPS SDK
  2. 05Import and run your model
  3. 06Model and task guides
    1. ATask guides
    2. BLanguage (chat)
    3. CClassification
    4. DImage
    5. EVideo
    6. FAudio
    7. GDocument processing
  4. 07Batch jobs
  5. 08Prompt caching
  6. 09Coding-tool setup
    1. AClaude Code
    2. BOther coding tools and editor integrations
  7. 10Command line
    1. ASign in
  8. 11Console
    1. AAccount
    2. BWorkspaces
    3. CAPI keys
    4. DSettings
    5. EUsage
    6. FModels
    7. GPlayground
    8. HDeployments
  9. 12Billing
  10. 13Provider setup
    1. AWhen it works
    2. BCommands
    3. CSettings
    4. DProvider Console
    5. EEarnings
    6. FCrash reports
    7. GData centers
  11. 14Router
  12. 15Guardrails
  13. 16Knowledge

Reference

  1. 17API reference
    1. AAuthentication
    2. BChat completions
    3. CResponses
    4. DMessages
    5. ECount tokens
    6. FModels
    7. GTasks
    8. HEmbeddings and rerank
    9. IJobs
    10. JUploads
    11. KFiles
    12. LBatches
    13. MWebhooks
    14. NVector stores
    15. ODeployments
    16. PRequirements and headers
    17. QErrors
    18. RUsage
    19. SVersioning
  2. 18Operating guidance
    1. ALimits
    2. BErrors
    3. CRetries and billing outcomes
    4. DIdempotency
    5. EStreaming
    6. FData handling
    7. GCompatibility matrix
  3. 19Changelog
Sheet indexRouter

Get started

  1. 01Developer hub
  2. 02Quickstart
  3. 03Migrate to HIPS

Guides

  1. 04HIPS SDK
  2. 05Import and run your model
  3. 06Model and task guides
    1. ATask guides
    2. BLanguage (chat)
    3. CClassification
    4. DImage
    5. EVideo
    6. FAudio
    7. GDocument processing
  4. 07Batch jobs
  5. 08Prompt caching
  6. 09Coding-tool setup
    1. AClaude Code
    2. BOther coding tools and editor integrations
  7. 10Command line
    1. ASign in
  8. 11Console
    1. AAccount
    2. BWorkspaces
    3. CAPI keys
    4. DSettings
    5. EUsage
    6. FModels
    7. GPlayground
    8. HDeployments
  9. 12Billing
  10. 13Provider setup
    1. AWhen it works
    2. BCommands
    3. CSettings
    4. DProvider Console
    5. EEarnings
    6. FCrash reports
    7. GData centers
  11. 14Router
  12. 15Guardrails
  13. 16Knowledge

Reference

  1. 17API reference
    1. AAuthentication
    2. BChat completions
    3. CResponses
    4. DMessages
    5. ECount tokens
    6. FModels
    7. GTasks
    8. HEmbeddings and rerank
    9. IJobs
    10. JUploads
    11. KFiles
    12. LBatches
    13. MWebhooks
    14. NVector stores
    15. ODeployments
    16. PRequirements and headers
    17. QErrors
    18. RUsage
    19. SVersioning
  2. 18Operating guidance
    1. ALimits
    2. BErrors
    3. CRetries and billing outcomes
    4. DIdempotency
    5. EStreaming
    6. FData handling
    7. GCompatibility matrix
  3. 19Changelog
14
  1. Docs/
  2. Router
llms.txt

Router

On this sheet12 sections
  1. The four routers
  2. Call a router
  3. Fastest or cheapest
  4. How a model is chosen
  5. What the answer says
  6. What it costs
  7. When no model can serve it
  8. In the models list
  9. Requirements and guardrails
  10. Batches
  11. In the Console
  12. Data handling

A router is a model name that chooses the model. Send hips-router-chat, hips-router-agent, hips-router-code or hips-router-research in model on chat completions, Responses or Messages, streamed or not, with your own tools, and HIPS chooses a model for each request among the models that can do that work, the fastest or the cheapest as you set it. The request is served and billed as the model chosen, and the answer names it.

Note

The Router reads each request in production: where two models or more can serve it, a decision service judges its task and difficulty first. When the read fails, gets no answer within its deadline, or the day's reads are used up (HIPS's whole day, or the workspace's share of it), the request is chosen by rules alone and served all the same, and x-hips-router says why in reason.

F
Fig. 1, sheet 14Router

The four routers

NameUse caseThe models it can choose
hips-router-chatChat: conversation, questions and answers, customer support and writingEvery published, priced language model
hips-router-agentAgent: requests that act through toolsModels whose tool calls are validated
hips-router-codeCoding: coding agents and code workModels that passed a coding agent's test, with their tool calls validated
hips-router-researchResearch: long context and reasoningModels that advertise reasoning
  • Name
    hips-router-chat
    Use case
    Chat: conversation, questions and answers, customer support and writing
    The models it can choose
    Every published, priced language model
  • Name
    hips-router-agent
    Use case
    Agent: requests that act through tools
    The models it can choose
    Models whose tool calls are validated
  • Name
    hips-router-code
    Use case
    Coding: coding agents and code work
    The models it can choose
    Models that passed a coding agent's test, with their tool calls validated
  • Name
    hips-router-research
    Use case
    Research: long context and reasoning
    The models it can choose
    Models that advertise reasoning

A model joins and leaves a router by itself as it is imported, tested and priced; no list is kept by hand. A router chooses among catalog models only: never a workspace's own deployment (dep_...), never a draft, deprecated or retired model, and never a model the catalog offers only to buyers in certain countries. For the Coding router, a test with the coding agent of the route you call counts first: HIPS Code or OpenCode on chat completions, Claude Code on Messages, Codex on Responses. Where no model has passed that agent's test, a test with any of the four counts.

Call a router

The request is the route's own, with a router's name in model. These samples read HIPS_API_KEY and HIPS_BASE_URL from the environment, as every sample on these pages does, and print the two headers that say what was chosen.

00000000000000000000000000000000000000001import os2from openai import OpenAI3 4client = OpenAI(5    api_key=os.environ["HIPS_API_KEY"],6    base_url=os.environ["HIPS_BASE_URL"],  # https://ai.hips.com/v17)8 9raw = client.chat.completions.with_raw_response.create(10    model="hips-router-code",  # or hips-router-code:fast, hips-router-code:cheap11    messages=[{"role": "user", "content": "Write a Python function that checks whether a number is prime."}],12)13print(raw.headers.get("x-hips-model"))   # the model chosen14print(raw.headers.get("x-hips-router"))  # how it was chosen15print(raw.parse().choices[0].message.content)
Reads from the environmentHIPS_API_KEYHIPS_BASE_URL

The same names work on POST /v1/responses and POST /v1/messages. For a coding agent, set the agent's model to the router's name, for example HIPS_MODEL=hips-router-code.

Fastest or cheapest

Each router has a preference for the workspace: Fastest sends each request to the model with the shortest measured time for its size, Cheapest to the lowest expected charge for its size at the rates its quote would bind. A router never set reads Cheapest. An owner or admin sets it on the Console's Router page; the change applies to the next requests and is recorded in the audit log. A suffix overrides the setting for one request:

Model fieldPreferenceSource in the answer
hips-router-codeThe workspace's setting for Codingsetting
hips-router-code:fastFastest, for this request alonesuffix
hips-router-code:cheapCheapest, for this request alonesuffix
  • Model field
    hips-router-code
    Preference
    The workspace's setting for Coding
    Source in the answer
    setting
  • Model field
    hips-router-code:fast
    Preference
    Fastest, for this request alone
    Source in the answer
    suffix
  • Model field
    hips-router-code:cheap
    Preference
    Cheapest, for this request alone
    Source in the answer
    suffix
  • The measured time is the prompt's tokens over the measured prefill rate plus the expected output over the measured decode rate, on GPUs that hold the model loaded and free now. A model with no measured speed ranks after every model that has one, those among themselves by expected charge. Nothing is estimated from another model.
  • The expected output is the request's own cap where it sets one, else the same length for every model, so a model with a long default is not made to look dear.
  • A name and its suffix are lowercase, exactly as written. An empty or unknown suffix (hips-router-code:, hips-router-code:best) is 400 invalid_value at model: "The suffix of a router is :fast or :cheap, as in hips-router-code:fast."
  • Any other name that starts with hips-router, a router written in another case included, is 404 model_not_found, and the message names the four. No catalog id, alias or pinned id starts with hips-router, so a router never collides with a model.
  • A router chooses language models on chat completions, Responses and Messages only. Named on /v1/tasks, /v1/embeddings or /v1/rerank, it is 400 invalid_value at model.

How a model is chosen

The Router makes no promise about which model serves a request. It chooses before the first byte of the answer, in this order:

  1. 01

    The candidates. The router's models, narrowed to those that can serve this request in a pool it may use: an image part needs a model that takes images, tools one that supports tool calls, response_format, logprobs, logit_bias and reasoning_effort a model that advertises them (parallel_tool_calls narrows nothing: it is a permission, served as false on a model without the feature), the prompt a window served now that holds it, and an output cap a model whose output limit reaches it. Then the requirements (x-hips-pool, x-hips-region, x-hips-pricing-mode), the pools the workspace may use and your guardrails. Then the supply now: a model no GPU can serve in any of those pools is out.

  2. 02

    The read. Where two models or more remain, the request may be read first: a decision service judges its task (conversation, writing, extraction, reasoning, code or tool_use) and its difficulty (simple, moderate or hard) from a masked excerpt. A harder request is held to larger models, and the task ranks the models that fit it first: models that reason for reasoning, models tested with a coding agent for code, validated tool calls for tool_use, JSON schema output for extraction. Without an answer the request is chosen by rules alone, among the same candidates with no size floor and no task preference. A request with a region requirement is never read. A read that fails, times out or finds the day's reads used up never fails the request: it is chosen by rules alone.

  3. 03

    The order. Models with a GPU ready now go before models that start on demand, since loading a model can take minutes. Within each, the preference's measure decides, ties going to the other measure, then to the catalog id, so every gateway chooses alike. Where the read asked for a larger model and none is ready now, a smaller one that is ready goes first, and the answer says floor=below.

  4. 04

    The conversation. A conversation's next turn goes to the model its earlier turn was answered by, while that model is still a candidate, ready now and large enough for the new turn, so a coding agent's session stays on one model.

  5. 05

    The tries. The first model is tried as if the request had named it. If it is refused before its first byte for capacity (no_capacity, pool_unavailable, overloaded, context_size_not_measured), the next one is tried, up to three models in all, within the request's own deadline. After the first byte the request is that model's: a stream that fails is never restarted on another model.

What the answer says

Everything about the answer is the chosen model's: model in the body names it, never the router, x-hips-model carries its pinned id, and usage its counts in the route's own names. x-hips-router says how it was chosen:

Response headers

00000000000000000000000000000000000000001HTTP/2 2002content-type: application/json3x-hips-request-id: req_...4x-hips-model: <pinned id of the model chosen>5x-hips-router: hips-router-code; preference=cheapest; source=setting; read=decision; task=code; difficulty=hard
Response headers sample

Parts list: x-hips-router, its members in order

  1. 01
    <router>

    The router's name, without its suffix.

  2. 02
    preferencefastest, cheapest

    The preference this request was chosen by.

  3. 03
    sourcesetting, suffix

    The workspace's setting, or the request's suffix.

  4. 04
    readdecision, cache, rules

    Read first; read first, from an earlier reading of the same masked text; or chosen by rules alone.

  5. 05
    reasona word below

    Why rules alone. Only with read=rules.

  6. 06
    taskconversation, writing, extraction, reasoning, code, tool_use

    Only when the request was read.

  7. 07
    difficultysimple, moderate, hard

    Only when the request was read.

  8. 08
    floorbelow

    The model chosen is smaller than the difficulty asked, since nothing larger was ready.

  9. 09
    triesa count

    Only when more than one model was tried before one was placed.

ReasonWhy the request was chosen by rules alone
no_keyThe gateway has no client for the decision service, so it cannot read
one_candidateOnly one model could serve it, so there was nothing to read for
same_choiceEvery answer the read could give would try the same models in the same order, so none was asked
regionThe request carries a region requirement, and such a request is never read
timeoutNo answer in time
errorThe read failed, or the masking could not finish within its bound and nothing was sent
refusedThe decision service refused the read
budgetThe day's reads are used up, HIPS's or the workspace's share
breakerReads are paused after failures
saturatedToo many reads at once
switched_offHIPS switched reading off
  • Reason
    no_key
    Why the request was chosen by rules alone
    The gateway has no client for the decision service, so it cannot read
  • Reason
    one_candidate
    Why the request was chosen by rules alone
    Only one model could serve it, so there was nothing to read for
  • Reason
    same_choice
    Why the request was chosen by rules alone
    Every answer the read could give would try the same models in the same order, so none was asked
  • Reason
    region
    Why the request was chosen by rules alone
    The request carries a region requirement, and such a request is never read
  • Reason
    timeout
    Why the request was chosen by rules alone
    No answer in time
  • Reason
    error
    Why the request was chosen by rules alone
    The read failed, or the masking could not finish within its bound and nothing was sent
  • Reason
    refused
    Why the request was chosen by rules alone
    The decision service refused the read
  • Reason
    budget
    Why the request was chosen by rules alone
    The day's reads are used up, HIPS's or the workspace's share
  • Reason
    breaker
    Why the request was chosen by rules alone
    Reads are paused after failures
  • Reason
    saturated
    Why the request was chosen by rules alone
    Too many reads at once
  • Reason
    switched_off
    Why the request was chosen by rules alone
    HIPS switched reading off

A request the read could not answer in time is chosen by rules alone, and the header says so:

A request chosen by rules alone

00000000000000000000000000000000000000001x-hips-router: hips-router-code; preference=cheapest; source=setting; read=rules; reason=timeout
A request chosen by rules alone sample

x-hips-router is on every answer to a request that named a router, a refusal after the name was read included: a refusal found among the candidates says read=rules with no reason, and a content moderation block, which comes before any choice, carries the name, preference and source alone. The answer's hips object carries the same as router, with model, the pinned id served, and each member only where it is known:

The hips object of a chat completion

00000000000000000000000000000000000000001"hips": {2  "cost_micros": 0,3  "latency_ms": 0,4  "quote": "quote_...",5  "router": {6    "name": "hips-router-code",7    "preference": "cheapest",8    "source": "setting",9    "read": "decision",10    "task": "code",11    "difficulty": "hard",12    "model": "<pinned id of the model chosen>"13  }14}
The hips object of a chat completion sample
RouteWhere the router member is
Chat completionsThe answer's top-level hips object; on a stream, the hips object of the final usage chunk (stream_options.include_usage)
Messageships on the message; on a stream, in message_delta
ResponsesOn a stream, the hips member of response.completed; a whole answer carries the headers alone
  • Route
    Chat completions
    Where the router member is
    The answer's top-level hips object; on a stream, the hips object of the final usage chunk (stream_options.include_usage)
  • Route
    Messages
    Where the router member is
    hips on the message; on a stream, in message_delta
  • Route
    Responses
    Where the router member is
    On a stream, the hips member of response.completed; a whole answer carries the headers alone

The choice is made before the first byte, so x-hips-model and x-hips-router are in a stream's head, and a refusal is an ordinary status and body, never an error inside the stream.

What it costs

A routed request is billed exactly as the model chosen: its quote (x-hips-quote), its rates in the pool that served it, its usage units, and x-hips-cost-micros or the hips object's cost_micros. There is no router fee, and reading the request is never on your usage. The usage record keeps the model chosen and, beside it, the router's name, the preference, its source, how it chose and why rules, never the task or the difficulty. Rate limits count a routed request as one request with its own tokens.

When no model can serve it

Every code of the Errors page applies to a routed request as to any. The Router's own answers:

CaseAnswerParamOn Messages
The router has no model for its use case now400 router_no_candidatemodelinvalid_request_error
What the request carries leaves none: an image, tools, a response_format, an output cap400 router_no_candidateThe first field at fault, in the chat completions names (messages[].content[].image_url, tools, response_format.type, max_tokens)invalid_request_error
The requirements leave none: a pool, a region, stable pricing, or the pools the workspace may use400 router_no_candidatex-hips-pool, x-hips-region, x-hips-pricing-mode, or modelinvalid_request_error
Your guardrails allow none of its models, or keep the router itself out403 model_not_allowed, naming the guardrailnonepermission_error
The prompt is longer than every candidate's window served now400 context_length_exceeded, naming the largest windowmessagesinvalid_request_error
Candidates exist and none has a GPU that can serve it now, or every model tried was refused for capacity503 no_capacity with Retry-Afternoneoverloaded_error
The balance or a budget holds none402 insufficient_credit or budget_exceedednonebilling_error
  • Case
    The router has no model for its use case now
    Answer
    400 router_no_candidate
    Param
    model
    On Messages
    invalid_request_error
  • Case
    What the request carries leaves none: an image, tools, a response_format, an output cap
    Answer
    400 router_no_candidate
    Param
    The first field at fault, in the chat completions names (messages[].content[].image_url, tools, response_format.type, max_tokens)
    On Messages
    invalid_request_error
  • Case
    The requirements leave none: a pool, a region, stable pricing, or the pools the workspace may use
    Answer
    400 router_no_candidate
    Param
    x-hips-pool, x-hips-region, x-hips-pricing-mode, or model
    On Messages
    invalid_request_error
  • Case
    Your guardrails allow none of its models, or keep the router itself out
    Answer
    403 model_not_allowed, naming the guardrail
    Param
    none
    On Messages
    permission_error
  • Case
    The prompt is longer than every candidate's window served now
    Answer
    400 context_length_exceeded, naming the largest window
    Param
    messages
    On Messages
    invalid_request_error
  • Case
    Candidates exist and none has a GPU that can serve it now, or every model tried was refused for capacity
    Answer
    503 no_capacity with Retry-After
    Param
    none
    On Messages
    overloaded_error
  • Case
    The balance or a budget holds none
    Answer
    402 insufficient_credit or budget_exceeded
    Param
    none
    On Messages
    billing_error

router_no_candidate is never worth sending again unchanged: its message says why and what would serve. For example, while no model has passed a coding agent's test:

00000000000000000000000000000000000000001HTTP/2 4002x-hips-router: hips-router-code; preference=cheapest; source=setting; read=rules
Language

In the models list

GET /v1/models lists the four routers first, each with its use case, the workspace's preference, its suffixes, how many models it can choose for your key's default requirements and guardrails (candidates), and how many of those have a GPU ready now (ready, null while the capacity reading is stale). GET /v1/models/{id} answers a router's name with or without its suffix. The Models reference has the rest of the list.

One router in GET /v1/models

00000000000000000000000000000000000000001{2  "id": "hips-router-code",3  "object": "model",4  "created": 0,5  "owned_by": "hips",6  "hugging_face_id": null,7  "hips": {8    "task": "chat",9    "router": {10      "use_case": "Coding",11      "preference": "cheapest",12      "suffixes": ["fast", "cheap"],13      "candidates": 0,14      "ready": 015    }16  }17}
One router in GET /v1/models sample

Requirements and guardrails

  • The requirement headers apply to every model a router may choose and narrow its candidates; none is weakened to find a model. Under Auto the pool is chosen for the model chosen exactly as if you had named it, and x-hips-pool names the pool that served.
  • A model and pool access guardrail narrows the candidates to the models it allows, each judged as a request naming it would be. A router itself is kept out only where a guardrail names it: a deny list naming it, or a family such as hips-router-*, or an allow list that names another router and not this one.
  • An allow list that names a router must also name the models it may choose: hips-router-code with language lets the Coding router choose among every language model, while hips-router-code alone allows no model, 403 model_not_allowed.
  • Content moderation runs before any read or choice: a guardrail that blocks refuses the request first. A budget holds the chosen model's maximum charge, as for any request. Guardrails has the rules.

Batches

A batch runs one model, so a batch file whose lines name a router is refused at its check, 400 invalid_file_format at body.model on the first such line: "A router chooses a model for each request; a batch runs one model. Name a model in the file's lines." Batches are not offered in production yet.

In the Console

  • Router, in the Inference menu after Guardrails: one panel per use case with the name to call and its Copy, an example API call, what the router is for, its preference (Fastest or Cheapest; an owner or admin changes it, and anyone else sees why the control is closed), what it would choose now for a request of a sample size at each difficulty and without a read, under the workspace's tool defaults or a chosen key's requirements, how many models it can choose and why the others are out, the suffix that overrides it, and that it is billed as the model it chooses. Above the panels, the last 24 hours: how many requests were routed, how many were read first, how many were chosen by rules alone, and why.
  • Models lists the four routers in a group of their own above the models; each opens its panel on the Router page.
  • The Playground's model picker shows the routers first, with a preference control. Each answer says which model was chosen and how, and its Details show the router, the preference and where it came from, the read and the tries.
  • Usage names a routed request "hips-router-code, served by <model>" and filters by router.

Data handling

The read receives a masked excerpt of the request, at most 4,096 bytes: the newest user message's text, then the system text, with every email address, phone number, Social Security number, card number, IBAN, IP address and secret replaced by a typed placeholder, and the custom patterns of your content moderation guardrails masked too. Images are never read. The excerpt goes to a decision service run outside HIPS for the one call, and is never stored, logged or sent to a model's server; a masking that cannot finish within its bound sends nothing. A verdict and a conversation's model are kept under keyed hashes for a bounded time, never as text.

Related sheets

  • Guardrails
  • Errors
  • Requirements and headers
  • Models
Previous sheetData centers
Next sheetGuardrails
Sheet
14 of 19
Updated
2026-11-12
Sign in to the Console

On this sheet

  1. The four routers
  2. Call a router
  3. Fastest or cheapest
  4. How a model is chosen
  5. What the answer says
  6. What it costs
  7. When no model can serve it
  8. In the models list
  9. Requirements and guardrails
  10. Batches
  11. In the Console
  12. Data handling

Product

  • Inference
  • Models
  • Deploy your model
  • Always-on GPU capacity
  • How it works
  • Use cases
  • Pricing

Developer

  • Docs
  • Quickstart
  • Migrate to HIPS
  • HIPS SDK
  • Batch jobs
  • API reference

Provider

  • Earn with your GPU
  • Register GPU interest
  • Download for Mac
  • Download for Windows
  • Download for Linux

Resource

  • Security and Data
  • Resources
  • llms.txt

Compare

  • OpenRouter alternatives
  • Together AI alternatives
  • Groq alternatives
  • All comparisons

Company

  • About
  • Contact
  • Affiliate program
  • HIPS Payments

Legal

  • Legal
  • Consumer Health Data Privacy Policy
  • Report content
  • Cookie preferences

Support

  • Contact HIPS
  • Looking for payments support?

HIPS. AI inference for builders.

hips.com

Hyperscale Inference Processing Systems OÜ