HTTP API
Use the same operations without the TypeScript SDK.
The production origin is https://api.orbytelabs.com. Authenticate with an
environment API key in Authorization: Bearer .... Use Content-Type: application/json
for JSON requests. The reference is generated
from the current backend's owning schemas.
First event
Create an environment, deploy a catalog, and issue a key as described in the quickstart. Grant a customer one credit:
curl --fail-with-body https://api.orbytelabs.com/v1/grants \
-H "Authorization: Bearer $ORBYTE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"identity":"customer_123","credits":"1000000000","idempotencyKey":"welcome_customer_123"}'The grant can fund any deployed feature by default. Add "featureKeys": ["requests"]
to the grant request to restrict it to requests.
Check before work:
curl --fail-with-body https://api.orbytelabs.com/v1/check \
-H "Authorization: Bearer $ORBYTE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"identity":"customer_123","featureKey":"requests"}'Continue only when allowed is true. After work, track it:
curl --fail-with-body https://api.orbytelabs.com/v1/events \
-H "Authorization: Bearer $ORBYTE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"identity":"customer_123","featureKey":"requests","idempotencyKey":"request_123"}'For a deployment with requests priced at 0.01 credits, the balance is then
"990000000000" ledger units. Read it at GET /v1/customers/customer_123/balance.
Wire format
Credit amounts and 64-bit integers are exact decimal strings. One credit is
"1000000000" units. Timestamps are Unix milliseconds. Success response shapes vary
by operation; tracking and grant creation return an ID, not a status wrapper.
User OAuth requests select scope through X-Orbyte-Environment or
X-Orbyte-Organization. API keys select their own environment and cannot
administer keys or organizations.
The live schema is at /v1/openapi.json. This documentation serves its generated
snapshot at /openapi.json. Errors describes failures.
