Quickstart
You need a Zrelay account, available prepaid balance, and a key for your chosen provider and pool.
1. Create your key
Open the account portal. Save your account code securely and configure TOTP or a passkey. Add prepaid balance if needed, choose an available pool and provider, and create a key.
2. Set your environment
Set your key only in the process that makes API requests. The example uses a hidden prompt so the key is not included in shell history.
read -rsp 'Zrelay API key: ' ZRELAY_API_KEY; echo
export ZRELAY_API_KEY3. Send a request
This example needs a GPT key with access to the listed model and Chat Completions route. For Claude, use the Messages example in Compatibility.
curl https://api.zrelay.net/v1/chat/completions \
-H "Authorization: Bearer $ZRELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Hello from Zrelay"}],"max_tokens":256}'4. Read the response
A successful Chat Completions response contains choices. Read choices[0].message.content for text; tool responses can contain tool_calls instead. Inspect the HTTP status before parsing a successful response shape.
Where to go next
Questions about your integration? support@zrelay.net