Get started
Quickstart
Three steps: a key, two settings, one request.
1. Create an account and a key
- Create an account (no password: we email you a code) and add credit under Billing.
- Open API keys, name a key and create it. Copy it right away: you see the full key once.
2. Set the key and base URL
Keep the key out of your code. In your shell, or in a .env file your app loads:
ZURELAY_API_KEY=zr_live_your_key_hereThen install an SDK if you don’t have one: pip install openai for Python, npm install openai for Node. Anthropic’s SDKs work too (see Anthropic Messages).
3. Send a request
main.py
import osfrom openai import OpenAIclient = OpenAI( base_url="https://api.zurelay.com/v1", api_key=os.environ["ZURELAY_API_KEY"],)response = client.chat.completions.create( model="gpt-6-sol", messages=[ { "role": "system", "content": "You are a concise assistant." }, { "role": "user", "content": "Give me three names for a coffee shop on the moon." } ],)print(response.choices[0].message.content)The answer comes back in OpenAI’s format, with the model that answered and the tokens used:
{ "id": "chatcmpl-...", "object": "chat.completion", "created": 1790870400, "model": "gpt-6-sol", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "1. Lunar Grind\n2. ..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 31, "completion_tokens": 24, "total_tokens": 55 }}Stream it
Add stream: true to get the answer as it’s written, the same way OpenAI streams it.
main.py
import osfrom openai import OpenAIclient = OpenAI( base_url="https://api.zurelay.com/v1", api_key=os.environ["ZURELAY_API_KEY"],)stream = client.chat.completions.create( model="gemini-3.7-flash", messages=[ { "role": "user", "content": "Write a haiku about latency." } ], stream=True,)for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True)Next
Questions, or something missing? Ask support in your dashboard or email support@zurelay.com.