# Quickstart

You need a Zrelay account, available prepaid balance, and a key for your chosen provider and pool.

Source: https://zrelay.net/docs/quickstart/

## 1. Create your key

Open the [account portal](https://keys.zrelay.net/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.

Examples demonstrate request formats. Select an enabled model, endpoint and pool from the [live catalog](https://zrelay.net/prices.html#per-model) before sending a request. Availability and rates can change.

## 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_KEY
```

Never put a real key in source control, browser JavaScript, screenshots or support messages.

## 3. 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

[Connect an agent](https://zrelay.net/docs/md/agents/quick-setup.md) — Configure your existing coding tool.

[Stream a response](https://zrelay.net/docs/md/capabilities/streaming.md) — Read output as it arrives.
