4Z API

Python Basic Chat

You can call the API via HTTP in any language, the official Python bindings, the official Node.js library, or community-maintained libraries.

To install the official Python bindings:

pip install openai
key='sk-xxxx'


from openai import OpenAI

client = OpenAI(
    base_url="https://4zapi.com/v1",
    api_key=key
)

response = client.chat.completions.create(
  model="gpt-6-luna",
  messages=[
    {"role": "user", "content": "Hello?"},

  ],
  timeout=100,

)
print(response)