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

# Use AIsa in Your Custom Agents

> Wire AIsa's models and MCP tools into an agent you're building yourself — any language, any framework.

Building your own agent instead of using an off-the-shelf runtime? AIsa integrates at two levels: an OpenAI-compatible (and Anthropic-compatible) model endpoint for inference, and an instruction file that equips your agent with AIsa's full capability layer.

AIsa endpoint:

```txt theme={null}
https://api.aisa.one/v1
```

## Prerequisites

Before you start, make sure you have:

* An AIsa API key ([console.aisa.one/api-keys](https://console.aisa.one/api-keys))
* An agent codebase using any language or framework compatible with the OpenAI or Anthropic API

## 1. Point your agent's LLM calls at AIsa

Store your API key in an environment variable:

```bash theme={null}
export AISA_API_KEY="sk-aisa-..."
```

```python Python (OpenAI SDK) theme={null}
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aisa.one/v1",
    api_key=os.environ["AISA_API_KEY"],
)

response = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[{"role": "user", "content": "Hello from my agent"}],
)
```

```ts TypeScript (OpenAI SDK) theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.aisa.one/v1",
  apiKey: process.env.AISA_API_KEY,
});

const response = await client.chat.completions.create({
  model: "kimi-k2.5",
  messages: [{ role: "user", content: "Hello from my agent" }],
});
```

```python Python (Anthropic SDK) theme={null}
import os

from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.aisa.one",  # no /v1 — the SDK appends /v1/messages
    api_key=os.environ["AISA_API_KEY"],
)

response = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello from my agent"}],
)
```

```bash curl theme={null}
curl https://api.aisa.one/v1/chat/completions \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k2.5",
    "messages": [{"role": "user", "content": "Hello from my agent"}]
  }'
```

The same API key provides access to every model in the [catalog](https://aisa.one/docs/guides/models.md) — simply change the `model` string to switch providers without needing additional SDKs or credentials. Agent frameworks (such as LangChain, the Vercel AI SDK, and LlamaIndex) work the same way: set their OpenAI-compatible base URL to `https://api.aisa.one/v1`.

## 2. Give your agent AIsa tools over MCP

If your framework includes an MCP client, connect it to the AIsa MCP server (Streamable HTTP):

```txt theme={null}
https://mcp.aisa.one/mcp
```

Select the authentication method that matches who the agent acts for:

* **OAuth (recommended when the agent acts on behalf of a signed-in user):** The server publishes standard OAuth metadata at `https://mcp.aisa.one/.well-known/oauth-protected-resource/mcp`, allowing an MCP client with OAuth support to manage browser sign-in and token storage.
* **API key (for a server-side agent you operate):** Pass `Authorization: Bearer $AISA_API_KEY` on every MCP request using the same key from step 1.

Your agent receives a few meta tools: `search` and `list_categories` to find operations, `get_details` (also served as `batch_get_schema`) to inspect operation schemas, `batch_quote` to price the exact calls without running them, and `batch_use` to run up to 20 calls. All but `batch_use` are free; `batch_use` is billed per call. `use` remains as a deprecated single-call form. No per-endpoint tool definitions are needed.

If your framework lacks an MCP client, call the [Data APIs](https://aisa.one/docs/resources/data-apis.md) directly over HTTP using the same key. In either setup, teach your agent AIsa's rules for quotes and approval by including `https://aisa.one/docs/agent-quickstart.md` in its system prompt.

Try it end to end:

```txt theme={null}
Use AIsa capabilities to search the web and summarize the latest information about AI agent frameworks.
```

## Quick reference

| Item | Value |
| - | - |
| OpenAI-compatible base URL | `https://api.aisa.one/v1` |
| Anthropic-compatible base URL | `https://api.aisa.one` (no `/v1`) |
| Auth header | `Authorization: Bearer sk-aisa-...` |
| MCP server | `https://mcp.aisa.one/mcp` (OAuth, or Bearer API key) |
| Agent instructions file | `https://aisa.one/docs/agent-quickstart.md` |

## Troubleshooting

| Problem | Fix |
| - | - |
| Authentication error (401) | Confirm the key is valid in the [dashboard](https://console.aisa.one) and sent as a Bearer token |
| 404 with the Anthropic SDK | Use `https://api.aisa.one` as the base URL — the SDK appends `/v1/messages` automatically |
| Model not found | Pass an exact model ID from the [catalog](https://aisa.one/docs/guides/models.md) |
| Framework ignores the base URL | Most frameworks read `OPENAI_BASE_URL` and `OPENAI_API_KEY` environment variables — set those to AIsa's values |
| Agent doesn't recognize AIsa capabilities | Connect the MCP server, or include `agent-quickstart.md` in its system prompt |
| MCP calls return 401 | Complete the OAuth sign-in flow, or send the API key as `Authorization: Bearer ...` |

## Related

> [card] [Agent Quickstart](https://aisa.one/docs/agent-quickstart.md)
>
> The agent-facing instruction file this tutorial builds on.

> [card] [Authentication](https://aisa.one/docs/guides/authentication.md)
>
> API key creation, rotation, and storage best practices.

> [card] [Model Catalog](https://aisa.one/docs/guides/models.md)
>
> Every model ID, context window, and endpoint your agent can call.


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