| name | ylsusage |
| description | Use when the user asks about YLS Codex API usage, quota, token consumption, package status, or account balance. Triggers on keywords like ylsusage, codex info, quota check, token usage, package remaining. |
YLS Codex Usage
Query YLS Codex account usage, quota, and package status via API.
Behavior Rule
When triggered, output ONLY the final formatted result. No intermediate text.
- ❌ Do NOT say "let me fetch..." / "querying..." / "here's your usage" / any greeting or explanation
- ❌ Do NOT show raw JSON, API calls, or tool execution process
- ❌ Do NOT add any text before or after the formatted result
- ✅ Fetch data silently, then output the Display Format template directly as your only response
API Endpoint
GET https://codex.ylsagi.com/codex/info
Authorization: Bearer <API_KEY>
Authentication
Read API key from ~/.codex/auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "<key>"
}
Use the OPENAI_API_KEY value as Bearer token.
Platform-Specific Usage
macOS
KEY=$(plutil -extract OPENAI_API_KEY raw ~/.codex/auth.json 2>/dev/null || jq -r '.OPENAI_API_KEY' ~/.codex/auth.json)
curl -s -H "Authorization: Bearer $KEY" https://codex.ylsagi.com/codex/info -o /tmp/yls_info.json
jq . /tmp/yls_info.json