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

# 通过 cURL 使用咏唱引擎 API

> 可复制粘贴的 cURL 示例：登录、API 密钥管理、模型下载、钱包充值与发票下载。

每个咏唱引擎 REST 接口都能通过 `curl` 调用。本页汇总你最常用的示例。将 `eyJhbGciOi...` 替换为你的会话 JWT，将 `bfvk-XXXXXXXXXXXXXXXX` 替换为你的 API 密钥。

## 登录

```bash theme={null}
curl -X POST https://ariacompute.cn/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"identifier": "you@example.com", "password": "..."}'
```

## 获取当前用户

```bash theme={null}
curl -H "Authorization: Bearer eyJhbGciOi..." \
  https://ariacompute.cn/api/auth/me
```

## 创建 API 密钥

```bash theme={null}
curl -X POST https://ariacompute.cn/api/api-keys \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{"name": "production"}'
```

## 下载模型包

```bash theme={null}
curl -L -H "Authorization: Bearer bfvk-XXXXXXXXXXXXXXXX" \
  "https://ariacompute.cn/api/models/gemma-4-e2b-it/download?quant=int4&sdk=v1.0" \
  -o gemma-4-e2b-it_q4.zip
```

改为获取 JSON 信封而非跟随重定向：

```bash theme={null}
curl -H "Authorization: Bearer bfvk-XXXXXXXXXXXXXXXX" \
  -H "Accept: application/json" \
  "https://ariacompute.cn/api/models/gemma-4-e2b-it/download?quant=int4&sdk=v1.0"
```

## 为钱包充值（Stripe）

```bash theme={null}
curl -X POST https://ariacompute.com/api/billing/payments \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{"provider": "stripe", "amount": 20, "currency": "USD"}'
```

## 轮询支付状态

```bash theme={null}
curl -H "Authorization: Bearer eyJhbGciOi..." \
  https://ariacompute.cn/api/billing/payments/pay_01H...
```

## 下载发票

```bash theme={null}
curl -L "https://ariacompute.cn/api/billing/invoices/pay_01H.../download?token=eyJhbGciOi..." \
  -o invoice.pdf
```

## 拉取最新引擎发布

```bash theme={null}
curl -s https://ariacompute.cn/api/download/engine-latest | jq .
```

<Tip>
  将每个响应通过 `jq` 管道以获得可读输出。在国际站，请将每个 URL 中的 `ariacompute.cn` 替换为 `ariacompute.com`。
</Tip>
