agentleFS
PydanticKnown publisherpydantic/genai-prices/.claude/skills/add-provider/SKILL.md

add-provider

Skill388 starsChanged 2 months agoMITView on GitHub

Add a new inference provider to genai-prices, including provider data, matching, usage extractors, update automation, cassettes, agentic checks, generated artifacts, and Python/JavaScript/Go parity tests. Use for a new provider, not a new model on an existing provider.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. ThinkInAIXYZ/deepchat★ 6.4ksame name
    2. tddworks/ClaudeBar★ 1.5ksame name
    3. yerdaulet-damir/vibe-coding-rules★ 28same name
    4. fialhosoft/agentlink★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Add the provider as a complete, maintainable integration.

    line 8
  2. Distinctive:

    Use the provider's official pricing page and model catalog.

    line 12
  3. Very specific:

    Read prices/units.yml before mapping prices.

    line 14
  4. Very specific:

    Create prices/providers/<provider>.yml.

    line 23
  5. Very specific:

    use the exact API model ID as the canonical id

    line 36
  6. Distinctive:

    add precise aliases without creating matches against sibling models

    line 37
  7. Distinctive:

    Keep models sorted by ID. Use names and context windows from official documentation when available.

    line 44
  8. Distinctive:

    Add provider extractors for flavors that report usage.

    line 51
  9. Distinctive:

    If an API response does not report usage, leave that flavor unsupported and document the limitation instead of inventing a mapping.

    line 56
  10. Very specific:

    When the official source is public and structured, add prices/src/prices/source_<provider>.py:

    line 61
  11. Very specific:

    update prices_checked while preserving curated names, aliases, context windows, and lifecycle flags

    line 65
  12. Distinctive:

    add newly discovered in-scope models

    line 67
  13. Very specific:

    Test the real HTTP boundary with @pytest.mark.vcr.

    line 74
  14. Distinctive:

    Use compact synthetic inputs only for pure parser and update-behavior tests.

    line 81
  15. Very specific:

    Add the provider to .github/agentic-price-check-providers.yml with its YAML path, exact official sources, supported scope, and unit-mapping …

    line 86
  16. Very specific:

    Update the workflow's provider count and .github/workflows/AGENTIC_PRICE_CHECK.md.

    line 90
  17. Distinctive:

    Add focused Python, JavaScript and Go tests for:

    line 103
  18. Distinctive:

    every usage extractor flavor

    line 108
  19. Very specific:

    Put the Go tests in packages/go/api_test.go, which runs against the bundled provider data.

    line 111
  20. Very specific:

    Run make build after every provider-data edit.

    line 114
  21. Very specific:

    Never hand-edit those outputs or tests/dataset/usages.json.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add a provider

Add the provider as a complete, maintainable integration. Read AGENTS.md before editing. Preserve unrelated worktree changes.

Establish the supported scope

Use the provider's official pricing page and model catalog. Record the exact source URLs.

Read prices/units.yml before mapping prices. Include only billing units represented by the current published contract. Do not add a unit to make a provider fit because that is a v3 contract change. Explain excluded model categories in the provider's price_comments.

Decide whether the official source is a complete catalog or only a pricing page. This determines whether missing models can be treated as potential removals.

Author the provider YAML

Create prices/providers/<provider>.yml. Never edit generated artifacts directly.

Cover these fields when they apply:

  • id, name, and official pricing_urls
  • api_pattern for the provider's actual API hosts and paths
  • provider_match for common provider identifiers
  • model_match only when the provider owns an unambiguous model-ID namespace
  • fallback_model_providers only when another provider's prices are intentionally inherited
  • price_comments for free allowances, unsupported units, regional differences, or other calculation boundaries

For each supported model:

  • use the exact API model ID as the canonical id
  • add precise aliases without creating matches against sibling models
  • map official rates to the correct units, such as _mtok, _kcount, or _mchars
  • include cache, reasoning, modality, request, and tool rates when represented by the unit registry
  • set prices_checked to the verification date
  • preserve historical price changes with dated conditional prices instead of overwriting old rates
  • mark officially deprecated models without inferring removal from an incomplete source

Keep models sorted by ID. Use names and context windows from official documentation when available.

Add usage extraction

Inspect recorded or documented response bodies for every supported API flavor. Do not assume that an OpenAI-compatible endpoint has the same response as the provider's native endpoint.

Add provider extractors for flavors that report usage. Extract the model when the response includes it. When the response omits the model, return the usage with a nullable model so callers can provide the request model during price calculation. Map cached tokens separately. Any extractor that maps completion_tokens must also map the provider's reasoning-token breakdown to output_reasoning_tokens. Test each flavor through the public Python, JavaScript and Go extraction APIs.

If an API response does not report usage, leave that flavor unsupported and document the limitation instead of inventing a mapping.

Add deterministic updates when possible

When the official source is public and structured, add prices/src/prices/source_<provider>.py:

  • fetch with httpx2
  • parse prices as Decimal
  • update prices_checked while preserving curated names, aliases, context windows, and lifecycle flags
  • append changed rates as dated conditional prices instead of overwriting pricing history
  • add newly discovered in-scope models
  • refuse empty or suspiciously small results before writing
  • fail loudly when the source is unreadable or changes shape

Expose get_<provider>_prices through prices.__main__. Add <provider>-get to Makefile and include it in get-all-prices.

Test the real HTTP boundary with @pytest.mark.vcr. Record the official response, inspect the cassette, remove credentials and transient cookies, commit it, and prove replay with:

uv run pytest tests/test_source_<provider>.py --record-mode=none

Use compact synthetic inputs only for pure parser and update-behavior tests. Do not replace the external request with a hand-written HTTP mock.

Add agentic monitoring

Add the provider to .github/agentic-price-check-providers.yml with its YAML path, exact official sources, supported scope, and unit-mapping notes. Add every source domain to network.allowed in .github/workflows/agentic-price-check-direct-providers.md.

Update the workflow's provider count and .github/workflows/AGENTIC_PRICE_CHECK.md. Compile the generated lock file with the pinned repository version. Never hand-edit the lock file.

gh aw compile agentic-price-check-direct-providers --no-check-update
gh aw compile agentic-price-check-direct-providers --no-check-update --no-emit --validate --actionlint

The agentic workflow is read-only. It reports price discrepancies, new models, potential removals, unchecked fields, and unreadable sources through one rolling issue.

Verify every runtime

Add focused Python, JavaScript and Go tests for:

  • provider selection by explicit provider ID
  • provider selection by API URL and model namespace when supported
  • representative input, cached-input, and output price calculation
  • every usage extractor flavor
  • aliases and context-sensitive matching that could collide

Put the Go tests in packages/go/api_test.go, which runs against the bundled provider data. Test updater parsing, metadata preservation, write guards, and cassette replay in Python only: the updater lives in prices/src/prices/.

Run make build after every provider-data edit. This regenerates the v2 feed, package data, schemas, and provider inventory. Never hand-edit those outputs or tests/dataset/usages.json.

Before handoff, run:

make all
git diff --check

Inspect the provider YAML, cassette, and generated diff. Confirm that frozen v1 files are unchanged. Follow AGENTS.md for the commit, PR description, AI disclaimer, CI monitoring, and review resolution.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.