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

# OpenAI API - 通过 AIsa 访问 GPT、图像和 Embedding 模型

> OpenAI 模型 ID 和端点指南：通过 OpenAI 兼容路由调用 GPT 文本模型、GPT Image 图像模型和文本 Embedding 模型。

AIsa 用一个 API Key 接入 OpenAI 的 GPT 文本模型、GPT Image 图像模型和文本 Embedding 模型。OpenAI SDK 只需把 base URL 设为 `https://api.aisa.one/v1` 即可使用。

GPT 文本模型使用 `POST /v1/chat/completions` 和 `POST /v1/responses`。GPT Image 模型使用 `POST /v1/images/generations` 和 `POST /v1/images/edits`，Embedding 模型使用 `POST /v1/embeddings`。下表列出每个模型可用的端点。

## 支持的 OpenAI 模型

| 模型 ID | 类型 | 端点 |
| - | - | - |
| `gpt-4.1-mini` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-4o` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-4o-mini` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5-nano` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5-pro` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5-search-api` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.1` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.2` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.2-pro` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.3-codex` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.4` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.4-mini` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.4-nano` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.4-pro` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.5` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.5-pro` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.6-luna` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.6-sol` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-5.6-terra` | 文本 | `/v1/chat/completions`、`/v1/responses` |
| `gpt-6-astra` | 文本 | `/v1/chat/completions`、`/v1/messages`、`/v1/responses` |
| `gpt-6-luna` | 文本 | `/v1/chat/completions`、`/v1/messages`、`/v1/responses` |
| `gpt-6-sol` | 文本 | `/v1/chat/completions`、`/v1/messages`、`/v1/responses` |
| `gpt-6.1-sol` | 文本 | `/v1/chat/completions`、`/v1/messages`、`/v1/responses` |
| `gpt-6.1-terra` | 文本 | `/v1/chat/completions`、`/v1/messages`、`/v1/responses` |
| `gpt-image-2` | 图像 | `/v1/images/generations`、`/v1/images/edits` |
| `gpt-image-2.5-flare` | 图像 | `/v1/images/generations`、`/v1/images/edits` |
| `gpt-image-2.5-sunburst` | 图像 | `/v1/images/generations`、`/v1/images/edits` |
| `gpt-image-2.6-flare` | 图像 | `/v1/images/generations`、`/v1/images/edits` |
| `gpt-image-2.6-sunburst` | 图像 | `/v1/images/generations`、`/v1/images/edits` |
| `gpt-realtime-2.1` | 文本 | — |
| `text-embedding-3-large` | Embedding | `/v1/embeddings` |
| `text-embedding-3-small` | Embedding | `/v1/embeddings` |

这些模型的当前价格见 [aisa.one/models](https://aisa.one/models)。

## 快速开始

```python theme={null}
import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Summarize the trade-offs of this database schema."}],
)
print(response.choices[0].message.content)
```

图像和 Embedding 的用法见[生成图像](https://aisa.one/docs/zh/api-reference/chat/post_images-generations.md)和[Embeddings](https://aisa.one/docs/zh/api-reference/embeddings/post_embeddings-create.md)。

## 下一步

* [OpenAI / Anthropic SDK](https://aisa.one/docs/zh/get-started/sdk-compatibility.md)
* [模型目录](https://aisa.one/docs/zh/guides/models.md)
* [AI 模型价格](https://aisa.one/docs/zh/guides/pricing.md#模型)


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