クイックスタート
キーを作成し、数分でモデルからの応答を受け取ります。
残高のある Webway アカウントと API キーが必要です。
1. キーを作成する
API キーを開いてキーを作成し、すぐにコピーしてください。キーの全体が 表示されるのは一度だけです。
export WEBWAY_API_KEY="sk-ww-…"
キーはシェルまたはシークレットマネージャーに保管し、ソースコードには決して書かないでください。
2. リクエストを送る
curl https://api.webway.sh/v1/chat/completions \
-H "Authorization: Bearer $WEBWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.6-terra",
"messages": [
{"role": "user", "content": "Explain this API in one sentence."}
]
}'
応答は choices[0].message.content に入っています。
OpenAI SDK を使う
カスタムのベース URL を受け付ける OpenAI クライアントであれば、Webway を利用できます。
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.webway.sh/v1",
api_key=os.environ["WEBWAY_API_KEY"],
)
response = client.chat.completions.create(
model="openai/gpt-5.6-terra",
messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(response.choices[0].message.content)
SDK のベース URL に /chat/completions までを含めないでください。SDK がそのパスを
自分で付加します。