Manage the Platform programmatically
Know the Platform API
https://platform.tenzro.xyz/apiAuthorization: Bearer tzl_...{ "data": [...] }.https://platform.tenzro.xyz/api/openapi.jsonCatalogue endpoints need no key. Account endpoints need a key with read; changes need manage. Every endpoint below has an MCP tool with the same result, on the server at https://platform.tenzro.xyz/api/mcp.
export TENZRO_API_KEY="tzl_..." # read, plus manage for step 04
export TENZRO_API="https://platform.tenzro.xyz/api"Errors share one shape: { "error": { "code", "message" } }, with 401 invalid_key for a bad key and 403 forbidden when the key lacks the permission.
List models and machines
GET /modelslist_modelsGET /models/{id}get_model(model_id)GET /machineslist_machinesGET /machines/{id}get_machine(machine_id)GET /operatorslist_operatorsGET /route?model=route_model(model_id, region?)curl -s $TENZRO_API/models | jq -r '.data[] | "\(.id) \(.modality) available=\(.available)"'
# GPU machines serving a model, in one region
curl -s "$TENZRO_API/machines?gpu=true&model=qwen3.5-4b®ion=Europe" | jq '.data[] | {id, health}'
curl -s "$TENZRO_API/route?model=qwen3.5-4b"/machines filters: service (serverless, rent or subscribe), region, gpu, operator and model. list_machines takes the same filters as arguments.
{ "model": "qwen3.5-4b", "routes": [{ "machine_id": "tenzro-partner-cluster", "health": "online", "region": "Europe", "score": 120 }] }Read the balance and activity
GET /meget_accountGET /creditsget_balanceGET /credits/activity?limit=list_activity(limit?)curl -s $TENZRO_API/credits -H "Authorization: Bearer $TENZRO_API_KEY"
curl -s "$TENZRO_API/credits/activity?limit=20" -H "Authorization: Bearer $TENZRO_API_KEY"{ "total_credits": 25000, "by_scope": [{ "machine_id": null, "credits": 25000 }] }Credit with machine_id null is usable anywhere; the rest is pinned to a machine. Balances are in Tenzro Labs credits: 1 credit is 0.001 TNZO. Activity lists credit added, plan credit granted and usage charged; limit is 1 to 500, default 50.
Create, list and revoke keys
GET /keyslist_api_keysPOST /keyscreate_api_keyDELETE /keys/{id}revoke_api_key(key_id)Create
curl $TENZRO_API/keys \
-H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "ci", "permissions": ["inference", "read"], "machine_id": "tenzro-partner-cluster"}'namepermissionsmachine_idsubscription_id, rental_idThe response includes secret, returned once. Lists never include secrets; last_used_at shows which keys are still in use.
List and revoke
curl -s $TENZRO_API/keys -H "Authorization: Bearer $TENZRO_API_KEY" \
| jq -r '.data[] | "\(.id) \(.name) \(.permissions | join(",")) last_used=\(.last_used_at)"'
curl -X DELETE $TENZRO_API/keys/key_Zb81Qm0sP4aT -H "Authorization: Bearer $TENZRO_API_KEY"manage key cannot move money: paying an order returns a Stripe Checkout link or a stablecoin deposit address that a person completes. It can still spend existing credit by minting inference keys, so store it like a password.Do the same from an assistant
With the MCP server connected (tutorial 03) on a key with read, an assistant answers account questions with these tools; with manage it can also create and revoke keys. Clients ask before running a tool that changes something.
{ "service": "serverless", "gpu": true, "model": "qwen3.5-4b" }{ "limit": 20 }{ "name": "ci", "permissions": ["inference"], "machine_id": "tenzro-partner-cluster" }