运行姿态
面向稳定生产级文本与多模态流量。
基于 MDX 内容结构组织的完整文档:快速开始、API 参考、教程与 Cookbook。
运行姿态
面向稳定生产级文本与多模态流量。
能力范围
文本与多模态统一走同一 Model API 合约。
接入协议
OpenAI-compatible、MCP、llms.txt 与 agents.md 同时开放。
流控语义
支持 TTFT 监控、背压、慢消费隔离与区域级限流。
OpenAPI
https://api.luminapath.tech/openapi.json
API base
https://api.luminapath.tech/v1
MCP
https://api.luminapath.tech/v1/mcp
公开路径
/v1/chat/completions · /v1/responses · /v1/embeddings · /v1/images · /v1/audio/* · /v1/videos
全球网络接入,统一控制平面
BatchIn 协同智能调度、安全控制与算力资源,为海内外客户提供本地化支付接入与高可靠的工业级推理算力底座。
查看当前公开合约全球入口
这个入口承接美元定价、公开 MCP 发现、OpenAI 兼容调用,以及面向海外客户的销售与交付。
中国入口
这个入口承接人民币导向的开通、国内支持方式和本地化交付,并保持统一的 BatchIn 使用体验。
运行姿态
面向稳定生产级流量。
流量类型
覆盖文本、视觉、音频、图像和视频混合流量。
流式主路径
区域入口、稳定流式输出与请求连续性。
控制护栏
范围化限流、请求隔离与背压控制。
公开合约与就绪度
共享核心
这里统一承接公开 Model API、Batch、Usage、Billing 和公开 MCP 合约。
独立 lane
客户界面保持一个产品真相,交付、配额和隔离方式按合同切换。
算力真相
公开页面只展示来自已验证算力注册表的库存与可用性。
边缘接入
延迟优化从客户侧入口开始,再进入主执行链路。
流式交付
连接复用与消费隔离用于降低抖动和长尾失败。
流量策略
客户看到简洁 API 与清晰限制,BatchIn 在幕后处理流量保护。
pip install openaifrom openai import OpenAI
client = OpenAI(
base_url="https://api.luminapath.tech/v1",
api_key="YOUR_API_KEY"
)
resp = client.chat.completions.create(
model="qwen3-32b",
messages=[{"role": "user", "content": "Hello from 百因智算"}]
)
print(resp.choices[0].message.content)stream = client.chat.completions.create(
model="qwen3-32b",
messages=[{"role": "user", "content": "Write a haiku about latency"}],
stream=True
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="")/v1/users/meBearer获取当前 API Key 对应用户信息。
{}{
"id": "f6e2c67b-90cf-4f4e-b1e5-31d45f3b1b0a",
"email": "hello@luminapath.ai",
"name": "BatchIn Team",
"credit_balance_cents": 10000
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/users/me",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/keysBearer创建新 API Key,可设置速率与月预算。
{
"name": "Production Key",
"rate_limit_rpm": 120,
"monthly_budget_cents": 500000
}{
"id": "f40cf8b0-c367-4764-92e3-cbd358fa3d76",
"key": "batchin_api_xxx",
"key_prefix": "batchin_api",
"name": "Production Key",
"rate_limit_rpm": 120,
"monthly_budget_cents": 500000,
"created_at": "2026-04-08T18:00:00Z"
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/keys",
headers=headers,
json={
"name": "Production Key",
"rate_limit_rpm": 120,
"monthly_budget_cents": 500000
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| name | string | 否 | 密钥名称 |
| rate_limit_rpm | number | 否 | 每分钟请求上限 |
| monthly_budget_cents | number | 否 | 月预算(美分) |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/keysBearer返回当前用户全部 API Keys。
{}[
{
"id": "f40cf8b0-c367-4764-92e3-cbd358fa3d76",
"key_prefix": "batchin_api",
"name": "Production Key",
"rate_limit_rpm": 120,
"is_active": true,
"created_at": "2026-04-08T18:00:00Z"
}
]import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/keys",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/keys/{id}Bearer删除指定 API Key。
{}204 No Contentimport os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"DELETE",
"https://api.luminapath.tech/v1/keys/{id}",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | API Key ID |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| not_found | 404 | API Key 不存在 | 确认 key id 后重试。 |
/v1/chat/completionsBearer用于文本/多轮对话,支持 SSE 流式输出。
{
"model": "qwen3.5-27b",
"messages": [{"role":"user","content":"Explain attention in 3 bullets"}],
"temperature": 0.7,
"stream": false
}{
"id": "chatcmpl_xxx",
"object": "chat.completion",
"model": "qwen3.5-27b",
"choices": [{"index":0,"message":{"role":"assistant","content":"..."}}],
"usage": {"prompt_tokens": 22, "completion_tokens": 90, "total_tokens": 112}
}| Header | 说明 |
|---|---|
| traceparent | W3C trace 上下文,可用于把请求串到外部追踪系统。 |
| X-Request-Id | 请求级关联 ID,可用于支持与审计排障。 |
| X-BatchIn-Run-Id | 本次运行的 BatchIn run id。 |
| X-BatchIn-Prompt-Version | 绑定到本次运行的 prompt version。 |
| X-VaaS-Record-Id | 审计证据记录 id。 |
| X-VaaS-Signature | 审计证据签名。 |
| X-VaaS-PublicKey | 审计验签公钥。 |
import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/chat/completions",
headers=headers,
json={
"model": "qwen3.5-27b",
"messages": [{"role":"user","content":"Explain attention in 3 bullets"}],
"temperature": 0.7,
"stream": false
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型 ID |
| messages | array | 是 | 对话消息数组 |
| temperature | number | 否 | 采样温度 |
| max_tokens | number | 否 | 最大输出 tokens |
| stream | boolean | 否 | 是否流式返回 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| payment_required | 402 | 余额不足或预算超限 | 充值或提高月预算后重试。 |
/v1/responsesBearer最小兼容版 Responses API,返回 response 对象与运行时回执头。
{
"model": "qwen3.5-27b",
"input": "Explain batch inference in 3 bullets",
"max_output_tokens": 256
}{
"id": "resp_chatcmpl_xxx",
"object": "response",
"model": "qwen3.5-27b",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type":"output_text","text":"..."}]
}
],
"usage": {"input_tokens": 12, "output_tokens": 10, "total_tokens": 22}
}| Header | 说明 |
|---|---|
| traceparent | W3C trace 上下文,可用于把请求串到外部追踪系统。 |
| X-Request-Id | 请求级关联 ID,可用于支持与审计排障。 |
| X-BatchIn-Run-Id | 本次运行的 BatchIn run id。 |
| X-BatchIn-Prompt-Version | 绑定到本次运行的 prompt version。 |
| X-VaaS-Record-Id | 审计证据记录 id。 |
| X-VaaS-Signature | 审计证据签名。 |
| X-VaaS-PublicKey | 审计验签公钥。 |
import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/responses",
headers=headers,
json={
"model": "qwen3.5-27b",
"input": "Explain batch inference in 3 bullets",
"max_output_tokens": 256
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型 ID |
| input | string|array | 是 | 输入文本或消息数组 |
| max_output_tokens | number | 否 | 最大输出 tokens |
| stream | boolean | 否 | 是否流式返回(当前未实现) |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| not_implemented | 501 | 流式 Responses 还未实现 | 先使用非流式 /v1/responses 或 /v1/chat/completions。 |
/v1/completionsBearer兼容 OpenAI completions,并支持 prefix/suffix 形式的 FIM 请求。
{
"model": "qwen3.5-27b",
"prompt": "Complete this sentence: Batch processing helps",
"suffix": "for large workloads.",
"max_tokens": 128
}{
"id": "cmpl_xxx",
"object": "text_completion",
"choices": [{"index":0,"text":"reduce manual toil at scale.","finish_reason":"stop"}],
"usage": {"prompt_tokens": 24, "completion_tokens": 12, "total_tokens": 36}
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/completions",
headers=headers,
json={
"model": "qwen3.5-27b",
"prompt": "Complete this sentence: Batch processing helps",
"suffix": "for large workloads.",
"max_tokens": 128
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 补全模型 ID |
| prompt | string|array | 是 | 输入前缀或文本 |
| suffix | string | 否 | FIM 后缀 |
| max_tokens | number | 否 | 最大输出 tokens |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/embeddingsBearer将文本转换为向量表示。
{
"model": "bge-m3",
"input": ["batch inference", "retrieval augmented generation"]
}{
"object": "list",
"data": [
{"index":0,"embedding":[0.012,-0.043,...]},
{"index":1,"embedding":[0.021,-0.011,...]}
]
}| Header | 说明 |
|---|---|
| traceparent | W3C trace 上下文。 |
| X-BatchIn-Run-Id | 本次 embedding 运行的 run id。 |
| X-BatchIn-Prompt-Version | 绑定到本次运行的 prompt version。 |
| X-VaaS-Record-Id | 审计证据记录 id。 |
import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/embeddings",
headers=headers,
json={
"model": "bge-m3",
"input": ["batch inference", "retrieval augmented generation"]
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 嵌入模型 ID |
| input | string|array | 是 | 待向量化文本 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/audio/speechBearer使用 CosyVoice / TTS 模型把文本转换为音频响应。
{
"model": "cosyvoice",
"input": "Welcome to BatchIn",
"voice": "alloy",
"response_format": "mp3"
}Binary audio payload (audio/mpeg)import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/audio/speech",
headers=headers,
json={
"model": "cosyvoice",
"input": "Welcome to BatchIn",
"voice": "alloy",
"response_format": "mp3"
}
)
print(response.content)| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 语音模型 ID |
| input | string | 是 | 待合成文本 |
| voice | string | 否 | 音色 |
| response_format | string | 否 | 返回格式 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/audio/transcriptionsBearer将语音或音频文件转成文本,可返回简洁结果或带时间片段的详细结构。
multipart/form-data
file=@meeting.wav
model=whisper-large-v3-turbo
response_format=verbose_json
language=en{
"text": "BatchIn transcription output",
"language": "en",
"duration": 3.42,
"segments": [{"id":0,"start":0.0,"end":3.42,"text":"BatchIn transcription output"}]
}import os
import requests
with open("meeting.wav", "rb") as audio_file:
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/audio/transcriptions",
headers={"Authorization": f"Bearer {os.environ['BATCHIN_API_KEY']}"},
files={"file": audio_file},
data={
"model": "whisper-large-v3-turbo",
"response_format": "verbose_json",
"language": "en",
},
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| file | binary | 是 | 音频文件 |
| model | string | 是 | 转录模型 ID |
| language | string | 否 | 语言代码 |
| prompt | string | 否 | 转录提示 |
| response_format | string | 否 | 返回格式 |
| temperature | number|string | 否 | 采样温度 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/videosBearer通过统一的 Model API 视频入口提交视频生成任务。
{
"model": "wan-2.2",
"prompt": "Create a product teaser for an AI cloud launch",
"duration_seconds": 6
}{
"id": "video_xxx",
"object": "video.generation",
"status": "queued",
"duration_seconds": 6,
"output_url": "https://api.luminapath.tech/v1/files/file_video_xxx/content"
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/videos",
headers=headers,
json={
"model": "wan-2.2",
"prompt": "Create a product teaser for an AI cloud launch",
"duration_seconds": 6
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 视频模型 ID |
| prompt | string | 是 | 视频提示词 |
| duration_seconds | number | 否 | 视频秒数 |
| aspect_ratio | string | 否 | 画幅比例 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/imagesBearer通过统一的 Model API 图像入口进行文本生成图像。
{
"model": "flux-schnell",
"prompt": "A futuristic city at sunrise",
"size": "1024x1024"
}{
"created": 1775671200,
"data": [{"url":"https://batchin.tech/images/generated/abc.png"}]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/images",
headers=headers,
json={
"model": "flux-schnell",
"prompt": "A futuristic city at sunrise",
"size": "1024x1024"
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 图像模型 ID |
| prompt | string | 是 | 图像提示词 |
| size | string | 否 | 输出尺寸 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/models公开返回模型状态、价格、上下文与许可证信息。
{}{
"object": "list",
"data": [
{
"id":"qwen3.5-27b",
"status":"always_on",
"context_length":131072,
"pricing":{"std_input":0.02,"std_output":0.08}
}
]
}import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/models",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| service_unavailable | 503 | 模型服务不可用 | 查看状态页并稍后重试。 |
/v1/batchesBearer提交批处理任务(支持混合模型与优先级)。
{
"priority": "fill",
"webhook_url": "https://your-domain.com/webhooks/batchin",
"tasks": [
{"custom_id":"task-1","model":"qwen3.5-27b","request_body":{"messages":[{"role":"user","content":"translate this"}]}},
{"custom_id":"task-2","model":"glm-5.1","request_body":{"messages":[{"role":"user","content":"summarize this"}]}}
]
}{
"id":"0b0db2a6-0baf-4ec4-a5e7-bce60da57db6",
"status":"pending",
"priority":"fill",
"total_tasks":2,
"completed_tasks":0,
"failed_tasks":0
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/batches",
headers=headers,
json={
"priority": "fill",
"webhook_url": "https://your-domain.com/webhooks/batchin",
"tasks": [
{"custom_id":"task-1","model":"qwen3.5-27b","request_body":{"messages":[{"role":"user","content":"translate this"}]}},
{"custom_id":"task-2","model":"glm-5.1","request_body":{"messages":[{"role":"user","content":"summarize this"}]}}
]
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| tasks | array | 是 | 任务数组(每项可指定 model) |
| priority | string(high|low|fill) | 否 | 调度优先级 |
| webhook_url | string(url) | 否 | 回调地址 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| payload_too_large | 413 | 批任务 JSON 超过 2MB | 拆分批次或减少单批任务数。 |
/v1/batchesBearer列出当前用户批处理任务。
{}[
{
"id":"0b0db2a6-0baf-4ec4-a5e7-bce60da57db6",
"status":"completed",
"priority":"fill",
"total_tasks":2,
"completed_tasks":2,
"failed_tasks":0
}
]import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/batches",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/batches/{id}Bearer获取批处理任务与子任务详情。
{}{
"id":"0b0db2a6-0baf-4ec4-a5e7-bce60da57db6",
"status":"completed",
"tasks":[{"custom_id":"task-1","status":"completed"}]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/batches/{id}",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | 批处理 ID |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| not_found | 404 | 批处理不存在 | 确认 batch id 是否正确。 |
/v1/batches/{id}/cancelBearer取消进行中的批处理任务。
{}{
"id":"0b0db2a6-0baf-4ec4-a5e7-bce60da57db6",
"status":"cancelled"
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/batches/{id}/cancel",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | 批处理 ID |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/topup/stripe/checkoutBearer创建充值支付会话。
{
"amount_cents": 5000
}{
"checkout_url":"https://buy.stripe.com/9B65kD4US2fLeEF4zweME00",
"session_id":"cs_test_xxx"
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/topup/stripe/checkout",
headers=headers,
json={
"amount_cents": 5000
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| amount_cents | number | 是 | 充值金额(美分) |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/topup/historyBearer查询充值记录。
{}[
{
"id":"1544d6df-8fca-46f3-9091-95f81dc37efa",
"amount_cents":5000,
"source":"stripe",
"reference_id":"cs_test_xxx"
}
]import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/topup/history",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/topup/usdc/chainsBearer获取 USDC 充值链与地址。
{}{
"chains":[
{"chain":"ethereum","deposit_address":"0x...","required_confirmations":12},
{"chain":"polygon","deposit_address":"0x...","required_confirmations":12}
]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/topup/usdc/chains",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/usage/logs?limit=50&offset=0Bearer查询请求级别使用日志。
{}[
{
"id":"e73f9476-00ea-491f-ba6f-899602247a15",
"model":"qwen3.5-27b",
"input_tokens":120,
"output_tokens":88,
"cost_cents":2
}
]import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/usage/logs?limit=50&offset=0",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| limit | query:number | 否 | 返回条数(1-500) |
| offset | query:number | 否 | 偏移量 |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/usage/summaryBearer获取总请求、tokens 与成本统计。
{}{
"total_requests": 1304,
"total_input_tokens": 2341122,
"total_output_tokens": 1111400,
"total_cost_cents": 18640
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/usage/summary",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| payment_required | 402 | API Key 月预算已超限 | 提高月预算或更换 key。 |
/v1/usage/by-modelBearer按模型维度统计用量。
{}[
{
"model":"qwen3.5-27b",
"total_requests": 880,
"total_input_tokens": 1620012,
"total_output_tokens": 801202,
"total_cost_cents": 9900
}
]import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/usage/by-model",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/vaasBearer创建可验证审计记录并返回签名。
{
"input_text": "What is a zero-knowledge proof?",
"output_text": "A cryptographic method...",
"model_id": "qwen3.5-27b",
"gpu_id": "execution-a19c-42ef"
}{
"audit_id":"ee3cc19e-710d-4a2d-bf01-0edca0c5fdf4",
"input_hash":"9a5f...",
"output_hash":"2f1b...",
"carbon_grams_co2e":0.0126,
"energy_wh":0.2107,
"energy_source":"Renewable grid mix",
"carbon_offset_vs_us_cloud":0.0717,
"signature":"bfc4..."
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/vaas",
headers=headers,
json={
"input_text": "What is a zero-knowledge proof?",
"output_text": "A cryptographic method...",
"model_id": "qwen3.5-27b",
"gpu_id": "execution-a19c-42ef"
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| input_text | string | 是 | 输入文本 |
| output_text | string | 是 | 输出文本 |
| model_id | string | 是 | 模型 ID |
| gpu_id | string | 否 | 执行环境标识(脱敏) |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/vaas/{id}公开按 audit_id 获取审计详情。
{}{
"audit_id":"ee3cc19e-710d-4a2d-bf01-0edca0c5fdf4",
"input_hash":"9a5f...",
"output_hash":"2f1b...",
"carbon_grams_co2e":0.0126,
"energy_wh":0.2107,
"energy_source":"Renewable grid mix",
"carbon_offset_vs_us_cloud":0.0717,
"signature":"bfc4..."
}import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/vaas/{id}",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | 审计 ID |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| not_found | 404 | 审计记录不存在 | 检查 audit_id。 |
/v1/vaas/{id}/verify公开验证审计记录签名是否合法。
{}{
"audit_id":"ee3cc19e-710d-4a2d-bf01-0edca0c5fdf4",
"valid": true
}import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/vaas/{id}/verify",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | 审计 ID |
| Code | HTTP | 信息 | 处理建议 |
|---|
/v1/vaas/{id}/evidence公开返回浏览器验签和合规导出使用的 audit evidence pack。
{}{
"record_id":"vaas_xxx",
"run_id":"run_xxx",
"trace_id":"0123456789abcdef0123456789abcdef",
"route_id":"default-route",
"provider":"batchin-managed",
"environment":"development",
"prompt_version_id":"default",
"verification_method":"Ed25519Signature2020",
"public_key":"ed25519:pk_xxx",
"signature":"ed25519:xxx",
"payload": {"record_id":"vaas_xxx","input_hash":"sha256:...","output_hash":"sha256:..."}
}| Header | 说明 |
|---|---|
| Content-Type | JSON evidence pack,可直接保存或交给 /verify。 |
import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/vaas/{id}/evidence",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| id | path:uuid | 是 | 审计 ID |
| Code | HTTP | 信息 | 处理建议 |
|---|
/v1/vaas/pubkey/current公开获取浏览器验签所需公钥。
{}{
"verify_key_hex":"1fbd9285..."
}import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/vaas/pubkey/current",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|
/v1/traces?limit=20Bearer返回原生 runtime trace 列表,关联 route、prompt version 与 审计记录。
{}{
"items": [
{
"trace_id":"0123456789abcdef0123456789abcdef",
"run_id":"run_xxx",
"record_id":"vaas_xxx",
"route_id":"default-route",
"provider":"batchin-managed",
"environment":"development",
"prompt_version_id":"default",
"model_id":"qwen3.5-27b"
}
]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/traces?limit=20",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| limit | query:number | 否 | 返回条数(1-100) |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/traces/{trace_id}Bearer按 trace_id 获取单条 runtime trace。
{}{
"trace_id":"0123456789abcdef0123456789abcdef",
"run_id":"run_xxx",
"record_id":"vaas_xxx",
"route_id":"default-route",
"provider":"batchin-managed",
"environment":"development",
"prompt_version_id":"default",
"model_id":"qwen3.5-27b"
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/traces/{trace_id}",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| trace_id | path:string | 是 | Trace ID |
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
| not_found | 404 | Trace 不存在 | 确认 trace_id 后重试。 |
/v1/promptsBearer返回 prompt 注册表、已提升版本、最新观测版本与版本明细。
{}{
"status":"ready",
"docs":"/docs/prompts",
"items":[
{
"registry_id":"support",
"display_name":"support",
"source":"auto_backfill",
"latest_version_id":"support@v2",
"promoted_version_id":"support@v2",
"total_runs":4,
"versions":[
{
"version_id":"support@v1",
"status":"observed",
"total_runs":2
},
{
"version_id":"support@v2",
"status":"promoted",
"total_runs":2
}
]
}
]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/prompts",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/prompt-regressionsBearer返回自动 sampled replay 的 regression 结果、样本数、相似度与延迟汇总。
{}{
"status":"ready",
"docs":"/docs/experiments",
"items":[
{
"regression_id":"preg_demo",
"registry_id":"support",
"baseline_prompt_version_id":"support@v1",
"candidate_prompt_version_id":"support@v2",
"status":"passed",
"judge":"deterministic_replay",
"sample_count":3,
"pass_count":3,
"fail_count":0,
"avg_similarity":1,
"baseline_avg_latency_ms":420,
"candidate_avg_latency_ms":390
}
]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/prompt-regressions",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/experimentsBearer返回候选 prompt version 的自动实验、回放状态与自动提升结果。
{}{
"status":"ready",
"docs":"/docs/experiments",
"items":[
{
"experiment_id":"pexp_demo",
"registry_id":"support",
"baseline_prompt_version_id":"support@v1",
"candidate_prompt_version_id":"support@v2",
"status":"passed",
"promotion_status":"promoted",
"sample_count":3,
"pass_rate":1
}
]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/experiments",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/otlp/tracesBearer接收 OTLP/HTTP JSON 或 protobuf trace,并把 span 合并进统一 trace 视图。
{
"resourceSpans": []
}{}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://api.luminapath.tech/v1/otlp/traces",
headers=headers,
json={
"resourceSpans": []
}
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/v1/otlp/exportBearer把统一 trace 视图中的 span 导出为 OTLP protobuf 或 JSON。
{}{
"resourceSpans":[]
}import os
import requests
headers = {}
headers["Authorization"] = f"Bearer {os.environ['BATCHIN_API_KEY']}"
response = requests.request(
"GET",
"https://api.luminapath.tech/v1/otlp/export",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|---|---|---|
| unauthorized | 401 | API Key 无效或缺失 | 检查 Authorization: Bearer <API_KEY>。 |
/health公开服务健康状态探活端点。
{}{
"status":"ok"
}import os
import requests
headers = {}
response = requests.request(
"GET",
"https://api.luminapath.tech/health",
headers=headers,
)
print(response.json())| Name | Type | 必填 | 说明 |
|---|---|---|---|
| 无参数 | |||
| Code | HTTP | 信息 | 处理建议 |
|---|
将 1,000,000 条文档拆分为 JSONL 任务,按优先级分批处理并自动回调入库。
组合 Embeddings + 检索 + 重排序 + 生成,构建可观测、可回滚的问答系统。
在输入、输出、人工复核三个节点写入审计证据,并完成 Ed25519 验签。
Release truth lives in the live model catalog, pricing surfaces, and verified route behavior. Use the public site and console evidence paths as the current changelog source of truth.