agentsclimarketplace

Ylsusage

Skill Asuka0411/ylsusage/skills/ylsusage

Use only when the user explicitly asks about YLS Codex usage, quota, token consumption, package status, or account balance. Trigger on ylsusage, YLS Codex 用量, yls 用量, YLS 额度, YLS 配额, or YLS 余额. Do not trigger on generic Codex/OpenAI quota or token questions unless YLS is named.From its SKILL.md

Install
npx -y skills add Asuka0411/ylsusage --skill ylsusage

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.0 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it

YLS Codex Usage

Query YLS Codex account usage, quota, and package status via API.

Rules

  • Output only the final formatted result. No preamble, no explanation.
  • If YLSCODE_API_KEY is missing, output only: 请先设置环境变量 YLSCODE_API_KEY.
  • Do not show raw JSON, API calls, Bearer token, or tool execution steps.
  • Do not read ~/.codex/auth.json or any other local Codex auth file.

API Endpoint

GET https://codex.ylsagi.com/codex/info
Authorization: Bearer <YLSCODE_API_KEY>

Authentication

Read API key from the YLSCODE_API_KEY environment variable:

export YLSCODE_API_KEY="<key>"

Use YLSCODE_API_KEY as the Bearer token. Never read the key from local Codex auth files.

Request Pattern

Always save the response to a temporary file first, parse it from disk, then delete the file.

macOS

: "${YLSCODE_API_KEY:?Set YLSCODE_API_KEY first}"
TMP_JSON=$(mktemp "${TMPDIR:-/tmp}/yls_info.XXXXXX")
trap 'rm -f "$TMP_JSON"' EXIT
curl --fail --silent --show-error \
  -H "Authorization: Bearer $YLSCODE_API_KEY" \
  https://codex.ylsagi.com/codex/info \
  -o "$TMP_JSON"
jq . "$TMP_JSON"

Linux

: "${YLSCODE_API_KEY:?Set YLSCODE_API_KEY first}"
TMP_JSON=$(mktemp "${TMPDIR:-/tmp}/yls_info.XXXXXX")
trap 'rm -f "$TMP_JSON"' EXIT
curl --fail --silent --show-error \
  -H "Authorization: Bearer $YLSCODE_API_KEY" \
  https://codex.ylsagi.com/codex/info \
  -o "$TMP_JSON"
jq . "$TMP_JSON"

Windows (PowerShell)

if (-not $env:YLSCODE_API_KEY) { throw "Set YLSCODE_API_KEY first" }
$tmp = New-TemporaryFile
try {
  Invoke-WebRequest -Uri "https://codex.ylsagi.com/codex/info" `
    -Headers @{ Authorization = "Bearer $env:YLSCODE_API_KEY" } `
    -OutFile $tmp.FullName
  Get-Content $tmp.FullName -Raw | ConvertFrom-Json | ConvertTo-Json -Depth 20
} finally {
  Remove-Item $tmp.FullName -ErrorAction SilentlyContinue
}

Response Shape

FieldMeaning
state.userUser info: uid, email
state.toDayCurrent date (server)
state.package.total_quotaMonthly total quota
state.package.weeklyQuotaWeekly total quota
state.package.package_levelPackage level (2 = Pro)
state.package.packages[]Active package details: type, quota, expiry
state.userPackgeUsageMonthly usage stats
state.userPackgeUsage_weekWeekly usage stats
state.userAccountInfoAccount balance info

Key Usage Fields

Monthly (userPackgeUsage) / Weekly (userPackgeUsage_week):

FieldMeaning
input_tokensTotal input tokens
input_tokens_cachedCached input tokens
output_tokensOutput tokens
output_tokens_reasoningReasoning tokens
total_costTotal cost ($)
input_cost / output_cost / cache_read_costCost breakdown
request_countNumber of requests
total_quotaQuota cap
remaining_quotaRemaining quota
used_percentageUsage percentage string

Quick Check

macOS / Linux

: "${YLSCODE_API_KEY:?Set YLSCODE_API_KEY first}"
TMP_JSON=$(mktemp "${TMPDIR:-/tmp}/yls_info.XXXXXX")
trap 'rm -f "$TMP_JSON"' EXIT
curl --fail --silent --show-error \
  -H "Authorization: Bearer $YLSCODE_API_KEY" \
  https://codex.ylsagi.com/codex/info \
  -o "$TMP_JSON"
jq '{package: .state.package.packages[0].package_type, level: "Lv" + (.state.package.package_level|tostring), expires: .state.package.packages[0].expires_at[:10], monthly: {remaining: .state.userPackgeUsage.remaining_quota, total: .state.userPackgeUsage.total_quota, used: .state.userPackgeUsage.used_percentage + "%", requests: .state.userPackgeUsage.request_count, cost: .state.userPackgeUsage.total_cost}, weekly: {remaining: .state.userPackgeUsage_week.remaining_quota, total: .state.userPackgeUsage_week.total_quota, used: .state.userPackgeUsage_week.used_percentage + "%", requests: .state.userPackgeUsage_week.request_count, cost: .state.userPackgeUsage_week.total_cost}}' "$TMP_JSON"

Windows (PowerShell)

if (-not $env:YLSCODE_API_KEY) { throw "Set YLSCODE_API_KEY first" }
$tmp = New-TemporaryFile
try {
  Invoke-WebRequest -Uri "https://codex.ylsagi.com/codex/info" `
    -Headers @{ Authorization = "Bearer $env:YLSCODE_API_KEY" } `
    -OutFile $tmp.FullName
  $r = Get-Content $tmp.FullName -Raw | ConvertFrom-Json
  $m = $r.state.userPackgeUsage; $w = $r.state.userPackgeUsage_week; $p = $r.state.package
  Write-Host "Package: $($p.packages[0].package_type) (Lv$($p.package_level))  Expires: $($p.packages[0].expires_at.Substring(0,10))"
  Write-Host "Monthly: `$$($m.remaining_quota) / `$$($m.total_quota) ($($m.used_percentage)%)  Requests: $($m.request_count)  Cost: `$$($m.total_cost)"
  Write-Host "Weekly:  `$$($w.remaining_quota) / `$$($w.total_quota) ($($w.used_percentage)%)  Requests: $($w.request_count)  Cost: `$$($w.total_cost)"
} finally {
  Remove-Item $tmp.FullName -ErrorAction SilentlyContinue
  }

Display Format

Format the response concisely with emojis. Match the user's conversation language: Chinese in Chinese, English in English.

Template

✨ {package_type} Lv{package_level}  ·  🎀 到期 {expires_at}

───────────────

📋 今日用量

📊 进度  [████████░░░░░░░░░░] {used_percentage}%

💰 余额  ${remaining} / ${total}
📨 请求  {requests} 次
💸 花费  $${cost}
📥 输入  {input_tokens:,} tokens
📤 输出  {output_tokens:,} tokens
🧠 推理  {reasoning_tokens:,} tokens

───────────────

📋 周度用量

📊 进度  [████████░░░░░░░░░░] {used_percentage}%

💰 余额  ${remaining} / ${total}
📨 请求  {requests} 次
💸 花费  $${cost}
📥 输入  {input_tokens:,} tokens
📤 输出  {output_tokens:,} tokens
🧠 推理  {reasoning_tokens:,} tokens

───────────────

💧 缓存命中  {cache_rate}%
🍵 今日推理  {reasoning_tokens:,} tokens

Rules

  • Progress bar: 20 chars, filled + empty.
  • Token numbers: comma-separated.
  • Costs: 2 decimal places.
  • Usage warning: >80% append 🔴, 50-80% append ⚠️.
  • Cache hit rate = input_tokens_cached / input_tokens.
  • Use userPackgeUsage as today's data, userPackgeUsage_week as weekly data.
  • Omit userAccountInfo unless the user asks for balance.
  • Keep each metric on its own line with emoji prefix.

Common Mistakes

  • Don't pipe curl directly to jq; save with -o first, then parse the file.
  • Don't hardcode the API key; always read from YLSCODE_API_KEY.
  • Don't read Codex auth files; this skill must not use local Codex auth files as credential sources.
  • The API uses userPackgeUsage (missing a in Package); this is intentional.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,286. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.