Skip to content

Instantly share code, notes, and snippets.

@Lua12138
Created July 18, 2026 01:24
Show Gist options
  • Select an option

  • Save Lua12138/4a1e69aedb32a4297ba7c6c78688cf1b to your computer and use it in GitHub Desktop.

Select an option

Save Lua12138/4a1e69aedb32a4297ba7c6c78688cf1b to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
PROXY=${PROXY:-}
AUTH_FILE=${AUTH_FILE:-"$HOME/.codex/auth.json"}
AUTH_INFO=$(cat $AUTH_FILE | jq -r .tokens.access_token)
curl_args+=(-Ss)
if [[ -n "$PROXY" ]]; then
curl_args+=(-x "$PROXY")
fi
curl_args+=(-H "Authorization: Bearer $AUTH_INFO")
curl_args+=('https://chatgpt.com/backend-api/wham/rate-limit-reset-credits')
curl "${curl_args[@]}" | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment