# Codex Reset Credits

> Query the current Codex account's available rate limit reset credits and expiration times.

- **Type:** Skill
- **Install:** `agentstack add skill-snowylake-snowy-agent-skills-codex-reset-credits`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [SnowyLake](https://agentstack.voostack.com/s/snowylake)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [SnowyLake](https://github.com/SnowyLake)
- **Source:** https://github.com/SnowyLake/snowy-agent-skills/tree/main/skills/codex-reset-credits

## Install

```sh
agentstack add skill-snowylake-snowy-agent-skills-codex-reset-credits
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Codex Reset Credits

## 目录

- [概览](#概览)
- [执行流程](#执行流程)
- [输出要求](#输出要求)
- [故障处理](#故障处理)

## 概览

查询当前机器上 Codex Desktop 登录账户的 rate limit reset credits, 包括可用数量, 获取时间, 过期时间, 兑换状态和来源标识.

优先使用 `scripts/check_reset_credits.py`, 它会从 `~/.codex/auth.json` 读取当前 Codex 登录态, 调用 `https://chatgpt.com/backend-api/wham/rate-limit-reset-credits`, 并默认输出脱敏后的 Markdown 摘要.

## 执行流程

1. 说明本操作会读取本机 `~/.codex/auth.json` 并访问 `chatgpt.com`; 不要输出 access token.
2. 运行脚本:

```bash
python scripts/check_reset_credits.py
```

3. 如果当前 shell 不是 skill 目录, 使用脚本的完整路径运行.
4. 如果运行环境限制网络, 文件系统或远程认证访问, 按当前宿主的权限流程请求必要授权后重试.
5. 将脚本输出转述给用户. 默认输出已经脱敏, 且按 `expires_at` 从近到远排序.

可选参数:

- `--raw`: 输出后端原始 JSON. 只有在用户明确需要排查接口字段时使用, 因为原始响应可能包含邮箱, 头像 URL 或用户标识.
- `--json`: 输出脱敏后的 JSON 摘要, 适合需要机器读取时使用.
- `--auth PATH`: 指定其他 `auth.json` 路径.
- `--timeout SECONDS`: 调整请求超时时间.

## 输出要求

- 不要输出或记录 `access_token`.
- 默认不要展示完整 credit `id`; 如果用户需要排查, 只展示末尾 8 到 12 位即可.
- 默认输出以下格式:

```markdown
Available reset credit count: 2
Total earned count: 1

| 序号 | 状态 | 过期时间 (UTC+8) | 来源 |
| --- | --- | --- | --- |
| 1 | available | 2026-07-15 02:25:39 | @example |
```

- 过期时间按当前设备本地时区显示, 表头自动标注 UTC offset, 格式为 `YYYY-MM-DD HH:MM:SS`.
- 如果 `status` 不是 `available`, 保留该状态, 不要把它计入可用机会.
- 不要把此接口当成稳定公开 API. 如果字段缺失或响应格式变化, 如实说明并展示可确认字段.

## 故障处理

- `~/.codex/auth.json` 不存在: 告诉用户当前机器没有可用 Codex 登录态, 需要先登录 Codex Desktop.
- `access_token` 或 `account_id` 缺失: 说明 auth 文件结构与预期不一致, 不要猜测 token 位置; 可在不输出敏感值的前提下检查顶层键名.
- `401` 或 `403`: 说明登录态可能过期, 账户不匹配, 或后端权限拒绝; 建议用户重新登录 Codex Desktop 后重试.
- 网络, DNS 或超时错误: 说明是访问 `chatgpt.com` 失败, 可稍后重试或在允许网络访问的环境中运行.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [SnowyLake](https://github.com/SnowyLake)
- **Source:** [SnowyLake/snowy-agent-skills](https://github.com/SnowyLake/snowy-agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-snowylake-snowy-agent-skills-codex-reset-credits
- Seller: https://agentstack.voostack.com/s/snowylake
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
