import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.hmbrd.dev/v1",
api_key=os.environ["HUMMINGRELAY_API_KEY"], # hr_live_...
)
response = client.chat.completions.create(
model="model-zero",
messages=[
{"role": "system", "content": "You are a security analyst on an authorized engagement."},
{"role": "user", "content": "Review this nginx config for misconfigurations: ..."},
],
)
print(response.choices[0].message.content)
Response shape · OpenAI format
{
"id": "chatcmpl-…",
"object": "chat.completion",
"model": "model-zero",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "1. server_tokens is on …" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": …, "completion_tokens": …, "total_tokens": … }
}