/api/v1/evidence/search仅在有结果返回时消耗 1 credit。
LitSource Agent 平台
使用带权限范围的 Agent Token 搜索证据、验证引文、获取运行记录和查询额度用量。
/api/v1/evidence/search仅在有结果返回时消耗 1 credit。
/api/v1/references/verify沿用现有 Verify 计费公式:每 10 条引文 3 credits。
/api/v1/runs/{id}免费。仅返回该 Token 所属用户的运行记录。
/api/v1/usage免费。返回当前余额和 UTC 自然日的 Token 用量。
发送 Authorization: Bearer lsa_…。付费 POST 端点还需要 8–128 字符的 Idempotency-Key。超时后可用相同的 key 和相同的请求体重试;如果 key 相同但请求体不同,返回 HTTP 409。
每个响应都包含 billing.credits_charged。错误、服务方故障和零结果搜索不消耗 credits。
curl https://litsource.net/api/v1/evidence/search \
-H "Authorization: Bearer $LITSOURCE_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: search-$(date +%s)" \
-d '{"query":"Aspirin reduces cardiovascular events","max_hits":5}'const response = await fetch("https://litsource.net/api/v1/evidence/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.LITSOURCE_AGENT_TOKEN}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ query: "Aspirin reduces cardiovascular events", max_hits: 5 }),
});
console.log(await response.json());import os, uuid, requests
response = requests.post(
"https://litsource.net/api/v1/references/verify",
headers={
"Authorization": f"Bearer {os.environ['LITSOURCE_AGENT_TOKEN']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"references": ["Smith J. Example study. Nature. 2024."]},
)
print(response.json())常见错误码:INVALID_TOKEN(401)、INSUFFICIENT_CREDITS(402)、SCOPE_DENIED(403)、IDEMPOTENCY_KEY_CONFLICT(409)、CREDIT_CHECK_FAILED(503)。所有错误响应都包含 billing.credits_charged: 0。
litsource_verify_references — it flags fabricated or mismatched citations before they reach your paper.litsource_search_evidence on a sentence like "aspirin reduces cardiovascular events" and get real PubMed / Crossref evidence supporting or challenging it.GET /api/v1/runs/{id}, and monitor spend with GET /api/v1/usage.Every Agent API and MCP call is metered in LitSource credits. You are only charged when a call produces a usable result — failures and zero-result searches cost nothing.
| Operation | Credits | When charged |
|---|---|---|
| Search evidence | 1 credit | Only when ≥1 result is returned |
| Verify references | 3 per 10 references | Per completed verification (max 100 refs) |
| Get run | Free | — |
| Get usage | Free | — |
Free accounts can verify up to 10 references per call; verifying more requires Pro or Trial. Retrying the same request with the same idempotency key returns the cached result without charging again.
Every successful call returns a uniform envelope with data, billing, and meta:
{
"data": {
"results": [
{ "title": "…", "doi": "10.…", "pmid": "…", "relevance": 0.94 }
]
},
"billing": {
"credits_charged": 1,
"balance_after": 99,
"reused": false
},
"meta": {
"request_id": "my-search-001",
"quality_version": null
}
}Failures never charge credits — billing.credits_charged is always 0:
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient LitSource credits",
"details": { "remaining_credits": 2, "required_credits": 3 }
},
"billing": { "credits_charged": 0 }
}[A-Za-z0-9._:-].INSUFFICIENT_CREDITS once depleted.