---
name: wbbbai-api
version: '1.1'
description: Integrate the public read-only WBBBAI quota event and news API into a website or application.
---

# WBBBAI API Integration Skill

Public documentation: https://wbbbai.cc/developers.html

## API endpoints
- `GET https://wbbbai.cc/api/v2/events?provider=codex&kind=banked&limit=20`
- `GET https://wbbbai.cc/api/v2/news`
- `GET https://wbbbai.cc/api/v1/health`

`provider` = `codex`, `claude`, `grok`; `kind` = `regular`, `banked`, `notice`, `policy`. Limit = 1..100.

## Integration contract
1. Inspect the existing app stack before editing. Add a compact quota events UI consistent with its design.
2. Fetch JSON; handle HTTP errors, unavailable upstream, empty records, and archival status.
3. Cache API responses for at least five minutes. Avoid polling more frequently than once a minute.
4. Separate banked credits (manual redemption) from automatic global resets, notices, and policy changes.
5. Preserve original-source URL and data attribution in every item. No claim of actual account credit based solely on a post.
6. Exclude banked credits from any regular-reset interval prediction.
7. Do not request user login cookies, API secrets or provider passwords.
8. Preserve available event timestamps in UTC and convert to the user's local timezone for display.
9. Add smoke tests for display, filtering and failure handling.

## Example (browser JavaScript)
```js
const response = await fetch('https://wbbbai.cc/api/v2/events?provider=codex&kind=banked&limit=10');
if (!response.ok) throw new Error('WBBBAI API unavailable');
const { events, generatedAt } = await response.json();
console.log(events, generatedAt);
```

## Attribution
Source data is aggregated by WBBBAI from upstream public records including CodexReset and ClaudeResets. Maintain upstream source links and their original licensing and attribution rules.


## 鉴权
在后端请求中加入 `X-API-Key: $WBBBAI_API_KEY`；密钥严禁公开于浏览器打包文件、移动端客户端或版本库。后台可调整每日限额与撤销密钥。
