Chat

Open in ShowDoc → · All docs

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.

FieldTypeRequiredDescription
modelstringRequiredModel name (as listed by the platform)
messagesobject[]RequiredArray of chat messages, each {role, content}
streambooleanOptionalStream the response (SSE); supports stream_options
temperaturenumberOptionalSampling temperature 0–2
max_tokensintegerOptionalMax tokens to generate
toolsobject[]OptionalFunction / tool-call definitions

from openai import OpenAI

client = 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)