Clients
REST and API keys
Scripts and servers call every tool over HTTP. Each key spends from your organization's wallet and can have its own monthly cap.
Create a key#
- Open API keys on the Connect page and create a key. Give it a name, and a monthly cap if you want one.
- Copy it at once. It is shown only once.
- Keep it in an environment variable, such as
SNOWAI_API_KEY.
A key starts with snow_live_. It can call every tool and spend from the wallet, so treat it like a password. Revoke it on the same page and it stops working at once.
Call a tool#
Every tool is POST https://api.trysnow.ai/tools/<name>, with its arguments as the JSON body and the key as a bearer token.
search_google
curl -X POST https://api.trysnow.ai/tools/search_google \
-H "Authorization: Bearer $SNOWAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "best crm for startups",
"country": "us"
}'The answer has the tool's own fields, then call_id, status, cost_credits, cost_usd and the balance. Tools lists them.
Good to know#
GET https://api.trysnow.ai/toolsis public: every tool with its toolset, price, cache time, deadline and input schema.- An OAuth access token works in place of a key.
- Retry safely: send an
Idempotency-Keyheader and a retry answers with the first result instead of charging twice. - A billed response carries
Snow-Cost-CreditsandSnow-Balance-Creditsheaders; every response carriesSnow-Call-Idonce a call exists. - Browsers on other sites are refused by CORS. Call the API from a server.
REST API lists the endpoints.