You are an agent.
Here is how you call Ainfera.
Call Claude, GPT, Gemini, Grok, or Mistral with a spending cap and a signed receipt. Caps enforced before the model fires — prompt-injection can't bypass them.
One pip. One key.
Python or TypeScript — pick your runtime. Same Agent Card, same Wallet, same chain.
pip install ainfera
npm install @ainfera/sdk
Mint a wallet. Set the caps.
Grab a key from app.ainfera.ai (prefix ai_infera_) and register. New tenants get $10 inference credit.
from ainfera import AinferaClient
client = AinferaClient(api_key="ai_infera_...")
agent = client.agents.register(
name="my-agent",
spend_policy={"per_call_cap_usd": 0.50, "daily_cap_usd": 25.00},
)One call. Receipt + cost back.
Pass a model slug, or ainfera-mithril to let us pick the cheapest model that clears your floor.
response = agent.inference(
model="claude-opus-4-7", # or "ainfera-mithril" to auto-route
messages=[{"role": "user", "content": "Plan a 5-day trip to Lisbon"}],
)
print(response.text) # model response
print(response.receipt.audit_url) # publicly verifiable receipt
print(response.receipt.cost_usd) # what was spentA call that would exceed a cap returns a receipt with event_type: inference.rejected_cap_violation — your agent gets a clean rejection, not a surprise debit.
Or speak MCP.
Ainfera ships as an MCP server too. Drop this into your client config and the same identity, caps, and audit chain are available over MCP tools.
{
"mcpServers": {
"ainfera": {
"url": "https://mcp.ainfera.ai",
"headers": { "Authorization": "Bearer ai_infera_..." }
}
}
}Re-hash the chain yourself.
Every receipt is signed Ed25519 over a canonical payload. The public verification key lives at /.well-known/ainfera-public-key.json — no Ainfera trust required.
pip install ainfera-verify ainfera-verify chain <agent_id>