Expand description
The Bedrock route’s own rules (docs/specs/SPEC_BEDROCK_MODEL_ROUTE_2026_12_01.md): the region and the cross-region
profile the person chose, the model name Bedrock is asked for, the token count the gateway answers itself, and the one
sentence each way Bedrock refuses a request. Pure, so each is tested without a network.
Claude models answer on Bedrock’s own Messages path, so the harness’s request goes on as it is: only the model name
(a profile id: global. or us. before the base name) and the key’s header change.
Structs§
- Refusal
- What Bedrock refused, as the one sentence the harness shows, with the status and the error type it is shown under.
Enums§
- Profile
- Which models Bedrock may route a request to: any commercial region, or the US ones.
- Wire
- How the gateway speaks to Bedrock for a model: the Claude models on Bedrock’s Messages path, as the harness does; every
other model through Chat Completions, with the adapter in between (
super::chat_adapter).
Constants§
- BETAS_
OFF_ VAR - Claude Code’s switch for the beta features Bedrock may not know. Set for the agent on this route, so a request does not carry a beta flag the upstream refuses.
- DEFAULT_
REGION - The region when the setting is not set.
- PROFILE_
SETTING - The setting that names the cross-region inference profile:
globalorus. - REGION_
SETTING - The setting that names the region the requests go to.
- ROUTE_
ID - The id of the route in the catalog.
Functions§
- chat_
rules - What a model asks of its Chat Completions request. DeepSeek V3 answers at most 8,192 tokens and has no reasoning to set; a model not named here is asked for as Amazon Ergo is.
- chat_
url - Where a Chat Completions request goes: Bedrock’s OpenAI-style path on the same host as the Messages one.
- count_
tokens_ answer - The answer to
count_tokens, made here: Bedrock’s Messages path has no count call, and a harness that sizes its prompt with one must not be answered with an error. An estimate from the text; an image counts for a fixed amount. - models_
answer - The answer to
v1/models: the route’s own models, in the shape a Messages harness reads. Bedrock has no such list on the Messages path, and a harness that asks must not be answered with an error. - price_
factor - What
modelcosts underprofile, as a multiple of its listed price. - profile
- The profile the settings choose;
globalfor anything else. - profile_
model - The id Bedrock is asked for: the catalog’s base name under the profile.
- refusal
- The sentence for a request Bedrock did not serve, from its status and what it said (
bodyis its text,error_typethex-amzn-ErrorTypeit sent).Nonefor what is not named here: the answer goes to the harness as Bedrock gave it. Nothing the person sent or the key is repeated. - region
- The region the settings choose, or
DEFAULT_REGIONwhen it is not set or is not a region’s name. - takes_
profile - Whether a model is asked for under the person’s profile. DeepSeek’s models are served in their own region only: AWS lists no global or geographic profile for them, so the base name goes up as it is and the profile changes no price.
- wire_of
- The wire a model needs: a Claude model’s base name starts
anthropic.. - with_
profile_ model - The request body with its
modelmade the profile id of the base name it holds. A body that is not JSON, or names no model, goes on as it is.