Chat Completions
POST /v1/chat/completions
The standard OpenAI Chat endpoint. Point the openai SDK base_url at https://us.gsnails.xyz/v1 and use a model name the platform offers.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model name (as listed by the platform) |
messages | object[] | Required | Array of chat messages, each {role, content} |
stream | boolean | Optional | Stream the response (SSE); supports stream_options |
temperature | number | Optional | Sampling temperature 0–2 |
max_tokens | integer | Optional | Max tokens to generate |
tools | object[] | Optional | Function / tool-call definitions |
from openai import OpenAIclient = OpenAI(base_url="https://us.gsnails.xyz/v1", api_key="sk-...")
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
stream=False,
)
print(resp.choices[0].message.content)