Credits

Credit balance の確認と checkout 開始です。


Credits endpoint は balance 確認と purchase flow 開始に使います。

1 credit の price は $0.01 です。Checkout は最低 500 credits の purchase total を要求します。

Get balance

GET /v1/credits
Authorization: Bearer <token>

Workspace balance を見る場合は workspaceId を使います。

curl "https://api.epismo.ai/v1/credits?workspaceId=<workspace-id>" \
  -H "authorization: Bearer $TOKEN"

Response:

{
	"balance": 1200,
	"shortfall": 0
}

Start checkout

POST /v1/credits
Authorization: Bearer <token>
Content-Type: application/json
 
{
  "allocations": [
    { "userId": "user-id", "quantity": 500 }
  ]
}

Response は checkout url を含みます。

各 allocation は non-empty userId と positive integer quantity を要求します。すべての quantity の合計は 500 以上である必要があります。

Credit consumption

API では agent usage、pack search、track search、pack read が credit を消費します。

Operation Endpoint examples
Search POST /v1/packs/search, POST /v1/tracks/search
Pack reads GET /v1/packs?reference=..., GET /v1/packs?reference=...&full=true, selected blockIds / stepIds reads
Agent usage Agent が Epismo context を使う execution

Pack read の default outline は、大きな agent context を hydrate する前に必要な detail を決めるために使います。すべての nested content が必要な場合だけ full=true を使い、一部で足りる場合は blockIds / stepIds を指定してください。

Selected context の credit が不足している場合、credit-gated operation は 402 Payment Required を返すことがあります。