Embeddings and rerank
Two front doors on the task API (decided 2026-11-04): an embedding request in OpenAI's shape and a rerank request in Cohere's, each served as the task it stands for, embedding or rerank, with the task route's key, limits, idempotency-key, requirement headers, quote and placement. Neither body takes a hips object: requirements ride as the x-hips-* headers. A model answers once an embedding model or a reranker is published and priced in the catalog.
/v1/embeddingsservedEmbeddings in OpenAI's shape, billed by input tokens. A model answers once an embedding model is published and priced.
{"model": "<catalog id>", "input": ["First text.", "Second text."], "encoding_format": "float"}Parts list: Embeddings fields
modelRequiredA non-empty string: a catalog id, alias or pinned id of an embedding model. A model of another task is a 400
task_mismatch; a router is a 400invalid_value.inputRequiredA string, or an array of 1 to 2,048 strings, none empty; more is a 400
too_many_inputs. Token-id arrays are a 400unsupported_value: HIPS takes text, tokenized with the model's own tokenizer.encoding_formatAcceptedfloat(the default) orbase64, each vector's little-endian 32-bit floats; anything else is a 400unsupported_value.dimensionsAcceptedA whole number above 0: the model's own dimension, or fewer on a model whose entry says it may be cut (
limits.truncatable); otherwise a 400unsupported_valuenaming the model's dimension.userAccepted, not usedA string.
Any other nameRejected, 400 unknown_parameterNever ignored.
The vectors come in input order, each of the model's own dimension, unit length, cut to dimensions and made unit length again when fewer are asked. usage.prompt_tokens is the gateway's own count with the model's tokenizer, and it is the bill.
/v1/rerankservedRerank in Cohere's shape, billed by input tokens, the query read with each document. A model answers once a reranker is published and priced.
{"model": "<catalog id>", "query": "Which document is about GPUs?", "documents": ["a", "b", {"text": "c"}], "top_n": 2, "return_documents": true}Parts list: Rerank fields
modelRequiredA reranker.
queryRequiredA non-empty string of at most 32 KiB.
documentsRequired1 to 1,000 strings or
{"text"}objects (Cohere's two shapes), each non-empty and at most 32 KiB; more documents is a 400too_many_inputs, a longer one a 400input_too_long.top_nAcceptedFrom 1 to the number of documents; every document when absent. More than the documents sent is a 400
invalid_value.return_documentsAcceptedtrueputs each document's text in its result;falseby default.max_tokens_per_docRejected, 400 unsupported_parameterHIPS never cuts a document.
Any other nameRejected, 400 unknown_parameterNever ignored.
Scores are the reranker's relevance through the logistic function, from 0 to 1, the most relevant first, equal scores in input order. Every document is scored, whatever top_n returns.
Both routes bill by input tokens, at the model's rate per million (decided 2026-11-13: embeddings and rerank are billed by tokens). The tokens are the gateway's own count with the model's tokenizer, every token the model reads: an embedding's inputs, and a rerank's documents each read with the query, so the query counts once beside each document. A device's own count is only a cross-check, never the bill, and the time a request takes never changes what it costs. The embeddings answer names the tokens billed in usage.prompt_tokens, the rerank answer in Cohere's meta.billed_units.input_tokens beside meta.tokens.input_tokens, and the cost is in x-hips-cost-micros.
An input, a document or a query longer than the model reads at once is refused whole before any work, never cut and never billed: a 400 context_length_exceeded at its field, naming its tokens and the model's bound, counted with the model's own tokenizer. An input too large for one attempt is a 400 input_too_large. A request the measured speed of every GPU serving the model shows cannot finish within its time limit is a 400 exceeds_time_limit.
| Status | Type | Code | Situation | Retry |
|---|---|---|---|---|
| 400 | invalid_request_error | invalid_json | The body is not JSON, or not an object | No |
| 400 | invalid_request_error | missing_required_parameter | A required field or header is absent; param names it. On POST /v1/tasks, a classification model that answers in words and reads a response alone asked without options.prompt, at options.prompt (Safety classifiers) | No |
| 400 | invalid_request_error | invalid_type | A field has the wrong JSON type | No |
| 400 | invalid_request_error | invalid_value | A value is out of range or malformed: stop with more than 16 entries, a prompt_cache_key over 512 characters, a string holding a lone surrogate escape, a router name with an empty or unknown suffix, both max_tokens names with different values, an x-client-request-id header that is not printable ASCII or is over 512 characters (param x-client-request-id) | No |
| 400 | invalid_request_error | unknown_parameter | A field the gateway does not know, at any depth; param names it | No |
| 400 | invalid_request_error | unsupported_parameter | A known field HIPS does not accept, or a feature the named model does not advertise in the pool the request resolves to; param names it, and message names the model and what to send instead (an image to a model that takes no images says so, and that GET /v1/models lists each model's features) | No |
| 400 | invalid_request_error | unsupported_value | n other than 1, stream_options without stream, a message role, part, item or tool type not accepted, a hosted tool type HIPS does not run | No |
| 400 | invalid_request_error | context_length_exceeded | The prompt is over the model's context_length, or over the largest window any GPU serves it at now, or held only in a size that the GPUs able to hold it keep failing to read within the time limit; that limit and the prompt's count in the message, the limit the largest size that works now for this request, never more than the pool's context_window on Models; the prompt is never truncated. On embeddings and rerank, an input longer than the model reads at once, never cut | No |
| 400 | invalid_request_error | request_too_large, input_too_large, too_many_inputs, upload_too_large | A limit of the Limits page. The message states the request's size where the client declared it (content-length) and the limit, each in MiB with its exact bytes, each image counted as sent in base64, and what to send instead: fewer or smaller images, a shorter request, or an upload on the task API. A request is never cut | No |
| 400 | invalid_request_error | input_too_long | On POST /v1/rerank, a query or a document over 32 KiB of text, refused whole and never cut | No |
| 400 | invalid_request_error | exceeds_time_limit | An embedding or rerank request that the measured speed of every GPU serving the model shows cannot finish within its time limit; the message says how long it would take. Sent before any work, uncharged | No; send fewer or shorter inputs |
| 400 | invalid_request_error | task_mismatch | task is not the model's task, or the model is not an embedding model or a reranker on its route | No |
| 402 | insufficient_credit | insufficient_credit | The balance does not cover the request's maximum cost at the bound quote | After a top-up |
| 404 | not_found_error | model_not_found | Unknown catalog id, alias, pinned id or dep_; another workspace's dep_; a name starting with hips-router that is not one of the four routers | No |
| 429 | rate_limit_error | rate_limit_exceeded | A rate limit; param is the counter that is full: requests, input_tokens (the prompt does not fit what is left of the input tokens a minute), output_tokens (the output tokens a minute are spent), uploads, batches (batches created per hour) or knowledge_search; Retry-After and retry-after-ms | Yes, after Retry-After |
| 429 | rate_limit_error | no_capacity, overloaded, pool_unavailable, model_loading | A key HIPS has set to answer at once when busy (HIPS sets it on the key a marketplace partner calls with; no workspace can set it): where no GPU is free for the request, it gets the answer the 503 of the same code gives, with its message and Retry-After, as a 429 at once, and never waits in the queue for a busy GPU; where another key would wait for a GPU that holds the model, it gets overloaded with the expected wait as Retry-After. Every other key gets the 503. A gateway over its own limits, and every other 503, stay 503 on every key | Yes, after Retry-After |
| 503 | overloaded_error | no_capacity | No eligible worker under the request's requirements, in any pool the requirements allow; Retry-After. The message says what those pools can do now: a GPU that fits the model takes it when free or loads it when asked, which can take minutes or longer; or nothing can serve it, and a retry sooner than the given delay gets the same answer; or the GPUs offering it have no speed figures yet for the setting they run it at, which a later retry may find measured. Where no price is in force for the model in any pool the request may use, the message says so, whatever supply there is, and the model's hips.availability reads unpriced | Yes, after the given delay |
| 503 | overloaded_error | overloaded | Eligible workers exist and every one is saturated, the queue is full, or the model is at its capacity right now. A request whose GPUs are all busy, or unavailable for a moment, waits for one up to 30 seconds first, and nothing is sent to a GPU while it is unavailable; a chat completions, Responses or Messages request whose GPU becomes unavailable before its answer begins waits the same way; Retry-After, from 1 to 30 seconds | Yes |
- Status
- 400
- Type
invalid_request_error- Code
invalid_json- Situation
- The body is not JSON, or not an object
- Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
missing_required_parameter- Situation
- A required field or header is absent;
paramnames it. OnPOST /v1/tasks, a classification model that answers in words and reads a response alone asked withoutoptions.prompt, atoptions.prompt(Safety classifiers) - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
invalid_type- Situation
- A field has the wrong JSON type
- Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
invalid_value- Situation
- A value is out of range or malformed:
stopwith more than 16 entries, aprompt_cache_keyover 512 characters, a string holding a lone surrogate escape, a router name with an empty or unknown suffix, bothmax_tokensnames with different values, anx-client-request-idheader that is not printable ASCII or is over 512 characters (paramx-client-request-id) - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
unknown_parameter- Situation
- A field the gateway does not know, at any depth;
paramnames it - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
unsupported_parameter- Situation
- A known field HIPS does not accept, or a feature the named model does not advertise in the pool the request resolves to;
paramnames it, andmessagenames the model and what to send instead (an image to a model that takes no images says so, and thatGET /v1/modelslists each model's features) - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
unsupported_value- Situation
nother than 1,stream_optionswithoutstream, a message role, part, item or tool type not accepted, a hosted tool type HIPS does not run- Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
context_length_exceeded- Situation
- The prompt is over the model's
context_length, or over the largest window any GPU serves it at now, or held only in a size that the GPUs able to hold it keep failing to read within the time limit; that limit and the prompt's count in the message, the limit the largest size that works now for this request, never more than the pool'scontext_windowon Models; the prompt is never truncated. On embeddings and rerank, an input longer than the model reads at once, never cut - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
request_too_large,input_too_large,too_many_inputs,upload_too_large- Situation
- A limit of the Limits page. The message states the request's size where the client declared it (
content-length) and the limit, each in MiB with its exact bytes, each image counted as sent in base64, and what to send instead: fewer or smaller images, a shorter request, or an upload on the task API. A request is never cut - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
input_too_long- Situation
- On
POST /v1/rerank, a query or a document over 32 KiB of text, refused whole and never cut - Retry
- No
- Status
- 400
- Type
invalid_request_error- Code
exceeds_time_limit- Situation
- An embedding or rerank request that the measured speed of every GPU serving the model shows cannot finish within its time limit; the message says how long it would take. Sent before any work, uncharged
- Retry
- No; send fewer or shorter inputs
- Status
- 400
- Type
invalid_request_error- Code
task_mismatch- Situation
taskis not the model's task, or the model is not an embedding model or a reranker on its route- Retry
- No
- Status
- 402
- Type
insufficient_credit- Code
insufficient_credit- Situation
- The balance does not cover the request's maximum cost at the bound quote
- Retry
- After a top-up
- Status
- 404
- Type
not_found_error- Code
model_not_found- Situation
- Unknown catalog id, alias, pinned id or
dep_; another workspace'sdep_; a name starting withhips-routerthat is not one of the four routers - Retry
- No
- Status
- 429
- Type
rate_limit_error- Code
rate_limit_exceeded- Situation
- A rate limit;
paramis the counter that is full:requests,input_tokens(the prompt does not fit what is left of the input tokens a minute),output_tokens(the output tokens a minute are spent),uploads,batches(batches created per hour) orknowledge_search;Retry-Afterandretry-after-ms - Retry
- Yes, after
Retry-After
- Status
- 429
- Type
rate_limit_error- Code
no_capacity,overloaded,pool_unavailable,model_loading- Situation
- A key HIPS has set to answer at once when busy (HIPS sets it on the key a marketplace partner calls with; no workspace can set it): where no GPU is free for the request, it gets the answer the 503 of the same code gives, with its message and
Retry-After, as a 429 at once, and never waits in the queue for a busy GPU; where another key would wait for a GPU that holds the model, it getsoverloadedwith the expected wait asRetry-After. Every other key gets the 503. A gateway over its own limits, and every other 503, stay 503 on every key - Retry
- Yes, after
Retry-After
- Status
- 503
- Type
overloaded_error- Code
no_capacity- Situation
- No eligible worker under the request's requirements, in any pool the requirements allow;
Retry-After. The message says what those pools can do now: a GPU that fits the model takes it when free or loads it when asked, which can take minutes or longer; or nothing can serve it, and a retry sooner than the given delay gets the same answer; or the GPUs offering it have no speed figures yet for the setting they run it at, which a later retry may find measured. Where no price is in force for the model in any pool the request may use, the message says so, whatever supply there is, and the model'ships.availabilityreadsunpriced - Retry
- Yes, after the given delay
- Status
- 503
- Type
overloaded_error- Code
overloaded- Situation
- Eligible workers exist and every one is saturated, the queue is full, or the model is at its capacity right now. A request whose GPUs are all busy, or unavailable for a moment, waits for one up to 30 seconds first, and nothing is sent to a GPU while it is unavailable; a chat completions, Responses or Messages request whose GPU becomes unavailable before its answer begins waits the same way;
Retry-After, from 1 to 30 seconds - Retry
- Yes
Related sheets
- Sheet
- 19 of 21
- Detail
- I
- Updated
- 2026-11-26