fastapi_stripe

fastapi_stripe is a skill for Claude Code, Codex from iloveitaly/llm-ide-rules. It costs 9 tokens per session (869 once invoked), scanned A, original, MIT.

A FastAPI and Stripe Checkout example for taking online payments. It lays out the order steps from creating a checkout session through checking whether payment is complete.

In plain words
What is it for?
Use it when adding Stripe payments to a FastAPI application. It helps structure checkout sessions, pending orders, completed orders, and confirmation-page status checks.
Why use it?
Payment code can become inconsistent when checkout and order updates happen at different points. This gives those steps a clear sequence to follow.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when adding Stripe payments to a FastAPI application. It helps structure checkout sessions, pending orders, completed orders, and confirmation-page status checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iloveitaly/llm-ide-rules/fastapi_stripe
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 iloveitaly/llm-ide-rules --skill fastapi_stripe
Clone the repo
git clone --depth 1 https://github.com/iloveitaly/llm-ide-rules

Made for: Claude Code, Codex.

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 fastapi_stripe

README.md
[![agentmods](https://agentmods.dev/badge/skills/iloveitaly/llm-ide-rules/fastapi_stripe/github.svg)](https://agentmods.dev/skills/iloveitaly/llm-ide-rules/fastapi_stripe)
Your own site
<a href="https://agentmods.dev/skills/iloveitaly/llm-ide-rules/fastapi_stripe"><img src="https://agentmods.dev/badge/skills/iloveitaly/llm-ide-rules/fastapi_stripe/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 fastapi_stripe

Your own site · 80×15
<a href="https://agentmods.dev/skills/iloveitaly/llm-ide-rules/fastapi_stripe"><img src="https://agentmods.dev/badge/skills/iloveitaly/llm-ide-rules/fastapi_stripe.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 869 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00009 $0.00869
Opus 5 $0.00005 $0.00434
Sonnet 5 $0.00002 $0.00174
Haiku 4.5 $0.00001 $0.00087

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

Security

Grade A, and why

fastapi_stripe scanned grade A with 0 findings 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 10d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/fastapi_stripe/SKILL.md · 147 lines

How it starts

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

Fastapi_Stripe

A Stripe Checkout implementation takes four steps:

  1. Create a checkout session. Happens when the user visits the checkout page.
  2. Create a pending order. Happens right before the user is sent to Stripe.
  3. Complete the order. Happens when the user is redirected back to the app after payment.
  4. Check the order status. Happens when the user visits the confirmation page, which could happen multiple times.

Here's an example implementation:

from .configuration import stripe_client, origin_url


@screening_api_app.post("/")
def create_order_session(
    request: Request,
) -> str:
    """
    Creates a checkout session. This happens after the user visits
    the checkout page.
    """
    session = stripe_client.v1.checkout.sessions.create(
        params={
            "ui_mode": "custom",
            "line_items": [
                {
                    "price": "price_123",
                    "quantity": 1,
                }
            ],
            "mode": "payment",
            # CHECKOUT_SESSION_ID is a placeholder for the actual session id, which is replaced by Stripe
            # cannot use include_query_params because the Stripe checkout template variable is escaped
            "return_url": (
                # `request` required for abs URL generation
                str(request.url_for("complete_ticket_purchase"))
                + "?session_id={CHECKOUT_SESSION_ID}"
            ),
        }
    )

    return session.client_secret


class PendingOrderRequest(BaseModel):
    stripe_checkout_session_id: str

    email: str
    # and other fields...


@screening_api_app.post("/pending")
def create_pending_order(
    data: PendingOrderRequest,
    distribution: Distribution = Depends(get_distribution_by_host),
) -> TypeID:
    """
    Right before we pass off the user to Stripe, we save all order information.

    This can happen multiple times if there is a form submission error with Stripe.

    This pending step is in place largely because many payment methods require a redirect to a confirmation page,
    so we assume we'll always be redirected.

    The database schema ensures duplicate stripe checkout session ids never happen.
    """

    # let's validate the stripe checkout session id is real
    stripe_session = stripe_client.v1.checkout.sessions.retrieve(
        data.stripe_checkout_session_id
    )

    if stripe_session.status != "open":
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail="Your checkout session has expired. Please refresh the page and try again.",
        )

    order = Order.one_or_none(
        stripe_checkout_session_id=data.stripe_checkout_session_id
    )

    if order:
        order.email = data.email
        # ...and other fields...
        order.save()
    else:
        order = Order(
            stripe_checkout_session_id=data.stripe_checkout_session_id,
            email=data.email,
        ).save()

    return order.id


@screening_api_app.get("/complete")
def complete_ticket_purchase(
    request: Request,
    session_id: str = Query(),
):
    stripe_session = stripe_client.v1.checkout.sessions.retrieve(session_id)

    if stripe_session.status != "complete":
        raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)

    order = Order.one(stripe_checkout_session_id=session_id)

    order.status = OrderState.paid
    order.save()

    redirect_url = (
        f"{origin_url}/screening/{order.screening_id}/confirmation/{session_id}"
    )
    return RedirectResponse(url=redirect_url)


@screening_api_app.get("/confirmation")
def ticket_purchase_status(
    request: Request,
    stripe_checkout_session_id: str = Query(),
    screening_id: TypeID = Query(),
) -> str:
    stripe_client = distribution.stripe_client()
    stripe_session = stripe_client.v1.checkout.sessions.retrieve(
        stripe_checkout_session_id
    )

    if stripe_session.status != "complete":
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail="Checkout is not complete",
        )

    order = Order.one(stripe_checkout_session_id=stripe_checkout_session_id)
    return order.id


public_api_app.include_router(screening_api_app)

Read the full file on GitHub · 147 lines

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. 10d ago First seen · 147 lines · 9 tokens per session scan A 41605f9c9437

Subscribe to this mod's changes

fastapi_stripe is a skill published in the GitHub repository iloveitaly/llm-ide-rules (13 stars, last pushed 2d ago), licensed MIT. It adds 9 tokens to every session and 869 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-platform-prompt-management

Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.

aboalrejal-ai/skills · 55 tokens

buywhere-product-catalog

Use BuyWhere's MCP and API surfaces to add product search, price comparison, and deal discovery to AI shopping agents.

aboalrejal-ai/skills · 30 tokens

llm-application-dev-prompt-optimize

You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimizati.

aboalrejal-ai/skills · 44 tokens

arize-prompt-optimization

Optimizes, improves, and debugs LLM prompts using production trace data, evaluations, and annotations. Extracts prompts from spans, gathers performance signal, and runs a data-driven optimization loop using the ax CLI. Use when the user mentions optimize prompt, improve prompt, make AI respond better, improve output…

aboalrejal-ai/skills · 81 tokens

gemini-interactions-api

Use this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, streaming responses, background research tasks, function calling, structured output, or migrating from the old generateContent API. This skill covers the Interactions API, the…

aboalrejal-ai/skills · 77 tokens

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

aboalrejal-ai/skills · 47 tokens