# Faro > Faro gives AI agents the tools and data they can't run on their own. One account, one Bearer token, one prepaid balance; run any skill through a unified gateway. Faro handles billing (prepaid credits) and upstream provider auth (publisher API keys are stored as Faro connections and forwarded as headers), so agents never sign up, pay, or manage credentials per provider. A single API call (email only, no password, no human) mints an account and a usable key, and self-hosted skills plus a monthly free-data allowance cost nothing. One account, one token, every tool. Browse Faro at https://askfaro.com/search. ## Start here - Onboard in one call: `POST https://api.askfaro.com/auth/agent-signup` with `{"email": "..."}` returns a ready-to-use API key. No password, no human in the loop. - [Quickstart](https://askfaro.com/llms/quickstart.md): minimal path from signup → first skill run. - [Buyer skill (agent recipe)](https://askfaro.com/llms/skill.md): the search → describe → run loop, with budget and verification guardrails. ## Discovery - [Tool search](https://askfaro.com/llms/search.md): how to find the right tool with semantic search. - Live search endpoint: https://api.askfaro.com/tools/search?q={query} - [Catalog map](https://askfaro.com/llms/catalog.md): a **progressive-context (pcx)** index of the whole catalog. It is a navigable, budget-aware tree you expand one branch at a time (category → namespace → skill), reading only what you open, so the entire catalog fits a tiny context window. Built for agents that prefer to *browse* rather than search, or that run in small / on-device windows. Leaves are **skills** (the unit you run), not raw tools. JSON manifest: https://api.askfaro.com/pcx/manifest?budget=4k. Pick `4k` for tight or on-device contexts, `32k` when you have headroom; the manifest self-describes its navigation protocol in its top-level `usage` field. The manifest changes only when the catalog is rebuilt, so it is **safe to cache**: the endpoint returns an `ETag` and honors `If-None-Match` with a `304`, so you can keep a local copy and revalidate cheaply (the askfaro SDK and CLI do this for you). Built with [askfaro-progressive-context](https://github.com/poolside-ventures/askfaro-progressive-context). - Browse skills (JSON): https://api.askfaro.com/catalog/public - Sitemap (all public skills): https://askfaro.com/sitemap.xml - Markdown mirrors for each skill live under https://askfaro.com/llms/skills/{skill}.md and https://askfaro.com/llms/skills/{skill}/{operation}.md ## Running skills - [Run a skill](https://askfaro.com/llms/run.md): the `POST https://skill.askfaro.com/skills/{id}/run` contract, auth, envelope, errors, budget ceilings. - [CLI](https://askfaro.com/llms/cli.md): `askfaro-cli`, search/describe and run skills from a shell. - OpenAPI spec: https://api.askfaro.com/openapi.json - Structured API guide (JSON): https://api.askfaro.com/docs/ ## Publishing - [Publisher guide](https://askfaro.com/llms/publish.md): list your MCP server on Faro. ## Full inlined version - [llms-full.txt](https://askfaro.com/llms-full.txt), everything above, inlined for one-shot ingestion. ## Pricing Free to start. Self-hosted tools and a monthly free-data allowance cost 0 credits (verify your email to unlock the full free data tier). Beyond that, 1,000 credits = $1.00 USD (1 credit = $0.001). Buyers prepay credits; publishers set per-tool pricing. Faro's margin is bundled into displayed prices. --- # Faro quickstart One Faro account gives your agent the tools and data it can't run on its own: no per-provider signups, payments, or API keys. One Bearer token, three steps: ## 1. Get an API key One call, email only, no password, no human: ``` POST https://api.askfaro.com/auth/agent-signup Content-Type: application/json {"email": "agent@yourdomain.com", "token_name": "my-agent"} ``` The response returns `api_key` (use it immediately) and `login_url` (hand to a human to manage billing and limits). The account starts unverified: self-hosted tools and a small free allowance work right away; clicking the verification email (or making any purchase) unlocks the full free data tier and paid tools. Re-send the link any time with `POST https://api.askfaro.com/auth/resend-verification`. Prefer a console, or already have an account? Sign up at https://askfaro.com/register (email + password), then mint keys with `POST https://api.askfaro.com/tokens/` (Bearer JWT from `POST https://api.askfaro.com/auth/login`). Or, in a shell: ``` pip install askfaro-cli askfaro auth login # paste the faro_ key ``` ## 2. Find a tool Semantic search across all active namespaces: ``` GET https://api.askfaro.com/tools/search?q=find+the+ceo+of+a+company ``` Each hit includes `namespace`, `name`, `input_schema`, and `pricing`. No second lookup needed. CLI equivalent: ``` askfaro search "find the ceo of a company" ``` ## 3. Run a skill A skill is the unit you run: hand it an intent, the hosted skill agent picks the underlying tools, runs them, enforces your budget, and bills you. ``` POST https://skill.askfaro.com/skills/{skill}/run Authorization: Bearer faro_ Content-Type: application/json {"intent": { "prompt": "a red bicycle" }} ``` CLI: ``` askfaro run "" ``` The response is the canonical envelope: the result, credits charged, and your remaining balance. ## What's next - [Skill recipe](https://askfaro.com/llms/skill.md), the loop an agent should follow. - [Run reference](https://askfaro.com/llms/run.md), the envelope, errors, budget ceilings, partner tokens. - [CLI reference](https://askfaro.com/llms/cli.md), every command. --- # Buyer agent skill (search → describe → run) This is the recipe an autonomous agent should follow when given a task that needs a tool it can't run itself. One Faro account covers every provider, so the agent never has to detour to sign up, pay, or fetch credentials for a new provider mid-task, and never needs a human in the loop after token issuance. ## Onboard (once) If you don't already have a key, mint one with a single call: `POST https://api.askfaro.com/auth/agent-signup` with `{"email": "..."}`. The response's `api_key` works immediately for self-hosted tools and a small free allowance. To reach external-data namespaces, the account's email must be verified (the signup email carries the link; hand `login_url` to a human, or call `POST https://api.askfaro.com/auth/resend-verification`). ## Loop 1. **Decide if you need a tool.** If the task is purely reasoning, don't shop. If it needs external action (fetch, scrape, generate, send), continue. 2. **Search, or browse.** Call `GET https://api.askfaro.com/tools/search?q={natural-language-query}` or `askfaro search ""`, using the user's intent verbatim; the index is semantic. If you'd rather *browse* the catalog (you're exploring what's available, or running in a small/on-device context window), fetch the navigable **progressive-context** [catalog map](https://askfaro.com/llms/catalog.md) instead: a tiny index you expand category → namespace → skill, seeing only what you open (the leaves are skills, the unit you run). It self-describes how to navigate it; the JSON manifest is at `https://api.askfaro.com/pcx/manifest?budget=4k` (use `32k` for larger context windows). 3. **Rank candidates.** Each result has `namespace/name`, `short_description`, `pricing`, and `input_schema`. Prefer (a) lowest credit cost that meets the requirement, (b) tools whose schema matches the data you have, (c) tools with `charge_on: success` over `attempt`. 4. **Inspect (optional).** If the search hit didn't include enough context, fetch `https://skill.askfaro.com/skills/{id}` for the skill's capability detail and cost estimate (never the recipe). The full structured guide is at `https://api.askfaro.com/docs/`. 5. **Check budget.** `GET https://api.askfaro.com/credits/balance` returns your remaining credits. Compare against the skill's published cost estimate; if it exceeds your budget, stop and surface the gap to your user. To enforce it server-side, send `max_credits` (a hard cap) on the run. 6. **Run.** `POST https://skill.askfaro.com/skills/{skill}/run` with `{"intent": {...}}`. The skill agent selects and runs the underlying tools and bills you. Add `confirm_above` to get a quote (`status: needs_input`) before crossing a soft ceiling, then re-run with the returned `continuation` token to proceed. 7. **Handle the envelope.** The run always returns HTTP 200 with a `SkillResult` envelope; read `status`. `success`: `result` holds the output plus `meta.credits_charged`. `needs_input`: a clarification or a budget quote, answer and re-run with the `continuation`. `failed`: `error.code` says why (`insufficient_credits`, `auth` for a verification/credential gate, `upstream_failed` which Faro auto-refunds, etc.). A missing or invalid token is the only HTTP error (401). ## Guardrails - **Pass-through pricing.** What you see is what you pay; Faro's margin is already bundled into the displayed price. - **One token, many tools.** Don't fetch per-publisher credentials. Faro forwards them server-side. - **Verification tiers.** Fresh accounts are unverified: self-hosted tools and a small free allowance work immediately; external-data namespaces return 403 until the email is verified (any purchase also counts). Verifying unlocks the free data tier; paid tools additionally need credits. - **Stable error codes.** 401 unauthorized, 402 insufficient credits, 403 verification required, 404 not found, 409 idempotency conflict, 502 upstream failure. - **Partner integrations.** If you're a partner platform invoking on behalf of an end user, use a `faro_partner_` token with the `X-Faro-User` header, usage is attributed to that user's balance. ## Minimal pseudocode ``` hits = GET /tools/search?q= // leaves are skills, the unit you run best = pick(hits, by=cost_then_match) balance = GET /credits/balance if best.estimated_credits > balance: stop result = POST https://skill.askfaro.com/skills/{best.skill}/run with {"intent": {...}} ``` --- # Tool search Faro's search is semantic over every public tool in every active namespace. Agents should pass natural-language queries verbatim from their user's intent. ## HTTP ``` GET https://api.askfaro.com/tools/search?q={query}&limit={n} ``` - `q`: natural-language query, e.g. `find+the+CEO+of+a+company` - `limit`: default 10, max 50 - No auth required for search. Each result: ```json { "namespace": "...", "name": "...", "short_description": "...", "input_schema": { ... }, "pricing": { "pricing_mode": "fixed_per_request", "fixed_credit_cost": 50, "charge_on": "success" } } ``` The `input_schema` is included in search results so you can run without a second round-trip. ## CLI ``` askfaro search "find the CEO of a company" ``` Outputs the same JSON when stdout is piped. ## Browse - All active skills (JSON): https://api.askfaro.com/catalog/public - Markdown skill mirror: https://askfaro.com/llms/skills/{skill}.md - Markdown sub-skill mirror: https://askfaro.com/llms/skills/{skill}/{operation}.md - Public sitemap: https://askfaro.com/sitemap.xml --- # Running a skill A skill is the unit you run. The hosted skill agent selects the underlying tools, runs them, enforces your budget, and bills you. One account, one token, one endpoint, every capability. ## Endpoint ``` POST https://skill.askfaro.com/skills/{skill}/run Authorization: Bearer faro_ Content-Type: application/json { "intent": { "prompt": "a red bicycle" }, // a prompt string wrapped, or a structured object "max_credits": 200, // optional hard cap; the run aborts rather than exceed it "confirm_above": 50, // optional soft ceiling; returns a quote instead of spending "continuation": "f1..." // optional; a signed token from a prior quote, to resume that plan } ``` Discover skill ids with `GET https://api.askfaro.com/tools/search?q={query}` (the leaves are skills) or the [catalog map](https://askfaro.com/llms/catalog.md). Inspect one with `GET https://skill.askfaro.com/skills/{skill}`. ## Auth Three token types are accepted: | Prefix | Use case | Extra headers | |---|---|---| | `faro_` | Personal / agent API key | (none) | | `` | Logged-in session | (none) | | `faro_partner_` | Partner platform running for an end user | `X-Faro-User: ` | Fastest key: `POST https://api.askfaro.com/auth/agent-signup` with `{"email": "..."}` returns a `faro_` key in one call (no password). Or create one from a session: `POST https://api.askfaro.com/tokens/` (requires a JWT from `POST https://api.askfaro.com/auth/login`). ## Verification & access tiers Skills are tiered by who may run them: - **unverified**: self-hosted skills (no external provider). Runnable by any account, including a fresh unverified one. - **verified**: free proxied external data. Requires a verified email. - **paid**: priced skills. Requires a verified email and credits. A new account starts unverified and may only run unverified skills; anything else fails with `error.code: auth`. Verify via the signup email or `POST https://api.askfaro.com/auth/resend-verification` (a completed purchase also counts). Partner traffic is funded and always treated as verified. ## Response The run always returns HTTP 200 with the canonical `SkillResult` envelope; `status` carries the outcome, so you integrate one handler: ```json { "faro_envelope": "1", "id": "…", // run id "skill": "image", "status": "success", // "success" | "failed" | "needs_input" "result": { // present when status is "success" "kind": "information", // "information" | "file" | "files" "summary": "…", "data": { ... }, // structured result (object) for kind "information" "sources": [{ "url": "…" }] // optional provenance (citations / source links) // kind "file": "file": { "download_url": "…", "mime": "…", "size_bytes": 0, "filename": "…" } }, "error": { // present when status is "failed" "code": "upstream_failed", // invalid_input | auth | rate_limited | insufficient_credits | not_found | timeout | upstream_failed | internal "message": "…", "retryable": true }, "needs_input": { // present when status is "needs_input" "question": "…", "missing": ["…"] }, "continuation": "f1…", // signed token; echo it back to resume a quote or paginate "meta": { "credits_charged": 50, // what this run cost you "credits_estimated": 50, "started_at": "…", "completed_at": "…" } } ``` `result.data` is always a JSON object. Faro's vendor cost and margin are never returned; `meta.credits_charged` is your price. ## Status & errors The HTTP status is 200 for every run except auth; read `status` and, on failure, `error.code`: | Where | Value | Meaning | |---|---|---| | HTTP | 401 | Missing or invalid token | | `status` | `needs_input` | A clarification, or a budget quote (crossed `confirm_above`). Re-run with the `continuation`. | | `error.code` | `auth` | Email not verified, or this skill needs a verified account. Verify, or call `POST https://api.askfaro.com/auth/resend-verification` | | `error.code` | `insufficient_credits` | Out of credits, call `POST /credits/purchase` | | `error.code` | `invalid_input` | The intent is missing a required field, or would exceed `max_credits` | | `error.code` | `not_found` | No such skill | | `error.code` | `upstream_failed` | The underlying tool failed; auto-refunded when priced `charge_on: success` | ## Budget ceilings - `max_credits`: a hard cap. A run whose worst-case cost would exceed it aborts with `invalid_input` rather than spending. - `confirm_above`: a soft ceiling. A run that would cross it stops at `status: needs_input` and returns a quote carrying a signed `continuation` token. Re-run with that token (and a high enough `max_credits`) to execute the pinned plan, so you never double-route or double-charge. ## Pricing modes - `fixed_per_request`: the skill charges a fixed credit cost per run. - `tool_returned`: the skill reports its cost in the response (e.g. token-based pricing for LLM skills). Free tier: self-hosted skills and skills flagged `free_tier` cost 0 credits within a monthly allowance (larger once verified), and run even at a $0 balance. Beyond the allowance the normal price applies. Otherwise 1,000 credits = $1.00 USD, and the price shown is what you pay end-to-end; Faro's margin is bundled in. ## See also - [CLI](https://askfaro.com/llms/cli.md) - OpenAPI spec: https://api.askfaro.com/openapi.json - Structured guide (JSON): https://api.askfaro.com/docs/ --- # askfaro-cli `askfaro-cli` is the official command-line client. It wraps every API endpoint, outputs JSON when stdout is piped (agent-friendly), and uses stable exit codes for errors. ## Install ``` pip install askfaro-cli ``` Or bootstrap with no install: ``` npx askfaro ``` ## Authenticate ``` askfaro auth login --email you@example.com # password prompt → mints + saves an API key askfaro auth login # paste an existing key ``` Credentials live at `~/.config/faro/credentials`. You can also set `FARO_API_KEY` in your environment, or pass `--api-key` per-call. API keys cannot mint other API keys; all key creation goes through the email+password flow. Use `askfaro tokens list` / `askfaro tokens revoke ` to manage existing keys. ## Buyer commands ``` askfaro search "" # semantic search; returns JSON askfaro describe / # full input_schema + pricing + curl askfaro run "" # run a skill: intent in, result out askfaro run --intent '' # structured intent echo '{"prompt":"..."}' | askfaro run # intent piped on stdin askfaro run "" --max-credits 200 --confirm-above 50 # budget ceilings ``` The skill agent selects the underlying tools, runs them, and bills your account. Raw vendor tools aren't directly runnable, by design: skills are the only surface, each one a brief over the tools it needs. Examples: ``` askfaro search "generate an image" askfaro run image "a red bicycle" askfaro run image "a red bicycle" --max-credits 200 ``` ## Account commands ``` askfaro doctor # check auth + publisher status + namespace health ``` ## Publisher commands ``` askfaro publisher register --display-name 'Acme' askfaro ns quick-setup --namespace acme --mcp-url https://mcp.acme.dev askfaro init acme # writes faro.yaml + README.md askfaro push --publish # save manifest + submit for review askfaro ns check acme # local validation askfaro pull acme # pull latest server state into faro.yaml faro diff # show local vs server diff ``` ## Output - TTY: pretty-printed. - Piped or `--json`: machine-readable JSON on stdout. - Errors: JSON envelope on stderr, stable exit codes (`EXIT_AUTH`, `EXIT_VALIDATION`, `EXIT_NOT_FOUND`, `EXIT_API`, `EXIT_NETWORK`). ## Why CLI for agents `askfaro search` returns each result with its `input_schema` already attached, so an agent can search → run in two shell calls. No second describe round-trip required unless you need long_description or examples. ## Source - npm bootstrap: https://askfaro.com/cli (npx askfaro) - PyPI: `askfaro-cli` --- # Publishing on Faro Faro fronts your existing MCP server with auth, billing, and discovery. You bring the server; Faro brings the buyers. ## What you ship - An MCP-compatible HTTP endpoint (`https://mcp.yourdomain.com`) implementing the tools you want to monetize. - A `faro.yaml` manifest declaring the namespace, listing copy, tools, and pricing. ## Path ``` pip install askfaro-cli askfaro auth login askfaro publisher register --display-name 'Acme' askfaro ns quick-setup --namespace acme --mcp-url https://mcp.acme.dev askfaro init acme # generates faro.yaml + README.md $EDITOR faro.yaml # description, tags, example_prompts, pricing askfaro ns check acme # local validation askfaro push --publish # save + submit for review ``` ## Pricing Set `pricing_mode: fixed_per_request` with a credit cost per tool group, or `tool_returned` to let your tool report its own cost (token-priced tools, etc.). 1,000 credits = $1.00 USD. Faro's margin is bundled into the price the buyer sees. Don't reference your gross or our cut in user-facing copy. ## Upstream auth Buyer-side, every request to Faro carries a single `faro_` Bearer. Faro forwards your upstream credentials (stored once as a Faro `connection`) as headers when proxying to your MCP server. Buyers never see them. ## Reviews Every listing goes through a human review before going public. Use `askfaro ns check` first. It flags missing copy, broken schemas, and obvious smoke-test failures. ## Reference - Full publisher API docs: https://api.askfaro.com/docs/ - CLI reference: https://askfaro.com/llms/cli.md - Browse: https://askfaro.com/search