> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# How AIsa Works

> How authentication, endpoints, and billing work across models and data APIs.

AIsa sits between your agent or application and the upstream model and data providers. You authenticate once, send requests to an AIsa endpoint, and every call is billed against a single shared balance.

```mermaid theme={null}
flowchart LR
  A["Agent or app"] -->|"OAuth (MCP, CLI)<br/>or API key"| B["AIsa"]
  B --> M["Models<br/>api.aisa.one/v1"]
  B --> D["Data APIs<br/>api.aisa.one/apis/v1"]
  B --> L["One balance<br/>usage per call"]
```

## 1. Authenticate

| Connection method | Credential | How to get it |
| - | - | - |
| MCP (`https://mcp.aisa.one/mcp`) | Browser OAuth: approve once when prompted | Handled automatically by your MCP client |
| AIsa CLI | Browser OAuth via `aisa login`, or `AISA_API_KEY` for CI | Run `aisa login` in your terminal |
| Direct HTTP / SDKs | API key passed as `Authorization: Bearer $AISA_API_KEY` | Create in [Console → API Keys](https://console.aisa.one/api-keys) |

Every credential draws from the same account balance. See [Authentication](https://aisa.one/docs/guides/authentication.md) for key management and OAuth details.

## 2. Call an endpoint

| Surface | Base URL | What it's for |
| - | - | - |
| Models | `https://api.aisa.one/v1` | OpenAI Chat Completions, Responses, Anthropic Messages, embeddings, images, video |
| Gemini-compatible models | `https://api.aisa.one/v1beta` | Gemini `generateContent` format |
| Data APIs | `https://api.aisa.one/apis/v1` | Commerce, social, search and SEO, company, market, travel, and other data providers |
| MCP | `https://mcp.aisa.one/mcp` | AI agents: search the catalog and run tools through a single connector |

Endpoint definitions and parameters follow the [OpenAPI specification](https://aisa.one/openapi.yaml).

Through MCP, an agent uses a few meta tools instead of loading hundreds into its context: `search` and `list_categories` to discover tools, `get_details` to inspect inputs, `batch_quote` to price the exact calls, and `batch_use` to execute up to 20 of them.

## 3. Pay per use

* **One balance:** Models, data APIs, MCP calls, and the CLI all draw from the same prepaid wallet. Top up in [Console → Billing](https://console.aisa.one/billing).
* **Models** are billed per token (input, output, and cached tokens when reported by the provider).
* **Data APIs** are billed per request: either a fixed price per call, or metered by what the request consumes (results, rows, pages, or provider credits).
* **Discovery is free:** Browsing docs, listing models via `/v1/models`, and MCP discovery and quotes (`search`, `list_categories`, `get_details`, `batch_quote`) cost nothing. You only pay for executed calls.
* **Spend controls:** Set a spending limit on each key in the Console; that is the hard ceiling. On endpoints that declare maximum-price support, pass a maximum via `X-AISA-Max-Price-USD`: the gateway rejects the call before any provider is called if the estimate is higher. Over MCP, `batch_quote` shows the estimate before `batch_use` runs anything. Both check the estimate and do not cap the final charge. Model routes do not apply it; bound them with `max_tokens` and the key's limit.

Current rates are published at [aisa.one/models](https://aisa.one/models) and [aisa.one/api](https://aisa.one/api). For detailed billing rules, see [Billing & Credits](https://aisa.one/docs/guides/pricing.md). Selected data endpoints also accept per-request payment through the Machine Payments Protocol (MPP) without an API key; see [Machine Payments](https://aisa.one/docs/integrations/machine-payments.md).

## What AIsa handles vs. what you own

| AIsa handles | Your application owns |
| - | - |
| Single credential and billing across providers | User intent, authorization, and approving spend |
| Routing to the selected model or data provider | Business logic and application state |
| Normalized, documented endpoint contracts | Validating results before completing tasks |
| Usage metering and per-call cost reporting | Retry policies and idempotency for side effects |
| Machine-readable discovery (OpenAPI, Agent Card, `llms.txt`) | Secure storage of secrets and user data |

Treat state-changing operations (creating, updating, deleting data, or spending funds) with extra care: use scoped keys, require explicit user confirmation when needed, and avoid automatic retry loops on failed calls.

## When to use AIsa

AIsa is ideal when your agent or application needs multiple providers: mixing LLM reasoning with live data, switching between model families, or accessing multiple data sources without managing separate contracts.

If your workload only ever uses a single model provider and you already have an existing billing relationship with them, connecting to that provider directly may be simpler.

## Next steps

> [card] [Connect via MCP](https://aisa.one/docs/agent-quickstart.md)
>
> Set up AIsa for your agent in three quick steps.

> [card] [API Key & First Call](https://aisa.one/docs/guides/getting-started-with-aisa.md)
>
> Make your first request with curl.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.