Tag: API

  • Working with the Anthropic API: Console, Models, BYOK & Costs

    Working with the Anthropic API: Console, Models, BYOK & Costs

    Last verified: September 2026. The API is where Claude stops being a chat window and starts being infrastructure. Four deep dives, one hub — the developer console, every model identifier, the subscription-vs-API cost crossover, and the bring-your-own-key strategy that keeps multi-provider stacks from breaking.

    The console: your developer home base

    The Anthropic Console (platform.claude.com) is where the API work actually happens — creating API keys, managing billing, monitoring usage, setting up workspaces, and navigating the developer dashboard. Start here if you haven’t touched the API side yet.

    → Anthropic Console: Developer Quickstart Guide (2026) — API keys, billing, usage monitoring, workspaces.

    The models: every identifier, decoded

    Every current Claude API model string — claude-fable-5, claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5 — with context windows, per-token pricing, and when to use each. The one to bookmark; you’ll come back to it every time a new model drops and your code needs the right string.

    → Claude API Models: Complete 2026 Identifier Guide — model strings, context windows, per-token pricing, usage guidance.

    The money question: API vs subscription

    Subscription (Pro/Max) for interactive daily use; API for automation, building, and irregular usage. Here’s the cost crossover — and what the API adds that subscriptions don’t. The honest math on which billing shape fits your workload.

    → Claude API vs Subscription: Which Is Cheaper? (2026) — the cost crossover and what the API adds.

    The multi-provider play: BYOK on OpenRouter

    How to wire bring-your-own-key provider integrations on OpenRouter across dozens of providers without breaking your stack — prioritization, fallback chains, and per-agent configuration. For the builders running more than one model behind their agents.

    → BYOK on OpenRouter: Provider Keys, Prioritization, and Fallback Strategy — provider keys, prioritization, fallback chains.

    Four deep dives, one hub. The console to get set up, the model identifiers to wire it right, the cost math to bill it right, and BYOK when one provider isn’t enough.

  • wp-direct-publish: the tiny script behind our API-first WordPress lane

    wp-direct-publish: the tiny script behind our API-first WordPress lane

    We just open-sourced a ~60-line Python script that publishes WordPress posts through the REST API. It’s MIT-licensed, three files, and it ran our storm lane overnight before we released it.

    Repository: https://github.com/TygartMedia/wp-direct-publish

    Why it exists

    We publish a lot of WordPress posts. For a while, the publishing path went through a browser — a real Chromium session, clicking through the editor, waiting on page loads, recovering from the inevitable flaky step. Around 65 steps per post.

    Then we measured it. Same job, two lanes: the browser lane used roughly 10x the tokens and took roughly 2x the wall-clock time of going straight to the WordPress REST API. The API lane is also byte-exact and diffable — what you send is what lands, and you can see it in a diff instead of squinting at screenshots.

    So we burned in a standing rule: publish via the API first. The browser lane stays as the fallback for jobs the API genuinely can’t do, not the default.

    The security design

    The interesting part of the script isn’t the publishing — it’s what it refuses to do with your credentials.

    An application password never travels through argv, environment variables, or disk. It’s piped in through stdin, used once for the Basic-auth header, and forgotten. The Python standard library does everything; there are no third-party dependencies and nothing to install.

    The workflow that goes with it is just as deliberate: when a fresh application password is needed, Will pastes one into chat, it goes straight into the pipe, and it’s never stored — not in files, not in memory, not in chat logs, not in the vault. Transient use is the feature, not a limitation.

    Generate app passwords at wp-admin → Users → Profile → Application Passwords (bottom of profile.php), and you can revoke them in one click whenever you want.

    Dogfooded, then released

    This is our standing build flow: every internal tool gets dogfooded on our own operation first, then open-sourced with the invitation — take it, make it better, and if you build something better, we’ll be customer number one.

    wp-direct-publish.py ran the storm lane — real overnight storm-warning posts, real publishing pressure — before a single line went public. The README tells that story honestly, including the measurements. We don’t ship what we haven’t lived with.

    Take it

    Three files. Standard library only. MIT.

    https://github.com/TygartMedia/wp-direct-publish

    If it saves you from driving a browser through 65 steps to publish a post, it did its job.

  • Grok vs Claude Pricing (September 2026): Seats, API Rates, and When Each Wins

    Grok vs Claude Pricing (September 2026): Seats, API Rates, and When Each Wins

    Last verified: September 23, 2026 (Pacific). API figures from xAI developer pricing and Anthropic model cards. Consumer seat prices vary by store and region — confirm at x.ai and claude.com before you pay.

    Direct answer: Grok is cheaper per token at every comparable rung. Claude is cheaper only if you stay on Sonnet 5 ($2/$10) or Haiku 4.5 ($1/$5) and never call Fable. Consumer stickers look inverted: Claude Pro is $20, SuperGrok is about $30. The catch is what the seat includes. Pro does not include Fable. Max includes Fable only up to 50% of the weekly pool. Grok has no public $10/$50 SKU.

    Consumer seats

      Grok (xAI) Claude (Anthropic)
    Free Metered on grok.com and X Metered, Sonnet
    Everyday paid SuperGrok ~$30/mo (X Premium+ bundle ~$40) Pro $20/mo
    Heavy individual Plus ~$100 or Heavy ~$300 Max 5x $100 / Max 20x $200
    Team Grok Business ~$30/seat Team ~$20-25/seat annual

    Claude Pro wins the $20 vs $30 sticker. Max 20x ($200) undercuts SuperGrok Heavy ($300). They are not the same product: Claude splits models by plan. Fable 5 / 5.1 is included on Max and premium Team/Enterprise seats only, capped at half the weekly bar. Pro and Team Standard pay usage credits from the first Fable token. Details: Fable pricing and plan access and Claude Code limits (Sep 2026).

    API rates per million tokens

    Grok. Official xAI card. Prompts that reach 200k tokens are billed at 2x for the whole request.

    Model In / out Context Cached input
    Grok Build 0.1 $1 / $2 256k $0.20
    Grok 4.3 / 4.20 $1.25 / $2.50 1M $0.20
    Grok 4.5 / 4.6 $2 / $6 500k $0.30-$0.50

    Claude.

    Model In / out Context Cache read
    Haiku 4.5 $1 / $5 200k $0.10
    Sonnet 5 $2 / $10 1M $0.20
    Opus 5.5 (current) $4 / $20 1M $0.20
    Opus 5 (legacy) $5 / $25 1M $0.50
    Fable 5.1 $10 / $50 1M $0.25

    Fable 5.1 headline rates match Fable 5. The Sep 1 change was cache reads: $1.00 to $0.25. A cold Fable call is still the expensive product.

    Same-class pairing

    • Everyday production: Grok 4.3 ($1.25/$2.50) vs Sonnet 5 ($2/$10). Grok is cheaper, especially on output.
    • Flagship work: Grok 4.6 ($2/$6) vs Opus 5.5 ($4/$20). Grok still cheaper on list. (Legacy Opus 5 remains $5/$25.)
    • Top shelf: Grok has no $10/$50 public model. Fable 5.1 is 5x Grok 4.6 input and about 8x output.

    Worked example

    10M input + 2M output, no cache, short prompts:

    • Grok 4.6: $20 + $12 = $32
    • Sonnet 5: $20 + $20 = $40
    • Opus 5.5: $40 + $40 = $80
    • Opus 5 (legacy): $50 + $50 = $100
    • Fable 5.1: $100 + $100 = $200

    Batch: Claude 50% off on supported models. Grok 20% off on 4.3 / 4.20 only – not on 4.5 / 4.6.

    Rules that are not the rate card

    • Claude subscriptions use two clocks: a rolling 5-hour session and a weekly bucket. Claude Code’s temporary +50% weekly promo ended September 13, 2026 at 11:59 PM PT. Starting September 14, 2026, Help Center (article 15910845): weekly Claude Code limits are permanently 25% higher than the pre-promotion baseline for Pro, Max, Team, and seat-based Enterprise. The 5-hour window does not change.
    • Grok API doubles the request once the prompt hits 200k tokens. Current Claude Sonnet / Opus / Fable cards do not use that surcharge.
    • Cache is the only place Fable 5.1 looks cheap at the top. Reused prefixes at $0.25/MTok. Fresh prompts at $10/$50.

    When to buy which

    Buy Grok for volume, agents, or coding at $2/$6 where Grok 4.6 is enough.

    Buy Claude when the job needs Fable-class long horizon and you will pay for it – or when Sonnet 5 at $2/$10 is enough and the team already lives in Claude Code.

    Do not pick from the consumer sticker alone. A $20 Claude Pro seat that immediately burns Fable credits can cost more than a $30 SuperGrok seat that never leaves Grok 4.6.

    FAQ

    Is SuperGrok cheaper than Claude Pro?
    No on the monthly line: Pro is $20, SuperGrok is about $30. Yes on many API workloads, because Grok 4.6 undercuts current Claude flagship Opus 5.5 ($4/$20) and Fable 5.1 by a wide margin.

    Is Claude always more expensive on the API?
    No. Haiku 4.5 and Sonnet 5 sit near Grok Build / Grok 4.3. The Claude premium starts at Opus 5.5 ($4/$20; legacy Opus 5 $5/$25) and jumps again at Fable.

    Does Claude Pro include Fable 5.1?
    No. Credits from the first token. Included Fable is Max and premium seats, 50% of weekly limits. See Fable plan access.

    Related: Claude plan pricing · Grok vs Claude (capability comparison – older lineup) · Claude Code limits.


    If you run a restoration or multi-site operation and want the same kind of defensible, versioned standard for your Scope 3 emissions data, see the Restoration Carbon Protocol – the open framework that maps contractor emissions onto the GHG Protocol so commercial clients can actually verify them.