Metadata-Version: 2.5
Name: cracked-ai-pydantic-ai
Version: 0.1.0
Summary: Pydantic AI tools for Cracked, the agent tool router: load_cracked_tools() gives an agent 67,000+ tools behind one key, priced per call.
Project-URL: Homepage, https://cracked.ai
Project-URL: Documentation, https://cracked.ai/docs/integrations
Project-URL: Changelog, https://cracked.ai/changelog
Author-email: Cracked Engineering <support@cracked.ai>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,api,cracked,llm,mcp,pydantic-ai,pydanticai,scraping,tool-router,tools
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: pydantic-ai-slim>=1.0
Requires-Dist: pydantic>=2
Description-Content-Type: text/markdown

# cracked-ai-pydantic-ai

Pydantic AI tools for [Cracked](https://cracked.ai), the tool router for AI agents: one API key, 67,000+ tools
(web search, scrapers, social profiles, enrichment, media models) with measured health and a real price per call.

`load_cracked_tools()` turns every Cracked capability into a native Pydantic AI `Tool`, built at runtime from
`GET https://cracked.ai/v1/capabilities/tools?format=openai` via `Tool.from_schema()`. Runs go through `POST /v1/run`;
each result carries the run permalink, status and cost.

```bash
pip install cracked-ai-pydantic-ai pydantic-ai
```

```python
import os
from pydantic_ai import Agent
from cracked_ai_pydantic_ai import load_cracked_tools

tools = load_cracked_tools(api_key=os.environ["CRACKED_API_KEY"], capabilities=["web-search", "weather-forecast"])
agent = Agent("openai:gpt-4o-mini", tools=tools, instructions="Use the tools; cite the run url.")
print(agent.run_sync("What is the weather in Austin this weekend?").output)
# Each tool call returns {"run": {"runId", "status", "url", "costUsd", "durationMs"}, "output": ...}
```

Options: `capabilities` (ids, dashes or underscores), `set="top"|"all"`, `base_url`, `timeout`, `max_output_chars`.
Every tool returns `{"run": {"runId", "status", "url", "costUsd", "durationMs"}, "output": ...}`; API errors come back as
`{"error", "status", "message"}` so the model can read them.

## Pricing

There is no subscription: each run is billed per call from your workspace balance. The price is shown on every
tool page (https://cracked.ai/tools) and inside each tool description your model sees (`Price: from $.../call ...`).
`run.costUsd` in every result is what that call actually cost. Full list: https://cracked.ai/capabilities and https://cracked.ai/pricing.

## Keys, trial credit and referrals

- Humans: https://cracked.ai/app/keys.
- Agents can self-register without a human: `POST https://cracked.ai/v1/agents/register {"name": "my-agent"}` returns an
  `apiKey` (shown once, with $1 of trial credit) and a `claimUrl` to hand to your human; claiming adds credit and enables top-ups.
- Every workspace that signs up through your referral link (`GET https://cracked.ai/v1/referrals`) earns your workspace $5 of credit.
- Try a tool with no key or install: `npx cracked-ai try "weather in austin"`.

Docs: https://cracked.ai/docs/integrations. Support: support@cracked.ai. MIT.
