Skip to content

🌐 เอกสารภาษาไทยกำลังจัดทำ — เนื้อหาด้านล่างเป็นภาษาอังกฤษชั่วคราว จนกว่าจะมีการแปล. This page is not yet translated; English content is shown temporarily.

Connect a client

The gateway exposes an OpenAI-compatible API, so any OpenAI-compatible client or SDK works with two settings: the base URL and your API key.

Prerequisites

Your endpoint

SettingValue
Base URLhttps://api.<your-domain>/v1
AuthAuthorization: Bearer <your-api-key>
Modela logical model your group is allowed, e.g. coding-default or bulk (see Models & routing)

The console's Connect a client page shows your exact base URL, your allowed models, and copy-paste snippets.

The Connect-a-client page — generated config for your client

curl

bash
curl https://api.<your-domain>/v1/chat/completions \
  -H "Authorization: Bearer $OPSTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "coding-default",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

OpenAI SDK (Python)

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.<your-domain>/v1",
    api_key="<your-api-key>",
)
resp = client.chat.completions.create(
    model="coding-default",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

opencode / Crush

Point the tool at the gateway as an OpenAI-compatible provider — set the base URL to https://api.<your-domain>/v1, the API key to your issued key, and the model to one of your allowed logical models. The Connect a client page generates the exact config block for your tool.

Next steps

Enterprise AI governance, on infrastructure you own.