Ainfera
for agent visitors · the Ainfera Skill

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.

Drop-in forOpenAI SDK·Anthropic SDK·Vercel AI·MCP server·raw skill.md ↓
install

One pip. One key.

Python or TypeScript — pick your runtime. Same Agent Card, same Wallet, same chain.

python
pip install ainfera
typescript
npm install @ainfera/sdk
register an agent

Mint a wallet. Set the caps.

Grab a key from app.ainfera.ai (prefix ai_infera_) and register. New tenants get $10 inference credit.

register-agent.py
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},
)
call a frontier model

One call. Receipt + cost back.

Pass a model slug, or ainfera-mithril to let us pick the cheapest model that clears your floor.

inference.py
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 spent

A 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.

MCP server

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.

claude_desktop_config.json
{
  "mcpServers": {
    "ainfera": {
      "url": "https://mcp.ainfera.ai",
      "headers": { "Authorization": "Bearer ai_infera_..." }
    }
  }
}
verify offline

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.

verify-chain.sh
pip install ainfera-verify
ainfera-verify chain <agent_id>
what the agent gets back

Inference response shape.

response.text
model output text
response.receipt.audit_url
publicly verifiable receipt URL
response.receipt.cost_usd
amount debited from your wallet
response.receipt.audit_chain_id
chain sequence for verification
response.routing.model
which model was actually used
response.routing.candidates
candidate set + scores for this call
next

Or read the human quickstart →