GET
/api/v1API 索引 — 版本和可用资源路径。无需密钥。
公开
curl https://osim.live/api/v1
每个私有请求都要带上 API 密钥。密钥以 osim_ 开头,在账户页创建。
Authorization: Bearer osim_…
切勿把密钥嵌进公开的前端。请优先使用服务端或后端代理。
打开控制台密钥每个端点都返回带 success 标志的 JSON。错误使用同一结构,并带 error 字符串。
// Success
{ "success": true, "data": { … } }
// Error
{ "success": false, "error": "message" }https://osim.live/api/v1application/jsonOPTIONS 已支持)balanceCents, sellCents)/api/v1API 索引 — 版本和可用资源路径。无需密钥。
公开
curl https://osim.live/api/v1
/api/v1/me与 API 密钥绑定的当前账户:id、email、name 和钱包余额。
需要 Bearer
curl https://osim.live/api/v1/me \
-H "Authorization: Bearer osim_…"
// data
{
"id": "…",
"email": "[email protected]",
"name": "…",
"balanceCents": 2500,
"balance": "$25.00"
}/api/v1/sms?catalog=1服务、国家、USD 价格和允许租用时长的公开目录。
公开
curl "https://osim.live/api/v1/sms?catalog=1"
// data
{
"services": [
{
"slug": "whatsapp",
"service": "WhatsApp",
"category": "…",
"countries": [
{ "code": "TR", "name": "Turkey", "countryId": 12, "priceUsd": 0.35, "successRate": 92 }
]
}
],
"rentHours": [4, 12, 24, 72, 168]
}/api/v1/sms列出你最近的短信订单。
需要 Bearer
curl https://osim.live/api/v1/sms \ -H "Authorization: Bearer osim_…"
/api/v1/sms购买、租用、查询状态、取消、完成或重发。不提供 call-verify。
需要 Bearer
通用请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
action | string | 是 | purchase | activation | rent | status | refresh | cancel | complete | resend |
service / serviceSlug | string | 是 | 目录 slug,例如 whatsapp |
countryId / country | number | 否 | 目录中的供应商国家 id(购买和租用时必填) |
priceId | string | 否 | 可选,锁定到某一价格行 |
maxPrice | number | 否 | 可选的美元上限 |
operator | string | 否 | 可选的网络偏好 |
hours / time | number | 否 | 仅租用:4 | 12 | 24 | 72 | 168 |
id / activationId | string | 否 | 用于查询状态、取消、完成和重发的订单 id |
purchase / activation
一次性短信验证号码(约 20 分钟)。不提供来电验证。
curl -X POST https://osim.live/api/v1/sms \
-H "Authorization: Bearer osim_…" \
-H "Content-Type: application/json" \
-d '{
"action": "purchase",
"service": "whatsapp",
"countryId": 12
}'rent
更长租用。允许的小时数:4、12、24、72、168。
{
"action": "rent",
"service": "telegram",
"countryId": 16,
"hours": 24
}status / refresh
{ "action": "status", "id": "cm…" }cancel · complete · resend
{ "action": "cancel", "id": "cm…" }
{ "action": "complete", "id": "cm…" }
{ "action": "resend", "id": "cm…" } // 仅在支持时的租用线路/api/v1/esim?catalog=1公开套餐目录(slug / packageCode、data、天数、售价)。
公开
curl "https://osim.live/api/v1/esim?catalog=1"
/api/v1/esim列出你的 eSIM 订单,或按 id 获取一笔(可能时会刷新用量)。
需要 Bearer
?id=cm…curl "https://osim.live/api/v1/esim?id=cm…" \ -H "Authorization: Bearer osim_…"
/api/v1/esim购买套餐、刷新配置、重命名、列出充值选项或应用充值。
需要 Bearer
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
action | string | 是 | purchase | refresh | rename | topup-options | topup |
slug / packageCode | string | 否 | 用于购买和充值的目录套餐 |
id | string | 否 | 用于刷新、重命名和充值的订单 id |
label | string | 否 | 重命名时的新显示名称 |
// Purchase
{
"action": "purchase",
"packageCode": "turkey-5gb-30d"
}
// Refresh profile / usage
{ "action": "refresh", "id": "cm…" }
// Rename
{ "action": "rename", "id": "cm…", "label": "Trip TR" }
// Top-up options + apply
{ "action": "topup-options", "id": "cm…" }
{ "action": "topup", "id": "cm…", "packageCode": "…" }购买响应在可用时包含 LPA 激活字符串和 QR 图片 URL。
| HTTP | 何时 |
|---|---|
200 | success: true |
400 | 校验或业务错误(余额不足、未知操作……) |
401 | 缺少或无效的 API 密钥 |
404 | 此账户下未找到订单 |