1import{j as e}from"./index-BkgFiefw.js";let r={title:"AWS Bedrock",description:"Route Bedrock-hosted models (Claude, Llama, Mistral, Titan) through Bastio with IAM auth."},a=[{href:"/docs/developer-apis/detect"},{href:"/docs/getting-started"},{href:"/docs/observability"},{href:"/docs/providers/anthropic"},{href:"/docs/providers/azure"}],l={contents:[{heading:void 0,content:`AWS Bedrock is Anthropic's Claude family plus a catalog of other 2foundation models, fronted by AWS infrastructure with IAM-based auth.`},{heading:void 0,content:"The repository includes a Bedrock provider client, but the public /v1/chat/completions route does not currently select Bedrock model prefixes. Use the standalone /v1/detect API before calling Bedrock directly. The gateway examples below describe the intended integration and should not be treated as generally available today."},{heading:"prerequisites",content:`An AWS account with Bedrock model access enabled in your 3region. Most models require an explicit "Request access" step 4in the Bedrock console.`},{heading:"prerequisites",content:`An IAM user or role with bedrock:InvokeModel and 5bedrock:InvokeModelWithResponseStream permissions.`},{heading:"prerequisites",content:"A running Bastio gateway (Getting started)."},{heading:"get-credentials",content:`Bedrock auth is AWS Signature V4, not a bearer token. Bastio 6needs:`},{heading:"get-credentials",content:"AWS_ACCESS_KEY_ID"},{heading:"get-credentials",content:"AWS_SECRET_ACCESS_KEY"},{heading:"get-credentials",content:"AWS_REGION (e.g. us-east-1, eu-central-1)"},{heading:"get-credentials",content:`Generate them in the IAM console (Users â your user â Security 7credentials â Create access key) or use a programmatic role with 8sts:AssumeRole.`},{heading:"create-the-proxy",content:"Configure AWS credentials and region in the Bastio deployment first. The proxy request stores routing metadata and never accepts IAM secrets:"},{heading:"create-the-proxy",content:"Create the Bastio gateway key separately under Developer API â API Keys. Bastio uses the server-side AWS credentials to sign provider requests."},{heading:"send-a-request",content:`Bedrock model IDs are vendor-prefixed: anthropic.claude-..., 9meta.llama3-..., mistral.mistral-..., etc.`},{heading:"send-a-request",content:`Bastio translates the OpenAI-shaped request body into Bedrock's 10native InvokeModel format, signs with SigV4, and returns the 11response in OpenAI-compatible shape â same as native Bedrock 12SDKs do, but with security scanning in the path.`},{heading:"inference-profiles-vs-on-demand",content:"Bedrock has two routing modes:"},{heading:"inference-profiles-vs-on-demand",content:`On-demand â the model is invoked directly by ID. Default 13for most models.`},{heading:"inference-profiles-vs-on-demand",content:`Inference profile â a logical handle that AWS routes to a 14specific region/instance pool. Required for some 15cross-region or provisioned-throughput configurations.`},{heading:"inference-profiles-vs-on-demand",content:`Inference profile IDs are prefixed with the AWS region: 16us.anthropic.claude-sonnet-4-5-v2:0. Pass the profile ID as 17model and Bastio handles the rest.`},{heading:"supported-features",content:`Chat completions â full Anthropic / Llama / Mistral 18message-formatted models.`},{heading:"supported-features",content:`Streaming â uses Bedrock's InvokeModelWithResponseStream 19under the hood. Bastio's stream rewriter works on the 20decoded EventStream events.`},{heading:"supported-features",content:`Tool calling â Anthropic Claude on Bedrock supports tool 21use; Bastio passes it through.`},{heading:"supported-features",content:`Multimodal â Claude vision models accept image_url blocks 22the same as native Anthropic.`},{heading:"regions",content:`Bedrock model availability varies sharply by region. Common 23gotchas:`},{heading:"regions",content:"Region"},{heading:"regions",content:"Notes"},{heading:"regions",content:"us-east-1 (N. Virginia)"},{heading:"regions",content:"Widest model selection â usually first to get new releases."},{heading:"regions",content:"us-west-2 (Oregon)"},{heading:"regions",content:"Second-tier coverage; most Claude + Meta models."},{heading:"regions",content:"eu-central-1 (Frankfurt)"},{heading:"regions",content:"EU data residency â partial Claude coverage, no Meta. Verify per-model in the Bedrock console."},{heading:"regions",content:"ap-northeast-1 (Tokyo)"},{heading:"regions",content:"Japan residency, narrower model list."},{heading:"regions",content:`The region encoded with a stored Bedrock credential (or AWS_REGION when using the deployment credential chain) is the SigV4 signing region. It must match where the model is actually deployed. A request 24for a us-east-1-only model signed for eu-central-1 returns 25AccessDeniedException from Bedrock.`},{heading:"gotchas",content:`Model access is per-region, per-account, per-model. "I see 26Claude Sonnet in the console" doesn't mean your IAM principal 27can call it. Check Bedrock â Model access â Manage model 28access.`},{heading:"gotchas",content:`Cross-region routing. Use inference profiles for 29multi-region failover; without them, a region outage means 30manually switching the proxy's region.`},{heading:"gotchas",content:`Streaming chunk format differs from OpenAI. Bastio 31normalizes to OpenAI streaming shape, but if you bypass and 32call Bedrock directly, expect EventStream binary frames.`},{heading:"gotchas",content:`Pricing isn't on the response. Bedrock returns token 33counts, but cost calculation is downstream. Bastio's 34observability layer computes and records per-request cost 35using the published Bedrock rate table.`},{heading:"where-the-request-shows-up-in-traces",content:`Bedrock requests land in Traces with provider: bedrock. The 36underlying vendor (anthropic, meta, mistral, etc.) is captured 37in the trace metadata so you can filter by either dimension. 38See Observability.`},{heading:"next",content:`Anthropic â same Claude models, 39Anthropic-direct API instead of Bedrock.`},{heading:"next",content:`Azure â OpenAI models on Azure
40infrastructure with similar IAM-style auth.`}],headings:[{id:"prerequisites",content:"Prerequisites"},{id:"get-credentials",content:"Get credentials"},{id:"create-the-proxy",content:"Create the proxy"},{id:"send-a-request",content:"Send a request"},{id:"python",content:"Python"},{id:"inference-profiles-vs-on-demand",content:"Inference profiles vs on-demand"},{id:"supported-features",content:"Supported features"},{id:"regions",content:"Regions"},{id:"gotchas",content:"Gotchas"},{id:"where-the-request-shows-up-in-traces",content:"Where the request shows up in traces"},{id:"next",content:"Next"}]};const d=[{depth:2,url:"#prerequisites",title:e.jsx(e.Fragment,{children:"Prerequisites"})},{depth:2,url:"#get-credentials",title:e.jsx(e.Fragment,{children:"Get credentials"})},{depth:2,url:"#create-the-proxy",title:e.jsx(e.Fragment,{children:"Create the proxy"})},{depth:2,url:"#send-a-request",title:e.jsx(e.Fragment,{children:"Send a request"})},{depth:3,url:"#python",title:e.jsx(e.Fragment,{children:"Python"})},{depth:2,url:"#inference-profiles-vs-on-demand",title:e.jsx(e.Fragment,{children:"Inference profiles vs on-demand"})},{depth:2,url:"#supported-features",title:e.jsx(e.Fragment,{children:"Supported features"})},{depth:2,url:"#regions",title:e.jsx(e.Fragment,{children:"Regions"})},{depth:2,url:"#gotchas",title:e.jsx(e.Fragment,{children:"Gotchas"})},{depth:2,url:"#where-the-request-shows-up-in-traces",title:e.jsx(e.Fragment,{children:"Where the request shows up in traces"})},{depth:2,url:"#next",title:e.jsx(e.Fragment,{children:"Next"})}];function n(i){const s={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(s.p,{children:`AWS Bedrock is Anthropic's Claude family plus a catalog of other 41foundation models, fronted by AWS infrastructure with IAM-based auth.`}),` 42`,e.jsxs(s.blockquote,{children:[` 43`,e.jsxs(s.p,{children:["The repository includes a Bedrock provider client, but the public ",e.jsx(s.code,{children:"/v1/chat/completions"})," route does not currently select Bedrock model prefixes. Use the standalone ",e.jsx(s.a,{href:"/docs/developer-apis/detect",children:e.jsx(s.code,{children:"/v1/detect"})})," API before calling Bedrock directly. The gateway examples below describe the intended integration and should not be treated as generally available today."]}),` 44`]}),` 45`,e.jsx(s.h2,{id:"prerequisites",children:"Prerequisites"}),` 46`,e.jsxs(s.ul,{children:[` 47`,e.jsxs(s.li,{children:["An AWS account with ",e.jsx(s.strong,{children:"Bedrock model access enabled"}),` in your 48region. Most models require an explicit "Request access" step 49in the Bedrock console.`]}),` 50`,e.jsxs(s.li,{children:["An IAM user or role with ",e.jsx(s.code,{children:"bedrock:InvokeModel"}),` and 51`,e.jsx(s.code,{children:"bedrock:InvokeModelWithResponseStream"})," permissions."]}),` 52`,e.jsxs(s.li,{children:["A running Bastio gateway (",e.jsx(s.a,{href:"/docs/getting-started",children:"Getting started"}),")."]}),` 53`]}),` 54`,e.jsx(s.h2,{id:"get-credentials",children:"Get credentials"}),` 55`,e.jsx(s.p,{children:`Bedrock auth is AWS Signature V4, not a bearer token. Bastio 56needs:`}),` 57`,e.jsxs(s.ul,{children:[` 58`,e.jsx(s.li,{children:e.jsx(s.code,{children:"AWS_ACCESS_KEY_ID"})}),` 59`,e.jsx(s.li,{children:e.jsx(s.code,{children:"AWS_SECRET_ACCESS_KEY"})}),` 60`,e.jsxs(s.li,{children:[e.jsx(s.code,{children:"AWS_REGION"})," (e.g. ",e.jsx(s.code,{children:"us-east-1"}),", ",e.jsx(s.code,{children:"eu-central-1"}),")"]}),` 61`]}),` 62`,e.jsxs(s.p,{children:[`Generate them in the IAM console (Users â your user â Security 63credentials â Create access key) or use a programmatic role with 64`,e.jsx(s.code,{children:"sts:AssumeRole"}),"."]}),` 65`,e.jsx(s.h2,{id:"create-the-proxy",children:"Create the proxy"}),` 66`,e.jsx(s.p,{children:"Configure AWS credentials and region in the Bastio deployment first. The proxy request stores routing metadata and never accepts IAM secrets:"}),` 67`,e.jsx(e.Fragment,{children:e.jsx(s.pre,{className:"shiki shiki-themes g
67ithub-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:e.jsxs(s.code,{children:[e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"curl"}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -X"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" POST"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" http://localhost:4000/v1/proxies"}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" \\"})]}),` 68`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -H"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "Content-Type: application/json"'}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" \\"})]}),` 69`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" '{"})]}),` 70`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "name": "prod-bedrock",'})}),` 71`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "slug": "prod-bedrock",'})}),` 72`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "target_provider": "bedrock",'})}),` 73`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "target_model": "anthropic.claude-sonnet-4-5-v2:0"'})}),` 74`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" }'"})})]})})}),` 75`,e.jsxs(s.p,{children:["Create the Bastio gateway key separately under ",e.jsx(s.strong,{children:"Developer API â API Keys"}),". Bastio uses the server-side AWS credentials to sign provider requests."]}),` 76`,e.jsx(s.h2,{id:"send-a-request",children:"Send a request"}),` 77`,e.jsxs(s.p,{children:["Bedrock model IDs are vendor-prefixed: ",e.jsx(s.code,{children:"anthropic.claude-..."}),`, 78`,e.jsx(s.code,{children:"meta.llama3-..."}),", ",e.jsx(s.code,{children:"mistral.mistral-..."}),", etc."]}),` 79`,e.jsx(e.Fragment,{children:e.jsx(s.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:e.jsxs(s.code,{children:[e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"curl"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" http://localhost:4000/v1/chat/completions"}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" \\"})]}),` 80`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -H"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "Authorization: Bearer '}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"$BASTIO_GATEWAY_KEY"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" \\"})]}),` 81`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -H"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "Content-Type: application/json"'}),e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" \\"})]}),` 82`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" '{"})]}),` 83`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "model": "anthropic.claude-sonnet-4-5-v2:0",'})}),` 84`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "messages": [{"role": "user", "content": "Hello"}]'})}),` 85`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" }'"})})]})})}),` 86`,e.jsx(s.p,{children:`Bastio translates the OpenAI-shaped request body into Bedrock's 87native InvokeModel format, signs with SigV4, and returns the 88response in OpenAI-compatible shape â same as native Bedrock 89SDKs do, but with security scanning in the path.`}),` 90`,e.jsx(s.h3,{id:"python",children:"Python"}),` 91`,e.jsx(e.Fragment,{children:e.jsx(s.pre,{className:"shiki shiki-themes g
91ithub-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z" fill="currentColor" /></svg>',children:e.jsxs(s.code,{children:[e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" openai "}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" OpenAI"})]}),` 92`,e.jsx(s.span,{className:"line"}),` 93`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"client "}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" OpenAI("})]}),` 94`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:" base_url"}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"http://localhost:4000/v1"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),` 95`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:" api_key"}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"os.environ["}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"BASTIO_GATEWAY_KEY"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"],"})]}),` 96`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:")"})}),` 97`,e.jsx(s.span,{className:"line"}),` 98`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"resp "}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" client.chat.completions.create("})]}),` 99`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:" model"}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"anthropic.claude-sonnet-4-5-v2:0"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),` 100`,e.jsxs(s.span,{className:"line",children:[e.jsx(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB
10070"},children:" messages"}),e.jsx(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"[{"}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"role"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": "}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"user"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"content"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": "}),e.jsx(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"Hello"'}),e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}],"})]}),` 101`,e.jsx(s.span,{className:"line",children:e.jsx(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:")"})})]})})}),` 102`,e.jsx(s.h2,{id:"inference-profiles-vs-on-demand",children:"Inference profiles vs on-demand"}),` 103`,e.jsx(s.p,{children:"Bedrock has two routing modes:"}),` 104`,e.jsxs(s.ul,{children:[` 105`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"On-demand"}),` â the model is invoked directly by ID. Default 106for most models.`]}),` 107`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Inference profile"}),` â a logical handle that AWS routes to a 108specific region/instance pool. Required for some 109cross-region or provisioned-throughput configurations.`]}),` 110`]}),` 111`,e.jsxs(s.p,{children:[`Inference profile IDs are prefixed with the AWS region: 112`,e.jsx(s.code,{children:"us.anthropic.claude-sonnet-4-5-v2:0"}),`. Pass the profile ID as 113`,e.jsx(s.code,{children:"model"})," and Bastio handles the rest."]}),` 114`,e.jsx(s.h2,{id:"supported-features",children:"Supported features"}),` 115`,e.jsxs(s.ul,{children:[` 116`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Chat completions"}),` â full Anthropic / Llama / Mistral 117message-formatted models.`]}),` 118`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Streaming"})," â uses Bedrock's ",e.jsx(s.code,{children:"InvokeModelWithResponseStream"}),` 119under the hood. Bastio's stream rewriter works on the 120decoded EventStream events.`]}),` 121`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Tool calling"}),` â Anthropic Claude on Bedrock supports tool 122use; Bastio passes it through.`]}),` 123`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Multimodal"})," â Claude vision models accept ",e.jsx(s.code,{children:"image_url"}),` blocks 124the same as native Anthropic.`]}),` 125`]}),` 126`,e.jsx(s.h2,{id:"regions",children:"Regions"}),` 127`,e.jsx(s.p,{children:`Bedrock model availability varies sharply by region. Common 128gotchas:`}),` 129`,e.jsxs(s.table,{children:[e.jsx(s.thead,{children:e.jsxs(s.tr,{children:[e.jsx(s.th,{children:"Region"}),e.jsx(s.th,{children:"Notes"})]})}),e.jsxs(s.tbody,{children:[e.jsxs(s.tr,{children:[e.jsxs(s.td,{children:[e.jsx(s.code,{children:"us-east-1"})," (N. Virginia)"]}),e.jsx(s.td,{children:"Widest model selection â usually first to get new releases."})]}),e.jsxs(s.tr,{children:[e.jsxs(s.td,{children:[e.jsx(s.code,{children:"us-west-2"})," (Oregon)"]}),e.jsx(s.td,{children:"Second-tier coverage; most Claude + Meta models."})]}),e.jsxs(s.tr,{children:[e.jsxs(s.td,{children:[e.jsx(s.code,{children:"eu-central-1"})," (Frankfurt)"]}),e.jsx(s.td,{children:"EU data residency â partial Claude coverage, no Meta. Verify per-model in the Bedrock console."})]}),e.jsxs(s.tr,{children:[e.jsxs(s.td,{children:[e.jsx(s.code,{children:"ap-northeast-1"})," (Tokyo)"]}),e.jsx(s.td,{children:"Japan residency, narrower model list."})]})]})]}),` 130`,e.jsxs(s.p,{children:["The region encoded with a stored Bedrock credential (or ",e.jsx(s.code,{children:"AWS_REGION"}),` when using the deployment credential chain) is the SigV4 signing region. It must match where the model is actually deployed. A request 131for a us-east-1-only model signed for eu-central-1 returns
132`,e.jsx(s.code,{children:"AccessDeniedException"})," from Bedrock."]}),` 133`,e.jsx(s.h2,{id:"gotchas",children:"Gotchas"}),` 134`,e.jsxs(s.ul,{children:[` 135`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Model access is per-region, per-account, per-model."}),` "I see 136Claude Sonnet in the console" doesn't mean your IAM principal 137can call it. Check Bedrock â Model access â Manage model 138access.`]}),` 139`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Cross-region routing."}),` Use inference profiles for 140multi-region failover; without them, a region outage means 141manually switching the proxy's region.`]}),` 142`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Streaming chunk format differs from OpenAI."}),` Bastio 143normalizes to OpenAI streaming shape, but if you bypass and 144call Bedrock directly, expect EventStream binary frames.`]}),` 145`,e.jsxs(s.li,{children:[e.jsx(s.strong,{children:"Pricing isn't on the response."}),` Bedrock returns token 146counts, but cost calculation is downstream. Bastio's 147observability layer computes and records per-request cost 148using the published Bedrock rate table.`]}),` 149`]}),` 150`,e.jsx(s.h2,{id:"where-the-request-shows-up-in-traces",children:"Where the request shows up in traces"}),` 151`,e.jsxs(s.p,{children:["Bedrock requests land in Traces with ",e.jsx(s.code,{children:"provider: bedrock"}),`. The 152underlying vendor (anthropic, meta, mistral, etc.) is captured 153in the trace metadata so you can filter by either dimension. 154See `,e.jsx(s.a,{href:"/docs/observability",children:"Observability"}),"."]}),` 155`,e.jsx(s.h2,{id:"next",children:"Next"}),` 156`,e.jsxs(s.ul,{children:[` 157`,e.jsxs(s.li,{children:[e.jsx(s.a,{href:"/docs/providers/anthropic",children:"Anthropic"}),` â same Claude models, 158Anthropic-direct API instead of Bedrock.`]}),` 159`,e.jsxs(s.li,{children:[e.jsx(s.a,{href:"/docs/providers/azure",children:"Azure"}),` â OpenAI models on Azure 160infrastructure with similar IAM-style auth.`]}),` 161`]})]})}function h(i={}){const{wrapper:s}=i.components||{};return s?e.jsx(s,{...i,children:e.jsx(n,{...i})}):n(i)}export{h as default,a as extractedReferences,r as frontmatter,l as structuredData,d as toc};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.