> ## Documentation Index
> Fetch the complete documentation index at: https://shinydapps-bd9fa40b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# System Prompt Snippet

> अपने एजेंट के सिस्टम प्रॉम्प्ट में l402-kit जोड़ें ताकि वह स्वायत्त रूप से APIs के लिए भुगतान कर सके।

## कॉपी-पेस्ट स्निपेट

स्वायत्त L402 भुगतान सक्षम करने के लिए इसे किसी भी एजेंट के सिस्टम प्रॉम्प्ट में जोड़ें:

```
You have access to paid APIs via the L402 protocol.
When you call an API that returns HTTP 402, use the L402Client from l402-kit
to pay automatically with Bitcoin Lightning.
Budget limit: {BUDGET_SATS} sats per session. Never exceed this limit.
Report spending at the end of each session.
```

`{BUDGET_SATS}` को अपने सेशन बजट से बदलें (उदाहरण के लिए `1000` लगभग \~\$0.50 के लिए)।

***

## LangChain

```python theme={null}
from langchain.agents import AgentExecutor
from l402kit import L402Client
from l402kit.langchain import L402Tool

wallet = BlinkWallet(api_key=os.environ["BLINK_API_KEY"])
client = L402Client(wallet=wallet, budget_sats=1000)

tools = [L402Tool(client=client, name="paid_api")]

system = """You have access to paid APIs via the L402 protocol.
Budget: 1000 sats per session. Use the paid_api tool when you need data."""

agent = AgentExecutor(agent=..., tools=tools, system_message=system)
```

***

## OpenAI Agents SDK

```python theme={null}
from agents import Agent, Runner
from l402kit import L402Client
from l402kit.wallets import BlinkWallet

wallet = BlinkWallet(api_key=os.environ["BLINK_API_KEY"])
client = L402Client(wallet=wallet, budget_sats=1000)

agent = Agent(
    name="DataFetcher",
    instructions="""You have access to paid APIs via the L402 protocol.
    When an API returns 402, call pay_and_fetch() with the URL.
    Budget: 1000 sats per session.""",
    tools=[client.as_openai_tool("pay_and_fetch")]
)
```

***

## CrewAI

```python theme={null}
from crewai import Agent, Task, Crew
from l402kit import L402Client

client = L402Client(wallet=wallet, budget_sats=500)

researcher = Agent(
    role="API Researcher",
    goal="Fetch data from paid APIs autonomously",
    backstory="""You can access paid APIs using Bitcoin Lightning micropayments.
    When you encounter a 402 response, pay with the l402_fetch tool.
    Budget: 500 sats.""",
    tools=[client.as_crewai_tool()]
)
```

***

## Vercel AI SDK

```typescript theme={null}
import { l402Client } from "l402-kit/agent";
import { tool } from "ai";

const client = l402Client({ wallet: blinkWallet, budgetSats: 1000 });

const systemPrompt = `You have access to paid APIs via the L402 protocol.
When you need data from a paid source, use the fetchPaid tool.
Budget: 1000 sats per session.`;

const tools = {
  fetchPaid: tool({
    description: "Fetch data from an L402-protected API",
    parameters: z.object({ url: z.string() }),
    execute: async ({ url }) => client.fetch(url),
  }),
};
```

***

## सुझाव

* `budgetSats` को सावधानी से सेट करें — एजेंट तेज़ी से कॉल जमा कर सकते हैं
* सेशन के अंत में उपयोग लॉग करने के लिए `spendingReport()` का उपयोग करें
* प्रोडक्शन के लिए, प्रति-उपयोगकर्ता सीमाओं के साथ [BudgetManager](/agent/budget) का उपयोग करें
