> ## 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

# Agent Discovery – Let Autonomous Agents Find and Use AIsa

> Integrate autonomous agents with AIsa using the A2A Agent Card, MCP manifest, OpenAI plugin manifest, OpenAPI 3.1 spec, and llms.txt resources.

AIsa publishes several machine-readable discovery resources so that autonomous agents can find, understand, and invoke supported capabilities. This guide explains these resources and the end-to-end discovery-to-invocation flow. The rules an agent follows (how to connect, verify, quote, approve spending, and handle errors) live in one place, the [agent setup guide](https://aisa.one/llms.txt); this page only points at it.

## Discovery Endpoints

AIsa exposes the following public URLs for agent and documentation discovery. They require no authentication to read.

| Endpoint | Protocol | URL | Purpose |
| :- | :- | :- | :- |
| **Agent Card** | Google A2A | `https://aisa.one/.well-known/agent-card.json` | High-level capabilities with metadata, tags, examples, and I/O modes |
| **AI Plugin** | OpenAI Plugin (v1) | `https://aisa.one/.well-known/ai-plugin.json` | Backward compatibility with ChatGPT-era agent tooling |
| **MCP Server** | MCP (Streamable HTTP, OAuth) | `https://mcp.aisa.one/mcp` | The primary endpoint agents connect to, signed in with browser OAuth (clients without a browser send `Authorization: Bearer $AISA_API_KEY` instead). Exposes a few meta tools (`search`, `list_categories`, `batch_get_schema` / `get_details`, `batch_quote`, `batch_use`, `use`, `account`) across the entire catalog. See [Connect via MCP](https://aisa.one/docs/agent-quickstart.md) |
| **MCP Catalog** | Live MCP inventory | `https://mcp.aisa.one/servers` | JSON generated per request by the running MCP service: `serverCount`, `toolCount`, the root and category `entrypoints`, the `modules`, and one record per provider server (`slug`, `docsRef`, `documentHashes`, tool count) plus the loaded `contract` provenance. Counts only: tool names and schemas come from `tools/list` on each endpoint. For listing; connect to `https://mcp.aisa.one/mcp` |
| **OpenAPI Spec** | OpenAPI 3.1.0 | `https://aisa.one/openapi.yaml` | Machine-readable request and response contracts |
| **MPP Payment Discovery** | OpenAPI 3.1 + `x-payment-info` | `https://api.aisa.one/openapi.json` | Endpoints that accept [machine payments](https://aisa.one/docs/integrations/machine-payments.md) without an API key |
| **Agent setup guide** | llms.txt | `https://aisa.one/llms.txt` | The single rule source for agents: how to connect, verify, use the MCP tools, approve spending, and handle errors |
| **Technical llms.txt** | llms.txt | `https://aisa.one/docs/llms.txt` | Index of this documentation; any page is available as Markdown by appending `.md` to its URL |

## How Agent Discovery Works

The discovery flow follows four steps: **discover**, **connect**, **inspect**, and **invoke**. An autonomous agent starts by reading the agent setup guide and the agent card to learn what AIsa can do, connects over MCP, inspects the exact tool contracts, and invokes quoted calls. Direct HTTP with an API key is the documented fallback for code that cannot speak MCP.

**1. Discover**

The agent reads the [agent setup guide](https://aisa.one/llms.txt) and fetches `/.well-known/agent-card.json` from `aisa.one`. The card contains a list of skills, each with an `id`, `name`, `description`, `tags`, and `examples`. The agent uses this metadata to determine whether AIsa can fulfill the current task.

**2. Connect (MCP + OAuth, the primary flow)**

The agent adds `https://mcp.aisa.one/mcp` as a remote MCP server and signs in with browser OAuth; there is no key to paste. Clients without a browser send `Authorization: Bearer $AISA_API_KEY` in the MCP config instead. It then verifies the connection with one free protected call: the `account` operation (or `use` with `{"operation_id": "account"}`). A tool list or a `401` does not count. See [Connect via MCP](https://aisa.one/docs/agent-quickstart.md).

**3. Inspect**

Over MCP, `search` returns candidate tools with their exact name, arguments schema, and list price, and `batch_get_schema` (also served as `get_details`) returns the full contract for up to 20 tools. The HTTP fallback fetches `/openapi.yaml` instead: parameter types, required fields, authentication requirements, and declared pricing.

**4. Invoke**

Over MCP, the agent prices the exact calls with `batch_quote` and runs them with `batch_use`, following the [spending rule in the agent setup guide](https://aisa.one/llms.txt) (auto-run when the quote reports `auto_execute_eligible: true`, otherwise one approval message with the quoted total). The HTTP fallback sends the request to `api.aisa.one` with `Authorization: Bearer $AISA_API_KEY` and follows the stricter [direct HTTP rule](https://aisa.one/docs/get-started/cli.md#direct-http-fallback); selected read-only endpoints also accept [MPP payment](https://aisa.one/docs/integrations/machine-payments.md) instead of a key.

## The A2A Agent Card

The [Agent2Agent (A2A) Protocol](https://a2a-protocol.org/latest/) defines a standard format for agents to advertise capabilities and interoperate. AIsa's agent card lives at the well-known URL and describes the platform, authentication requirements, and public capability catalog.

### Fetching the Agent Card

```bash curl theme={null}
curl -s https://aisa.one/.well-known/agent-card.json | jq .
```

```python Python theme={null}
import requests

card = requests.get("https://aisa.one/.well-known/agent-card.json").json()
print(f"Agent: {card['name']} — {card['description']}")
print(f"Skills: {len(card['skills'])}")
for skill in card["skills"]:
    print(f"  • {skill['id']}: {skill['name']}")
```

```typescript TypeScript theme={null}
const res = await fetch("https://aisa.one/.well-known/agent-card.json");
const card = await res.json();
console.log(`Agent: ${card.name} — ${card.description}`);
console.log(`Skills: ${card.skills.length}`);
card.skills.forEach((s: any) => console.log(`  • ${s.id}: ${s.name}`));
```

### Agent Card Structure

The top-level fields describe the agent identity, authentication, and capabilities:

| Field | Type | Description |
| :- | :- | :- |
| `name` | string | Agent name — `"AIsa"` |
| `description` | string | One-line summary of the agent's purpose |
| `url` | string | Base URL for API requests — `https://api.aisa.one` |
| `provider` | object | Organization name and website |
| `version` | string | Semantic version of the agent card |
| `documentationUrl` | string | Link to human-readable documentation |
| `capabilities` | object | Feature flags — streaming, push notifications, state history |
| `authentication` | object | Supported authentication schemes and credential instructions |

### Skill Objects

Each entry in the `skills` array describes a single capability:

| Field | Type | Description |
| :- | :- | :- |
| `id` | string | Unique skill identifier (e.g., `chat-completions`, `twitter-autopilot`) |
| `name` | string | Human-readable skill name |
| `description` | string | What the skill does and what data it provides |
| `tags` | string\[] | Searchable tags for filtering and matching |
| `examples` | string\[] | Natural-language example queries the skill can handle |
| `inputModes` | string\[] | Accepted content types (defaults to `application/json`) |
| `outputModes` | string\[] | Response content types (e.g., `application/json`, `text/event-stream`) |

### Available capabilities

The Agent Card is generated from the public catalog. Fetch the live card instead of relying on a fixed capability list in documentation:

```bash theme={null}
curl -s https://aisa.one/.well-known/agent-card.json \
  | jq -r '.skills[] | [.id, .name, (.tags // [] | join(","))] | @tsv'
```

Use each capability's `description`, `tags`, and `examples` for matching. Confirm the underlying Skill or API documentation before invocation.

## The OpenAI Plugin Manifest

For backward compatibility with agent frameworks that implement the original ChatGPT plugin protocol, AIsa also publishes an `ai-plugin.json` manifest at `/.well-known/ai-plugin.json`. The manifest references the same OpenAPI spec. For current OpenAI tool integration guidance, see [Actions](https://platform.openai.com/docs/actions).

```bash theme={null}
curl -s https://aisa.one/.well-known/ai-plugin.json | jq .
```

The manifest includes a `description_for_model` field that lists key API endpoints, helping LLM-based agents understand which tools are available without parsing the full OpenAPI spec.

## The OpenAPI 3.1 Specification

The consolidated OpenAPI spec at `/openapi.yaml` is the authoritative machine-readable contract for constructing API requests. Parse the live specification instead of relying on a fixed path or schema count.

### Fetching and Parsing the Spec

```python Python theme={null}
import yaml, requests

spec = yaml.safe_load(requests.get("https://aisa.one/openapi.yaml").text)
paths = list(spec["paths"].keys())
print(f"Total endpoints: {len(paths)}")
print(f"First 5: {paths[:5]}")
```

```typescript TypeScript theme={null}
import YAML from "yaml";

const res = await fetch("https://aisa.one/openapi.yaml");
const spec = YAML.parse(await res.text());
const paths = Object.keys(spec.paths);
console.log(`Total endpoints: ${paths.length}`);
```

```bash curl theme={null}
curl -s https://aisa.one/openapi.yaml | head -50
```

### API Categories

The spec organizes endpoints into the following tag groups:

| Category | Example Endpoints | Description |
| :- | :- | :- |
| AI Models | `/v1/chat/completions`, `/v1/models` | Live LLM and media model catalog, OpenAI-compatible chat routes |
| Twitter/X | `/apis/v1/twitter/tweet/advanced_search` | Profile, timeline, search, posting |
| Financial Data | `/apis/v1/financial/prices`, `/apis/v1/financial/sec-filings` | Equities, SEC, earnings, screening |
| Web & News Search | `/apis/v1/tavily/search`, `/apis/v1/search/smart` | Multi-source and Tavily search |
| Prediction Markets | `/apis/v1/polymarket/events`, `/apis/v1/kalshi/markets` | Polymarket and Kalshi data |
| Crypto Data | `/apis/v1/coingecko/simple/price` | CoinGecko market data |
| Image Generation | `/v1/images/generations` | GPT, Seedream, Wan, and other image-capable routes |
| YouTube Search | `/apis/v1/youtube/search` | YouTube SERP |
| Scholar Search | `/apis/v1/scholar/search/scholar` | Academic paper search |

## End-to-End Integration Example (HTTP fallback)

Agents that can speak MCP follow the connect, inspect, and invoke steps above with the `search`, `batch_get_schema`, `batch_quote`, and `batch_use` tools. The following Python example is the HTTP fallback for code that cannot: the agent discovers AIsa's capabilities, identifies the `chat-completions` skill, and makes an authenticated API call. Before a paid call, apply the [approval rule in the agent setup guide](https://aisa.one/llms.txt) and the [direct HTTP rule](https://aisa.one/docs/get-started/cli.md#direct-http-fallback).

```python theme={null}
import requests

# Step 1: Discover — fetch the agent card
card = requests.get("https://aisa.one/.well-known/agent-card.json").json()

# Step 2: Find a skill by tag
target_tag = "llm"
matching = [s for s in card["skills"] if target_tag in s.get("tags", [])]
if not matching:
    raise RuntimeError(f"No skill found with tag '{target_tag}'")

skill = matching[0]
print(f"Selected skill: {skill['name']} ({skill['id']})")

# Step 3: Invoke — call the API using the base URL from the card
response = requests.post(
    f"{card['url']}/v1/chat/completions",
    headers={
        "Authorization": "Bearer YOUR_AISA_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "gpt-5.4-mini",
        "messages": [
            {"role": "user", "content": "Summarize the A2A protocol in two sentences."}
        ],
    },
)

result = response.json()
print(result["choices"][0]["message"]["content"])
```

## Authentication

Agents connected through MCP authenticate with browser OAuth, so there is no key to handle; clients without a browser set `Authorization: Bearer $AISA_API_KEY` in the MCP config. The HTTP fallback uses the same Bearer token on every request to `api.aisa.one`:

```
Authorization: Bearer YOUR_AISA_API_KEY
```

Selected read-only endpoints accept [MPP payment](https://aisa.one/docs/integrations/machine-payments.md) instead of a key. A successful `GET /v1/models` is only a transport check; it does not prove authenticated business access. Verify with a free protected call (`account` over MCP, `aisa balance` with the CLI).

Generate an API key from the AIsa console. For detailed key management guidance — scoping, rotation, and secure storage — see the [Authentication](https://aisa.one/docs/guides/authentication.md) guide.

> [!WARNING]
>
> The discovery resources (`agent-card.json`, `ai-plugin.json`, `openapi.yaml`, `/servers`, and the llms.txt files) are publicly readable and require no authentication. API calls to `api.aisa.one` require the authentication documented for the selected route.

## Integration Patterns

### Pattern 1: Tag-Based Skill Matching

Agents can match tasks to skills using the `tags` array. This is the recommended approach for agents that need to dynamically select capabilities at runtime.

```python theme={null}
def find_skills_by_tags(card, required_tags):
    """Return skills that match ALL required tags."""
    return [
        skill for skill in card["skills"]
        if all(tag in skill.get("tags", []) for tag in required_tags)
    ]

# Find skills for financial research
finance_skills = find_skills_by_tags(card, ["finance", "stocks"])
# Returns: [MarketPulse Financial Data]
```

### Pattern 2: Example-Based Intent Matching

For LLM-powered agents, the `examples` field provides natural-language queries that can be used for semantic similarity matching against the user's intent.

```python theme={null}
# Collect all examples with their skill IDs
example_index = []
for skill in card["skills"]:
    for example in skill.get("examples", []):
        example_index.append({"text": example, "skill_id": skill["id"]})

# Use an embedding model to find the closest match to the user's query
# user_query = "What's the stock price of Apple?"
# → Matches MarketPulse skill via "Get the current stock price for AAPL"
```

## Interactive Explorer

AIsa provides two browser-based tools for exploring the discovery surface:

* **[API Explorer](https://aisa.one/api-explorer)** — Interactive API reference for browsing documented endpoints and request/response examples.
* **[Agent Discovery](https://aisa.one/agent-discovery)** — Visual skill explorer with search and tag filtering, plus integration code examples.

## CORS Support

The discovery endpoints include permissive CORS headers (`Access-Control-Allow-Origin: *`) so that browser-based agents and web applications can fetch them directly without a proxy server. This applies to:

* `/.well-known/agent-card.json`
* `/.well-known/ai-plugin.json`
* `/openapi.yaml`

## Related

> [card] [Authentication](https://aisa.one/docs/guides/authentication.md)
>
> API key generation, scoping, rotation, and secure storage.

> [card] [Agent Skills](https://aisa.one/docs/agent-skills.md)
>
> Browse and install composable skills for Claude Code, Cursor, and OpenClaw.

> [card] [Getting Started](https://aisa.one/docs/guides/getting-started-with-aisa.md)
>
> Make your first authenticated API request in minutes.


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