Skip to content

Instantly share code, notes, and snippets.

@jongan69
Created March 20, 2026 05:31
Show Gist options
  • Select an option

  • Save jongan69/0fb9832010ac559e2abce1a6e6c9946c to your computer and use it in GitHub Desktop.

Select an option

Save jongan69/0fb9832010ac559e2abce1a6e6c9946c to your computer and use it in GitHub Desktop.
Bash Script for checking if api key is working
API_KEY=$(/usr/bin/security find-generic-password -a jon -s openclaw-anthropic-key -w) && curl -s https://api.anthropic.com/v1/messages -H "x-api-key: $API_KEY" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" -d '{"model":"claude-haiku-4-5-20251001","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment