yandex-oauth-token

yandex-oauth-token is a skill for Claude Code from Xakki/ai-agents-skills. It costs 140 tokens per session (1,297 once invoked), scanned A, original, MIT.

A guide for obtaining and managing Yandex OAuth tokens, which are credentials that let a service act on a user's behalf. It focuses on Yandex Metrika, a web-analytics service.

In plain words
What is it for?
Use it to connect Yandex Metrika Logs API to a service or scheduled job, choose the needed access scope, refresh tokens, and diagnose permission problems.
Why use it?
It explains how to get and refresh tokens for unattended services and how to investigate access errors such as 403 responses.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ai-agents-skills plugin — 23 skills, 3 agents, 6 hooks shipped together

Good fit Use it to connect Yandex Metrika Logs API to a service or scheduled job, choose the needed access scope, refresh tokens, and diagnose permission problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xakki/ai-agents-skills/yandex-oauth-token
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Xakki/ai-agents-skills --skill yandex-oauth-token
Clone the repo
git clone --depth 1 https://github.com/Xakki/ai-agents-skills

Made for: Claude Code.

Or install ai-agents-skills, the plugin that ships this one along with the rest of its 23 skills, 3 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for yandex-oauth-token

README.md
[![agentmods](https://agentmods.dev/badge/skills/xakki/ai-agents-skills/yandex-oauth-token/github.svg)](https://agentmods.dev/skills/xakki/ai-agents-skills/yandex-oauth-token)
Your own site
<a href="https://agentmods.dev/skills/xakki/ai-agents-skills/yandex-oauth-token"><img src="https://agentmods.dev/badge/skills/xakki/ai-agents-skills/yandex-oauth-token/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for yandex-oauth-token

Your own site · 80×15
<a href="https://agentmods.dev/skills/xakki/ai-agents-skills/yandex-oauth-token"><img src="https://agentmods.dev/badge/skills/xakki/ai-agents-skills/yandex-oauth-token.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,297 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00140 $0.01297
Opus 5 $0.00070 $0.00648
Sonnet 5 $0.00028 $0.00259
Haiku 4.5 $0.00014 $0.00130

Measured 12d ago against content hash eb506df2d92a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

yandex-oauth-token scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/yandex-oauth.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Full flows, curl examples, diagnostics table and sources → **`reference.md`**.
skills/yandex-oauth-token/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

yandex-oauth-token

Working with Yandex OAuth (Yandex ID) user-scoped tokens: get one, refresh it non-interactively, wire it into a service/cron, and diagnose auth failures (esp. 403 access_denied on Metrika).

Full flows, curl examples, diagnostics table and sources → reference.md.

Core facts

  • Auth header for Yandex Metrika API is Authorization: OAuth <token>NOT Bearer.
  • Endpoints: authorize https://oauth.yandex.ru/authorize, token https://oauth.yandex.ru/token.
  • Scope: Metrika Logs API (create/download logrequests) needs only metrika:read. metrika:write is for editing counters / uploading data. The token's account must also have at least guest read access to the specific counter.
  • client_credentials does NOT work for user data — you cannot mint a user token from client_id + client_secret alone. User consent (a browser step) is always required once.

Getting a token (happy path)

Prefer authorization-code flow for anything unattended (it yields a refresh_token):

  1. One-time, in a browser logged in as the account with access to the counter: https://oauth.yandex.ru/authorize?response_type=code&client_id=<CLIENT_ID> → short-lived single-use code (~10 min TTL, shown on-page or in redirect ?code=).
  2. Exchange server-side (needs client_secret):
    curl -sS -X POST 'https://oauth.yandex.ru/token' \
      --data-urlencode 'grant_type=authorization_code' \
      --data-urlencode 'code=<CODE>' \
      --data-urlencode 'client_id=<CLIENT_ID>' \
      --data-urlencode 'client_secret=<CLIENT_SECRET>'
    
    → JSON access_token, refresh_token, expires_in.

Quick alternative: implicit flow (response_type=token) is fastest but gives no refresh_token → must be regenerated by hand each time. Details in reference.md.

Helper script

scripts/yandex-oauth.sh automates the code flow — two commands:

OAUTH_PREFIX=OAUTH_METRIC ENV_FILE=.env.local scripts/yandex-oauth.sh authorize-url   # open in browser → grab ?code=
OAUTH_PREFIX=OAUTH_METRIC ENV_FILE=.env.local scripts/yandex-oauth.sh exchange <CODE> # code → token+refresh, saved

Read the full file on GitHub · 93 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 93 lines · 140 tokens per session scan A eb506df2d92a

Subscribe to this mod's changes

yandex-oauth-token is a skill published in the GitHub repository Xakki/ai-agents-skills (6 stars, last pushed 21d ago), licensed MIT. It adds 140 tokens to every session and 1,297 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.