Skip to content

Instantly share code, notes, and snippets.

@pahud
Last active February 13, 2026 13:31
Show Gist options
  • Select an option

  • Save pahud/8965bfeec441225009abfa96f4751f48 to your computer and use it in GitHub Desktop.

Select an option

Save pahud/8965bfeec441225009abfa96f4751f48 to your computer and use it in GitHub Desktop.
~/.openclaw/openclaw.json for Aamzon Bedrock API KEY
cat ~/.openclaw/openclaw.json | jq -r .models
{
  "mode": "merge",
  "providers": {
    "bedrock": {
      "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com",
      "apiKey": "${AWS_BEARER_TOKEN_BEDROCK}",
      "api": "bedrock-converse-stream",
      "auth": "api-key",
      "authHeader": true,
      "models": [
        {
          "id": "openai.gpt-oss-120b-1:0",
          "name": "GPT OSS",
          "reasoning": true,
          "input": [
            "text"
          ],
          "cost": {
            "input": 0,
            "output": 0,
            "cacheRead": 0,
            "cacheWrite": 0
          },
          "contextWindow": 262144,
          "maxTokens": 8192
        }
      ]
    }
  }
}
% cat ~/.openclaw/openclaw.json | jq -r .agents.defaults
{
  "model": {
    "primary": "bedrock/openai.gpt-oss-120b-1:0"
  },
  "models": {
    "bedrock/openai.gpt-oss-120b-1:0": {
      "alias": "gpt-oss-120b"
    }
  },
  ...
}
# generate Bedrock API KEY at https://console.aws.amazon.com/bedrock/home#/api-keys
export AWS_BEARER_TOKEN_BEDROCK=xxxxxxxxx
openclaw gateway run --verbose // make sure no errors

Now when you type /new in Telegram, you should see

✅ New session started · model: bedrock/openai.gpt-oss-120b-1:0

Then it works!

@pahud
Copy link
Author

pahud commented Feb 1, 2026

Model IDs:

Qwen3 Coder - qwen.qwen3-coder-30b-a3b-v1:0
Clause Haiku 4.5 - us.anthropic.claude-haiku-4-5-20251001-v1:0
GPT OSS 120b - openai.gpt-oss-120b-1:0

@slayer3600
Copy link

slayer3600 commented Feb 1, 2026

Thanks for sharing this, super helpful!

For those outside the US, I had to use: "global.anthropic.claude-haiku-4-5-20251001-v1:0" in order to get it to work.

You can also use Opus: "global.anthropic.claude-opus-4-5-20251101-v1:0"

@pahud
Copy link
Author

pahud commented Feb 2, 2026

qwen3-coder is having some func calling issue in OpenClaw.

Consider to opt in openai.gpt-oss-120b-1:0 with the same pricing rate.

@gambit0w
Copy link

gambit0w commented Feb 5, 2026

Can you please provide whole config? can make it work(

@kimisme9386
Copy link

kimisme9386 commented Feb 7, 2026

I got error as below even exporting environment variable export AWS_BEARER_TOKEN_BEDROCK=xxxxxxxxx

error Failed to read config at /Users/9icloud/.openclaw/openclaw.json MissingEnvVarError: Missing env var "AWS_BEARER_TOKEN_BEDROCK" referenced at config path: models.providers.bedrock.apiKey
    at substituteString (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:515:56)
    at substituteAny (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:527:40)
    at substituteAny (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:531:65)
    at substituteAny (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:531:65)
    at substituteAny (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:531:65)
    at substituteAny (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:531:65)
    at resolveConfigEnvVars (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:545:9)
    at Object.loadConfig (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:4574:27)
    at loadConfig (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/config-BAN8QfW5.js:4825:20)
    at Object.stopChannel (file:///Users/9icloud/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/gateway-cli-c_8Yf5s6.js:1792:15) {
  varName: 'AWS_BEARER_TOKEN_BEDROCK',
  configPath: 'models.providers.bedrock.apiKey'

One of solutions just use .env file based on official document
cat ~/.openclaw/.env

AWS_BEARER_TOKEN_BEDROCK={your_token}

Anyone can reference if you experience the issue
Thanks phaud's sharing

@spiraleyeld
Copy link

Hi everyone,

When I try to connect to AWS Bedrock via API, I keep getting the following error:

ThrottlingException
Too many tokens per day, please wait before trying again.

This is a brand-new AWS account, and I haven't actually been able to make a single successful request yet.
I originally assumed Bedrock would work on a pay-as-you-go basis, where usage is simply charged per token.

However, after searching online, I found many different explanations and suggested fixes, and I'm still not sure which configuration is actually correct or what needs to be enabled for a new account.

Has anyone experienced this with a new account?
Is there any quota, approval step, or default limit that needs to be adjusted before Bedrock API calls will work properly?

@pahud
Copy link
Author

pahud commented Feb 12, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment