Get started

Quickstart

Three steps: a key, two settings, one request.

1. Create an account and a key

  1. Create an account (no password: we email you a code) and add credit under Billing.
  2. 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:

.env
ZURELAY_API_KEY=zr_live_your_key_here

Then 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

import os
from openai import OpenAI
client = 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:

Response
{
"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.

import os
from openai import OpenAI
client = 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.